summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2015-07-18 14:06:38 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2015-07-18 14:06:38 +0200
commita73624a3c4fda928b9377bb31df3b8df95515a39 (patch)
tree70f11ed2b1e9ea11a8980fa504883ccb77244d16
parenteb63e191b1069007056d5ec5c601f8e31a9c22ef (diff)
Windows version - fix includes so IOCTL_STORAGE_QUERY_PROPERTY is defined
-rw-r--r--configure.ac6
-rw-r--r--src/hdwin32.c14
2 files changed, 12 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index 11165d2..ca3f6d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -431,6 +431,12 @@ AC_CHECK_HEADERS([winioctl.h],,,
#include <windef.h>
#endif
]])
+AC_CHECK_HEADERS([w32api/winioctl.h],,,
+[[
+#ifdef HAVE_WINDEF_H
+#include <windef.h>
+#endif
+]])
AC_CHECK_HEADERS([ext2fs/ext2_fs.h],,,
[[
diff --git a/src/hdwin32.c b/src/hdwin32.c
index 8bc76f5..523014c 100644
--- a/src/hdwin32.c
+++ b/src/hdwin32.c
@@ -22,7 +22,7 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-
+
#if defined(__CYGWIN__) || defined(__MINGW32__)
#include <stdio.h>
#include "types.h"
@@ -38,18 +38,17 @@
#include <winbase.h>
#endif
#include <ctype.h> /* isspace */
-#ifdef HAVE_W32API_DDK_NTDDDISK_H
-#include <w32api/ddk/ntdddisk.h>
+#ifdef HAVE_WINIOCTL_H
+#include <winioctl.h>
#endif
-#ifdef HAVE_DDK_NTDDSTOR_H
-#include <ddk/ntddstor.h>
+#ifdef HAVE_W32API_WINIOCTL_H
+#include <w32api/winioctl.h>
#endif
#include "log.h"
#include "hdwin32.h"
void file_win32_disk_get_model(HANDLE handle, disk_t *dev, const int verbose)
{
-#ifdef IOCTL_STORAGE_QUERY_PROPERTY
DWORD cbBytesReturned = 0;
STORAGE_PROPERTY_QUERY query;
char buffer [10240];
@@ -64,7 +63,7 @@ void file_win32_disk_get_model(HANDLE handle, disk_t *dev, const int verbose)
&buffer,
sizeof (buffer)-1,
&cbBytesReturned, NULL) )
- {
+ {
const STORAGE_DEVICE_DESCRIPTOR * descrip = (const STORAGE_DEVICE_DESCRIPTOR *) & buffer;
const unsigned int offsetVendor=descrip->VendorIdOffset;
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;
}
}
-#endif
}
#endif