mountmgr.sys: Create "DeviceDesc" registry entry for USBSTOR device (eterbug #4403).
authorAlexander Morozov <amorozov@etersoft.ru>
Wed, 17 Mar 2010 12:45:51 +0000 (15:45 +0300)
committerIlya Shpigor <shpigor@etersoft.ru>
Tue, 23 Mar 2010 12:40:04 +0000 (15:40 +0300)
dlls/mountmgr.sys/device.c

index cc17f9db5489b1b044aca4477377027f001c803c..6d0215576de10ba4952b24794a7676cd1a2d6375 100644 (file)
@@ -513,6 +513,7 @@ static void register_usbstor_device( struct dos_drive *drive, const char *vendor
                                      '%','s','&','P','r','o','d','_','%','s','&',
                                      'R','e','v','_','%','s','\\','%','s','&','0',0};
     static const WCHAR dos_devicesW[] = {'\\','D','o','s','D','e','v','i','c','e','s',0};
+    static const WCHAR disk_driveW[] = {'D','i','s','k',' ','d','r','i','v','e',0};
     WCHAR diskW[] = {'\\','D','o','s','D','e','v','i','c','e','s','\\',
                      'A' + drive->drive,':',0};
     LPWSTR devnameW, vendorW, productW, revisionW, serialW, linkW, device_idW = NULL;
@@ -576,6 +577,11 @@ static void register_usbstor_device( struct dos_drive *drive, const char *vendor
         ret = SetupDiRegisterDeviceInfo( set, &devInfo, 0, NULL, NULL, NULL );
         if (!ret) goto done;
     }
+    SetupDiGetDeviceRegistryPropertyW( set, &devInfo, SPDRP_DEVICEDESC,
+                                       NULL, NULL, 0, &size );
+    if (!size)
+        SetupDiSetDeviceRegistryPropertyW( set, &devInfo, SPDRP_DEVICEDESC,
+                                           (BYTE *)disk_driveW, sizeof(disk_driveW) );
     interfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
     ret = SetupDiCreateDeviceInterfaceW( set, &devInfo, &GUID_DEVINTERFACE_DISK,
                                         NULL, 0, &interfaceData );