diff options
author | Pete Batard <pbatard@gmail.com> | 2010-10-27 16:26:45 +0100 |
---|---|---|
committer | Pete Batard <pbatard@gmail.com> | 2010-10-27 16:26:45 +0100 |
commit | c911ab1db2372bc6109bbb57e16c3704ef72b493 (patch) | |
tree | 03ac0fd2c0f5ab111c43fa259b0558d4e8a50ea7 | |
parent | 3981b0d9d886cd60eb239cc892460df21cbd970b (diff) | |
download | libusb-c911ab1db2372bc6109bbb57e16c3704ef72b493.tar.gz |
proper removal of advapi32 library dependency
* advapi32 was still being used through RegQueryValueEx and
RegCloseKey
* also fixed overzealous removal of kernel32.lib, which
prevented DLL generation from WDK/DDK
-rw-r--r-- | libusb/os/libusb_sources | 2 | ||||
-rw-r--r-- | libusb/os/windows_usb.c | 6 | ||||
-rw-r--r-- | libusb/os/windows_usb.h | 3 |
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, ®_type, + s = pRegQueryValueExW(key, L"DeviceInterfaceGUIDs", NULL, ®_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 |