Juan Lang : setupapi: Save device description to registry when creating a device.

Alexandre Julliard julliard at winehq.org
Fri Sep 21 07:23:05 CDT 2007


Module: wine
Branch: master
Commit: 8985a62a340a7f1fdd44c91c878d0c94a0af5474
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8985a62a340a7f1fdd44c91c878d0c94a0af5474

Author: Juan Lang <juan.lang at gmail.com>
Date:   Thu Sep 20 09:13:00 2007 -0700

setupapi: Save device description to registry when creating a device.

---

 dlls/setupapi/devinst.c |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c
index 3a4c130..0a3e599 100644
--- a/dlls/setupapi/devinst.c
+++ b/dlls/setupapi/devinst.c
@@ -997,15 +997,22 @@ BOOL WINAPI SetupDiCreateDeviceInfoW(
 
         ret = SETUPDI_AddDeviceToSet(set, ClassGuid, 0 /* FIXME: DevInst */,
                 instanceId, &dev);
-        if (ret && DeviceInfoData)
+        if (ret)
         {
-            if (DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA))
+            if (DeviceDescription)
+                SetupDiSetDeviceRegistryPropertyW(DeviceInfoSet,
+                    dev, SPDRP_DEVICEDESC, (const BYTE *)DeviceDescription,
+                    lstrlenW(DeviceDescription) * sizeof(WCHAR));
+            if (DeviceInfoData)
             {
-                SetLastError(ERROR_INVALID_USER_BUFFER);
-                ret = FALSE;
+                if (DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA))
+                {
+                    SetLastError(ERROR_INVALID_USER_BUFFER);
+                    ret = FALSE;
+                }
+                else
+                    memcpy(DeviceInfoData, dev, sizeof(SP_DEVINFO_DATA));
             }
-            else
-                memcpy(DeviceInfoData, dev, sizeof(SP_DEVINFO_DATA));
         }
     }
     if (allocatedInstanceId)




More information about the wine-cvs mailing list