summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Batard <pbatard@gmail.com>2010-01-14 01:43:51 +0000
committerPete Batard <pbatard@gmail.com>2010-01-14 01:43:51 +0000
commit48c56e26825928679057563d154283405aa84764 (patch)
tree963691341a5e7e76613fcf9a36d80008e950ce9a
parent9ab74d5af1475debc444150d65efb94ab759b579 (diff)
downloadlibusb-48c56e26825928679057563d154283405aa84764.tar.gz
svn r68: - fixed improper WINVER for Visual Studio on Windows 7 and DDK include errors
-rw-r--r--libusb/os/windows_usb.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c
index 14f1176..3465958 100644
--- a/libusb/os/windows_usb.c
+++ b/libusb/os/windows_usb.c
@@ -18,6 +18,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#if defined(_MSC_VER)
+// If the following is true, then Microsoft provided an improper WINVER
+// to Visual Studio 2008 on Windows 7. Both should be set to 0x601
+#if (WINVER <= _WIN32_WINNT_LONGHORN) && (WINVER >= _WIN32_WINNT_WIN7)
+#undef WINVER
+#define WINVER 0x601
+#undef _WIN32_WINNT_WIN7
+#define _WIN32_WINNT_WIN7 0x601
+#endif
#include <config_msvc.h>
#else
#include <config.h>
@@ -32,11 +40,15 @@
#include <tchar.h>
#include <setupapi.h>
#if defined(_MSC_VER)
-#include <api/usbiodef.h>
-#include <api/usbioctl.h>
+// Fixes DDK errors
+#if !defined __drv_maxIRQL
+#define __drv_maxIRQL(x)
+#endif
#if !defined __drv_preferredFunction
#define __drv_preferredFunction(func,why)
#endif
+#include <api/usbiodef.h>
+#include <api/usbioctl.h>
#include <api/cfgmgr32.h>
#else
#include <ddk/usbiodef.h>
@@ -883,6 +895,7 @@ static int set_composite_device(struct libusb_context *ctx, DEVINST devinst, str
usbi_warn(ctx, "could not retrieve info data: %s", windows_error_str(0));
continue;
}
+ usbi_dbg("found path: %s", dev_interface_details->DevicePath);
if(!SetupDiGetDeviceRegistryProperty(dev_info, &dev_info_data, SPDRP_SERVICE,
NULL, (BYTE*)driver, MAX_KEY_LENGTH, &size)) {
@@ -899,6 +912,7 @@ static int set_composite_device(struct libusb_context *ctx, DEVINST devinst, str
}
}
}
+ usbi_dbg("found %d paths", nb_paths);
// Finally, match the interface paths with the interfaces. We do that
// by looking at the children of the composite device