summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libusb/os/libusb_sources2
-rw-r--r--libusb/os/windows_usb.c6
-rw-r--r--libusb/os/windows_usb.h3
3 files changed, 8 insertions, 3 deletions
diff --git a/libusb/os/libusb_sources b/libusb/os/libusb_sources
index 5aa8b87..0f38ddb 100644
--- a/libusb/os/libusb_sources
+++ b/libusb/os/libusb_sources
@@ -24,6 +24,8 @@ C_DEFINES= $(C_DEFINES) $(LIBUSB_DEFINES) /DDDKBUILD
# an older compiler than other objects; rebuild old objects and libraries"
USER_C_FLAGS=/GL-
+TARGETLIBS=$(SDK_LIB_PATH)\kernel32.lib
+
SOURCES=..\core.c \
..\descriptor.c \
..\io.c \
diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c
index 49220c9..e9ad2a6 100644
--- a/libusb/os/windows_usb.c
+++ b/libusb/os/windows_usb.c
@@ -274,6 +274,8 @@ static int init_dlls(void)
DLL_LOAD_PREFIXED(SetupAPI.dll, p, SetupDiDestroyDeviceInfoList, TRUE);
DLL_LOAD_PREFIXED(SetupAPI.dll, p, SetupDiOpenDevRegKey, TRUE);
DLL_LOAD_PREFIXED(SetupAPI.dll, p, SetupDiGetDeviceRegistryPropertyA, TRUE);
+ DLL_LOAD_PREFIXED(AdvAPI32.dll, p, RegQueryValueExW, TRUE);
+ DLL_LOAD_PREFIXED(AdvAPI32.dll, p, RegCloseKey, TRUE);
return LIBUSB_SUCCESS;
}
@@ -1379,9 +1381,9 @@ static int windows_get_device_list(struct libusb_context *ctx, struct discovered
key = pSetupDiOpenDevRegKey(dev_info, &dev_info_data, DICS_FLAG_GLOBAL, 0, DIREG_DEV, KEY_READ);
if (key != INVALID_HANDLE_VALUE) {
size = sizeof(guid_string_w);
- s = RegQueryValueExW(key, L"DeviceInterfaceGUIDs", NULL, &reg_type,
+ s = pRegQueryValueExW(key, L"DeviceInterfaceGUIDs", NULL, &reg_type,
(BYTE*)guid_string_w, &size);
- RegCloseKey(key);
+ pRegCloseKey(key);
if (s == ERROR_SUCCESS) {
if (nb_guids >= MAX_ENUM_GUIDS) {
// If this assert is ever reported, grow a GUID table dynamically
diff --git a/libusb/os/windows_usb.h b/libusb/os/windows_usb.h
index 133ef73..8851f41 100644
--- a/libusb/os/windows_usb.h
+++ b/libusb/os/windows_usb.h
@@ -367,7 +367,8 @@ DLL_DECLARE_PREFIXED(WINAPI, BOOL, p, SetupDiDestroyDeviceInfoList, (HDEVINFO));
DLL_DECLARE_PREFIXED(WINAPI, HKEY, p, SetupDiOpenDevRegKey, (HDEVINFO, PSP_DEVINFO_DATA, DWORD, DWORD, DWORD, REGSAM));
DLL_DECLARE_PREFIXED(WINAPI, BOOL, p, SetupDiGetDeviceRegistryPropertyA, (HDEVINFO,
PSP_DEVINFO_DATA, DWORD, PDWORD, PBYTE, DWORD, PDWORD));
-
+DLL_DECLARE_PREFIXED(WINAPI, LONG, p, RegQueryValueExW, (HKEY, LPCWSTR, LPDWORD, LPDWORD, LPBYTE, LPDWORD));
+DLL_DECLARE_PREFIXED(WINAPI, LONG, p, RegCloseKey, (HKEY));
/*
* Windows DDK API definitions. Most of it copied from MinGW's includes