aboutsummaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2012-06-29 13:18:55 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2012-06-29 13:18:55 -0700
commit6c24333f79ce4c5a894edc9b2e7b7dc78f081f63 (patch)
tree9aee4776953c06c5b508cf965644f6a86ec84a62 /win
parent15cbfdfd390402057d237664ac087140608bf80b (diff)
downloadsyslinux-6c24333f79ce4c5a894edc9b2e7b7dc78f081f63.tar.gz
syslinux-6c24333f79ce4c5a894edc9b2e7b7dc78f081f63.tar.xz
syslinux-6c24333f79ce4c5a894edc9b2e7b7dc78f081f63.zip
win: Use lower-case private definition of STORAGE_DEVICE_NUMBER
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>
Diffstat (limited to 'win')
-rw-r--r--win/syslinux.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/win/syslinux.c b/win/syslinux.c
index c0c4fb23..669450eb 100644
--- a/win/syslinux.c
+++ b/win/syslinux.c
@@ -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,