win: Use lower-case private definition of STORAGE_DEVICE_NUMBER
authorH. Peter Anvin <hpa@linux.intel.com>
Fri, 29 Jun 2012 20:18:55 +0000 (13:18 -0700)
committerH. Peter Anvin <hpa@linux.intel.com>
Fri, 29 Jun 2012 20:18:55 +0000 (13:18 -0700)
Since we can't know if <winioctl.h> actually defines
STORAGE_DEVICE_NUMBER, just use a private definition of the structure
but with a lower-case name.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
win/syslinux.c

index c0c4fb2..669450e 100644 (file)
@@ -50,16 +50,16 @@ void error(char *msg);
 // The following struct should be in the ntddstor.h file, but I didn't have it.
 // mingw32 has <ddk/ntddstor.h>, but including that file causes all kinds
 // of other failures.  mingw64 has it in <winioctl.h>.
-#if 0 /* Until we can figure out how to auto-detect this? */
-typedef struct _STORAGE_DEVICE_NUMBER {
+// Thus, instead of STORAGE_DEVICE_NUMBER, use a lower-case private
+// definition...
+struct storage_device_number {
     DEVICE_TYPE DeviceType;
     ULONG DeviceNumber;
     ULONG PartitionNumber;
-} STORAGE_DEVICE_NUMBER, *PSTORAGE_DEVICE_NUMBER;
-#endif
+};
 
 BOOL GetStorageDeviceNumberByHandle(HANDLE handle,
-                                   const STORAGE_DEVICE_NUMBER * sdn)
+                                   const struct storage_device_number *sdn)
 {
     BOOL result = FALSE;
     DWORD count;
@@ -447,7 +447,7 @@ map_done:
 
     /* If desired, fix the MBR */
     if (opt.install_mbr || opt.activate_partition) {
-       STORAGE_DEVICE_NUMBER sdn;
+       struct storage_device_number sdn;
        if (GetStorageDeviceNumberByHandle(d_handle, &sdn)) {
            if (!FixMBR(sdn.DeviceNumber, sdn.PartitionNumber, opt.install_mbr, opt.activate_partition)) {
                fprintf(stderr,