From 48c56e26825928679057563d154283405aa84764 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Thu, 14 Jan 2010 01:43:51 +0000 Subject: svn r68: - fixed improper WINVER for Visual Studio on Windows 7 and DDK include errors --- libusb/os/windows_usb.c | 18 ++++++++++++++++-- 1 file 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 #else #include @@ -32,11 +40,15 @@ #include #include #if defined(_MSC_VER) -#include -#include +// Fixes DDK errors +#if !defined __drv_maxIRQL +#define __drv_maxIRQL(x) +#endif #if !defined __drv_preferredFunction #define __drv_preferredFunction(func,why) #endif +#include +#include #include #else #include @@ -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 -- cgit v1.2.1