On 05/09/2011 07:42 AM, Charles Davis wrote:
Try 5: Get the value of "DeviceName" from mountmgr instead of making one up.
Try 4: Fix unused variable warning.
Try 3: Add support for IDE drives.
Try 2: Don't depend on the SCSI generic driver on Linux.

-    RtlCreateUnicodeStringFromAsciiz( &nameW, "FirstBusTimeScanInMs" );
+    static const WCHAR bus_scan_timeW[] = 
{'F','i','r','s','t','B','u','s','S','c','a','n','T','i','m','e','I','n','M','s',0};
These do not match.


+    if (devtype)
+    {
+        if (!(type = p_libhal_device_get_property_string( ctx, udi, 
"storage.drive_type",&error )))
+            *devtype = ~0;
+        else if (!strcmp( type, "disk" ) || !strcmp( type, "floppy" ))
+            *devtype = 0x00;
+        else if (!strcmp( type, "tape" ))
+            *devtype = 0x01;
+        else if (!strcmp( type, "cdrom" ))
+            *devtype = 0x05;
+        else if (!strcmp( type, "raid" ))
+            *devtype = 0x0C;
+        else
+            *devtype = ~0;
+    }
Please don't use magic numbers here. Also these numbers are wrong. From winbase.h:
#define DRIVE_UNKNOWN              0
#define DRIVE_NO_ROOT_DIR          1
#define DRIVE_REMOVABLE            2
#define DRIVE_FIXED                3
#define DRIVE_REMOTE               4
/* Win32 additions */
#define DRIVE_CDROM                5
#define DRIVE_RAMDISK              6

Missing "DeviceName"="Cdrom0" for cdroms.

Also names of devices do not match. This can potentially break some software:
-"Identifier"="ATA     Hitachi HDS72202JKAO"
+"Identifier"="ATA Hitachi HDS72202"
-"Identifier"="ATA     WDC WD7500AAKS-030.0"
+"Identifier"="ATA WDC WD7500AAKS-0"
-"Identifier"="SAMSUNG DVDWBD SH-B083L SB01"
+"Identifier"="SAMSUNG DVDWBD SH-B083L"

Vitaliy.


Reply via email to