Windows version - fix includes so IOCTL_STORAGE_QUERY_PROPERTY is defined

This commit is contained in:
Christophe Grenier 2015-07-18 14:06:38 +02:00
parent eb63e191b1
commit a73624a3c4
2 changed files with 12 additions and 8 deletions

View file

@ -431,6 +431,12 @@ AC_CHECK_HEADERS([winioctl.h],,,
#include <windef.h> #include <windef.h>
#endif #endif
]]) ]])
AC_CHECK_HEADERS([w32api/winioctl.h],,,
[[
#ifdef HAVE_WINDEF_H
#include <windef.h>
#endif
]])
AC_CHECK_HEADERS([ext2fs/ext2_fs.h],,, AC_CHECK_HEADERS([ext2fs/ext2_fs.h],,,
[[ [[

View file

@ -22,7 +22,7 @@
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif #endif
#if defined(__CYGWIN__) || defined(__MINGW32__) #if defined(__CYGWIN__) || defined(__MINGW32__)
#include <stdio.h> #include <stdio.h>
#include "types.h" #include "types.h"
@ -38,18 +38,17 @@
#include <winbase.h> #include <winbase.h>
#endif #endif
#include <ctype.h> /* isspace */ #include <ctype.h> /* isspace */
#ifdef HAVE_W32API_DDK_NTDDDISK_H #ifdef HAVE_WINIOCTL_H
#include <w32api/ddk/ntdddisk.h> #include <winioctl.h>
#endif #endif
#ifdef HAVE_DDK_NTDDSTOR_H #ifdef HAVE_W32API_WINIOCTL_H
#include <ddk/ntddstor.h> #include <w32api/winioctl.h>
#endif #endif
#include "log.h" #include "log.h"
#include "hdwin32.h" #include "hdwin32.h"
void file_win32_disk_get_model(HANDLE handle, disk_t *dev, const int verbose) void file_win32_disk_get_model(HANDLE handle, disk_t *dev, const int verbose)
{ {
#ifdef IOCTL_STORAGE_QUERY_PROPERTY
DWORD cbBytesReturned = 0; DWORD cbBytesReturned = 0;
STORAGE_PROPERTY_QUERY query; STORAGE_PROPERTY_QUERY query;
char buffer [10240]; char buffer [10240];
@ -64,7 +63,7 @@ void file_win32_disk_get_model(HANDLE handle, disk_t *dev, const int verbose)
&buffer, &buffer,
sizeof (buffer)-1, sizeof (buffer)-1,
&cbBytesReturned, NULL) ) &cbBytesReturned, NULL) )
{ {
const STORAGE_DEVICE_DESCRIPTOR * descrip = (const STORAGE_DEVICE_DESCRIPTOR *) & buffer; const STORAGE_DEVICE_DESCRIPTOR * descrip = (const STORAGE_DEVICE_DESCRIPTOR *) & buffer;
const unsigned int offsetVendor=descrip->VendorIdOffset; const unsigned int offsetVendor=descrip->VendorIdOffset;
const unsigned int offsetProduct=descrip->ProductIdOffset; const unsigned int offsetProduct=descrip->ProductIdOffset;
@ -111,6 +110,5 @@ void file_win32_disk_get_model(HANDLE handle, disk_t *dev, const int verbose)
dev->model=NULL; dev->model=NULL;
} }
} }
#endif
} }
#endif #endif