[syslinux:master] win: Use lower-case private definition of STORAGE_DEVICE_NUMBER
syslinux-bot for H. Peter Anvin
hpa at linux.intel.com
Fri Jun 29 13:21:02 PDT 2012
Commit-ID: 6c24333f79ce4c5a894edc9b2e7b7dc78f081f63
Gitweb: http://www.syslinux.org/commit/6c24333f79ce4c5a894edc9b2e7b7dc78f081f63
Author: H. Peter Anvin <hpa at linux.intel.com>
AuthorDate: Fri, 29 Jun 2012 13:18:55 -0700
Committer: H. Peter Anvin <hpa at linux.intel.com>
CommitDate: Fri, 29 Jun 2012 13:18:55 -0700
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 at linux.intel.com>
---
win/syslinux.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/win/syslinux.c b/win/syslinux.c
index c0c4fb2..669450e 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,
More information about the Syslinux-commits
mailing list