diff options
author | Pete Batard <pbatard@gmail.com> | 2010-10-26 16:31:13 +0100 |
---|---|---|
committer | Pete Batard <pbatard@gmail.com> | 2010-10-26 16:31:13 +0100 |
commit | 5a2aa170f3a5ba651c76542ea6e65d4d78bcf3b6 (patch) | |
tree | f057952cff41a42889980d025be050e254905c0e | |
parent | 281d8009bec0a46c28b4717c2c14630172dd2593 (diff) | |
download | libusb-5a2aa170f3a5ba651c76542ea6e65d4d78bcf3b6.tar.gz |
removed SetupAPI, AdvAPI32 and OLE32 dependencies
* this ensures that libusb dependent applications only need
to link with libusb on Windows
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | examples/lsusb.vcproj | 4 | ||||
-rw-r--r-- | examples/lsusb_2008.vcproj | 4 | ||||
-rw-r--r-- | examples/lsusb_sources | 14 | ||||
-rw-r--r-- | examples/xusb.c | 10 | ||||
-rw-r--r-- | examples/xusb.vcproj | 4 | ||||
-rw-r--r-- | examples/xusb_2008.vcproj | 4 | ||||
-rw-r--r-- | examples/xusb_sources | 13 | ||||
-rw-r--r-- | libusb/os/windows_usb.c | 58 | ||||
-rw-r--r-- | libusb/os/windows_usb.h | 36 | ||||
-rw-r--r-- | libusb_dll.vcproj | 4 | ||||
-rw-r--r-- | libusb_dll_2008.vcproj | 4 |
12 files changed, 61 insertions, 96 deletions
diff --git a/configure.ac b/configure.ac index cf12516..fef7168 100644 --- a/configure.ac +++ b/configure.ac @@ -73,7 +73,6 @@ case $host in backend="windows" threads="windows" create_import_lib="yes" - PC_LIBS_PRIVATE="-lsetupapi -lole32 -ladvapi32" LIBS="${LIBS} ${PC_LIBS_PRIVATE}" # -avoid-version to avoid a naming scheme such as libusb-0.dll AM_LDFLAGS="-no-undefined -avoid-version -Wl,--add-stdcall-alias" @@ -88,7 +87,6 @@ case $host in AC_MSG_RESULT([Windows]) backend="windows" threads="posix" - PC_LIBS_PRIVATE="-lsetupapi -lole32 -ladvapi32" LIBS="${LIBS} ${PC_LIBS_PRIVATE}" AM_CFLAGS="-std=c99" AM_LDFLAGS="-no-undefined -avoid-version" diff --git a/examples/lsusb.vcproj b/examples/lsusb.vcproj index 3f9bc19..ec6c439 100644 --- a/examples/lsusb.vcproj +++ b/examples/lsusb.vcproj @@ -64,7 +64,6 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="setupapi.lib ole32.lib advapi32.lib"
LinkIncremental="2"
AdditionalLibraryDirectories="..\msvc"
GenerateDebugInformation="true"
@@ -140,7 +139,6 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="setupapi.lib ole32.lib advapi32.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="..\msvc"
GenerateDebugInformation="true"
@@ -221,7 +219,6 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="setupapi.lib"
LinkIncremental="2"
AdditionalLibraryDirectories="..\msvc"
GenerateDebugInformation="true"
@@ -298,7 +295,6 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="setupapi.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="..\msvc"
GenerateDebugInformation="true"
diff --git a/examples/lsusb_2008.vcproj b/examples/lsusb_2008.vcproj index 0313226..70de59d 100644 --- a/examples/lsusb_2008.vcproj +++ b/examples/lsusb_2008.vcproj @@ -62,7 +62,6 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="setupapi.lib advapi32.lib ole32.lib"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
ProgramDatabaseFile="$(TargetDir)$(ProjectName).pdb"
@@ -135,7 +134,6 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="setupapi.lib advapi32.lib ole32.lib"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
ProgramDatabaseFile="$(TargetDir)$(ProjectName).pdb"
@@ -206,7 +204,6 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="setupapi.lib advapi32.lib ole32.lib"
AdditionalLibraryDirectories=""
ProgramDatabaseFile="$(TargetDir)$(ProjectName).pdb"
SubSystem="1"
@@ -277,7 +274,6 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="setupapi.lib advapi32.lib ole32.lib"
AdditionalLibraryDirectories=""
ProgramDatabaseFile="$(TargetDir)$(ProjectName).pdb"
SubSystem="1"
diff --git a/examples/lsusb_sources b/examples/lsusb_sources index c61f810..8600180 100644 --- a/examples/lsusb_sources +++ b/examples/lsusb_sources @@ -3,26 +3,12 @@ TARGETTYPE=PROGRAM 386_STDCALL=0 _NT_TARGET_VERSION= $(_NT_TARGET_VERSION_WINXP) - !IFNDEF MSC_WARNING_LEVEL - MSC_WARNING_LEVEL=/W3 - !ENDIF - - USE_MSVCRT=1 - UMTYPE=console - INCLUDES=..\..\msvc;..\..;$(DDK_INC_PATH) - UMLIBS=..\..\libusb\os\obj$(BUILD_ALT_DIR)\*\libusb-1.0.lib - -TARGETLIBS=$(SDK_LIB_PATH)\setupapi.lib \ - $(SDK_LIB_PATH)\ole32.lib \ - $(SDK_LIB_PATH)\advapi32.lib - SOURCES=..\lsusb.c - diff --git a/examples/xusb.c b/examples/xusb.c index 742c931..777a698 100644 --- a/examples/xusb.c +++ b/examples/xusb.c @@ -31,19 +31,11 @@ #include <libusb/libusb.h> -#if defined(_MSC_VER) -// On Windows, the libusb library has a dependency on the libraries below. -// for MinGW/cygwin, make sure you link with -lsetupapi -lole32 -ladvapi32 -#pragma comment( lib, "setupapi.lib" ) -#pragma comment( lib, "ole32.lib" ) -#pragma comment( lib, "advapi32.lib" ) -#endif - #ifdef OS_WINDOWS #define msleep(msecs) Sleep(msecs) #else #include <unistd.h> -#define msleep(msecs) usleep(1000*msecs) +#define msleep(msecs) usleep(1000*msecs) #endif #if !defined(_MSC_VER) || _MSC_VER<=1200 diff --git a/examples/xusb.vcproj b/examples/xusb.vcproj index bf2d801..d65163f 100644 --- a/examples/xusb.vcproj +++ b/examples/xusb.vcproj @@ -64,7 +64,6 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="setupapi.lib ole32.lib advapi32.lib"
LinkIncremental="2"
AdditionalLibraryDirectories="..\msvc"
GenerateDebugInformation="true"
@@ -140,7 +139,6 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="setupapi.lib ole32.lib advapi32.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="..\msvc"
GenerateDebugInformation="true"
@@ -221,7 +219,6 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="setupapi.lib"
LinkIncremental="2"
AdditionalLibraryDirectories="..\msvc"
GenerateDebugInformation="true"
@@ -298,7 +295,6 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="setupapi.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="..\msvc"
GenerateDebugInformation="true"
diff --git a/examples/xusb_2008.vcproj b/examples/xusb_2008.vcproj index 270c2da..71dcf44 100644 --- a/examples/xusb_2008.vcproj +++ b/examples/xusb_2008.vcproj @@ -63,7 +63,6 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="setupapi.lib advapi32.lib ole32.lib"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
SubSystem="1"
@@ -136,7 +135,6 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="setupapi.lib advapi32.lib ole32.lib"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
SubSystem="1"
@@ -206,7 +204,6 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="setupapi.lib advapi32.lib ole32.lib"
AdditionalLibraryDirectories=""
SubSystem="1"
TargetMachine="1"
@@ -276,7 +273,6 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="setupapi.lib advapi32.lib ole32.lib"
AdditionalLibraryDirectories=""
SubSystem="1"
TargetMachine="17"
diff --git a/examples/xusb_sources b/examples/xusb_sources index 79cd038..f7bd1a0 100644 --- a/examples/xusb_sources +++ b/examples/xusb_sources @@ -5,24 +5,11 @@ TARGETTYPE=PROGRAM _NT_TARGET_VERSION= $(_NT_TARGET_VERSION_WINXP) !IFNDEF MSC_WARNING_LEVEL - MSC_WARNING_LEVEL=/W3 - !ENDIF - - USE_MSVCRT=1 - UMTYPE=console - INCLUDES=..\..\msvc;..\..;$(DDK_INC_PATH) - UMLIBS=..\..\libusb\os\obj$(BUILD_ALT_DIR)\*\libusb-1.0.lib - -TARGETLIBS=$(SDK_LIB_PATH)\setupapi.lib \ - $(SDK_LIB_PATH)\ole32.lib \ - $(SDK_LIB_PATH)\advapi32.lib - SOURCES=..\xusb.c - diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c index 1ed72d4..38a149b 100644 --- a/libusb/os/windows_usb.c +++ b/libusb/os/windows_usb.c @@ -41,7 +41,7 @@ #include <process.h> #include <stdio.h> #include <inttypes.h> -#include <objbase.h> // for string to GUID conv. requires libole32.a +#include <objbase.h> #include <winioctl.h> #include <libusbi.h> @@ -257,15 +257,23 @@ static char* sanitize_path(const char* path) } /* - * Cfgmgr32 API functions + * Cfgmgr32, OLE32 and SetupAPI DLL functions */ -static int Cfgmgr32_init(void) +static int init_dlls(void) { DLL_LOAD(Cfgmgr32.dll, CM_Get_Parent, TRUE); DLL_LOAD(Cfgmgr32.dll, CM_Get_Child, TRUE); DLL_LOAD(Cfgmgr32.dll, CM_Get_Sibling, TRUE); DLL_LOAD(Cfgmgr32.dll, CM_Get_Device_IDA, TRUE); - + // Prefixed to avoid conflict with header files + DLL_LOAD_PREFIXED(OLE32.dll, p, CLSIDFromString, TRUE); + DLL_LOAD_PREFIXED(SetupAPI.dll, p, SetupDiGetClassDevsA, TRUE); + DLL_LOAD_PREFIXED(SetupAPI.dll, p, SetupDiEnumDeviceInfo, TRUE); + DLL_LOAD_PREFIXED(SetupAPI.dll, p, SetupDiEnumDeviceInterfaces, TRUE); + DLL_LOAD_PREFIXED(SetupAPI.dll, p, SetupDiGetDeviceInterfaceDetailA, TRUE); + DLL_LOAD_PREFIXED(SetupAPI.dll, p, SetupDiDestroyDeviceInfoList, TRUE); + DLL_LOAD_PREFIXED(SetupAPI.dll, p, SetupDiOpenDevRegKey, TRUE); + DLL_LOAD_PREFIXED(SetupAPI.dll, p, SetupDiGetDeviceRegistryPropertyA, TRUE); return LIBUSB_SUCCESS; } @@ -286,19 +294,19 @@ bool get_devinfo_data(struct libusb_context *ctx, HDEVINFO *dev_info, SP_DEVINFO_DATA *dev_info_data, unsigned _index) { if (_index <= 0) { - *dev_info = SetupDiGetClassDevsA(NULL, "USB", NULL, DIGCF_PRESENT|DIGCF_ALLCLASSES); + *dev_info = pSetupDiGetClassDevsA(NULL, "USB", NULL, DIGCF_PRESENT|DIGCF_ALLCLASSES); if (*dev_info == INVALID_HANDLE_VALUE) { return false; } } dev_info_data->cbSize = sizeof(SP_DEVINFO_DATA); - if (!SetupDiEnumDeviceInfo(*dev_info, _index, dev_info_data)) { + if (!pSetupDiEnumDeviceInfo(*dev_info, _index, dev_info_data)) { if (GetLastError() != ERROR_NO_MORE_ITEMS) { usbi_err(ctx, "Could not obtain device info data for index %u: %s", _index, windows_error_str(0)); } - SetupDiDestroyDeviceInfoList(*dev_info); + pSetupDiDestroyDeviceInfoList(*dev_info); *dev_info = INVALID_HANDLE_VALUE; return false; } @@ -326,35 +334,35 @@ SP_DEVICE_INTERFACE_DETAIL_DATA_A *get_interface_details(struct libusb_context * DWORD size; if (_index <= 0) { - *dev_info = SetupDiGetClassDevs(guid, NULL, NULL, DIGCF_PRESENT|DIGCF_DEVICEINTERFACE); + *dev_info = pSetupDiGetClassDevsA(guid, NULL, NULL, DIGCF_PRESENT|DIGCF_DEVICEINTERFACE); } if (dev_info_data != NULL) { dev_info_data->cbSize = sizeof(SP_DEVINFO_DATA); - if (!SetupDiEnumDeviceInfo(*dev_info, _index, dev_info_data)) { + if (!pSetupDiEnumDeviceInfo(*dev_info, _index, dev_info_data)) { if (GetLastError() != ERROR_NO_MORE_ITEMS) { usbi_err(ctx, "Could not obtain device info data for index %u: %s", _index, windows_error_str(0)); } - SetupDiDestroyDeviceInfoList(*dev_info); + pSetupDiDestroyDeviceInfoList(*dev_info); *dev_info = INVALID_HANDLE_VALUE; return NULL; } } dev_interface_data.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); - if (!SetupDiEnumDeviceInterfaces(*dev_info, NULL, guid, _index, &dev_interface_data)) { + if (!pSetupDiEnumDeviceInterfaces(*dev_info, NULL, guid, _index, &dev_interface_data)) { if (GetLastError() != ERROR_NO_MORE_ITEMS) { usbi_err(ctx, "Could not obtain interface data for index %u: %s", _index, windows_error_str(0)); } - SetupDiDestroyDeviceInfoList(*dev_info); + pSetupDiDestroyDeviceInfoList(*dev_info); *dev_info = INVALID_HANDLE_VALUE; return NULL; } // Read interface data (dummy + actual) to access the device path - if (!SetupDiGetDeviceInterfaceDetail(*dev_info, &dev_interface_data, NULL, 0, &size, NULL)) { + if (!pSetupDiGetDeviceInterfaceDetailA(*dev_info, &dev_interface_data, NULL, 0, &size, NULL)) { // The dummy call should fail with ERROR_INSUFFICIENT_BUFFER if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) { usbi_err(ctx, "could not access interface data (dummy) for index %u: %s", @@ -371,8 +379,8 @@ SP_DEVICE_INTERFACE_DETAIL_DATA_A *get_interface_details(struct libusb_context * goto err_exit; } - dev_interface_details->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA); - if (!SetupDiGetDeviceInterfaceDetailA(*dev_info, &dev_interface_data, + dev_interface_details->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_A); + if (!pSetupDiGetDeviceInterfaceDetailA(*dev_info, &dev_interface_data, dev_interface_details, size, &size, NULL)) { usbi_err(ctx, "could not access interface data (actual) for index %u: %s", _index, windows_error_str(0)); @@ -381,7 +389,7 @@ SP_DEVICE_INTERFACE_DETAIL_DATA_A *get_interface_details(struct libusb_context * return dev_interface_details; err_exit: - SetupDiDestroyDeviceInfoList(*dev_info); + pSetupDiDestroyDeviceInfoList(*dev_info); *dev_info = INVALID_HANDLE_VALUE; return NULL; } @@ -819,9 +827,9 @@ static int windows_init(struct libusb_context *ctx) // Initialize pollable file descriptors init_polling(); - // Load missing CFGMGR32.DLL imports - if (Cfgmgr32_init() != LIBUSB_SUCCESS) { - usbi_err(ctx, "could not resolve Cfgmgr32.dll functions"); + // Load DLL imports + if (init_dlls() != LIBUSB_SUCCESS) { + usbi_err(ctx, "could not resolve DLL functions"); return LIBUSB_ERROR_NOT_FOUND; } @@ -1127,7 +1135,7 @@ static uint8_t get_api_type(struct libusb_context *ctx, // Check the service & filter names to know the API we should use for (k=0; k<3; k++) { - if (SetupDiGetDeviceRegistryPropertyA(*dev_info, dev_info_data, lookup[k].reg_prop, + if (pSetupDiGetDeviceRegistryPropertyA(*dev_info, dev_info_data, lookup[k].reg_prop, ®_type, (BYTE*)lookup[k].list, MAX_KEY_LENGTH, &size)) { // Turn the REG_SZ SPDRP_SERVICE into REG_MULTI_SZ if (lookup[k].reg_prop == SPDRP_SERVICE) { @@ -1344,7 +1352,7 @@ static int windows_get_device_list(struct libusb_context *ctx, struct discovered // The SPDRP_ADDRESS for USB devices is the device port number on the hub port_nr = 0; if ((pass >= HUB_PASS) && (pass <= GEN_PASS)) { - if ( (!SetupDiGetDeviceRegistryProperty(dev_info, &dev_info_data, SPDRP_ADDRESS, + if ( (!pSetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_ADDRESS, ®_type, (BYTE*)&port_nr, 4, &size)) || (size != 4) ) { usbi_warn(ctx, "could not retrieve port number for device %s, skipping: %s", @@ -1362,13 +1370,13 @@ static int windows_get_device_list(struct libusb_context *ctx, struct discovered case GEN_PASS: // We use the GEN pass to detect driverless devices... size = sizeof(strbuf); - if (!SetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_DRIVER, + if (!pSetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_DRIVER, ®_type, (BYTE*)strbuf, size, &size)) { usbi_info(ctx, "The following device has no driver: '%s'", dev_id_path); usbi_info(ctx, "libusb will not be able to access it."); } // ...and to add the additional device interface GUIDs - key = SetupDiOpenDevRegKey(dev_info, &dev_info_data, DICS_FLAG_GLOBAL, 0, DIREG_DEV, KEY_READ); + 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, @@ -1381,7 +1389,7 @@ static int windows_get_device_list(struct libusb_context *ctx, struct discovered LOOP_BREAK(LIBUSB_ERROR_OVERFLOW); } if_guid = calloc(1, sizeof(GUID)); - CLSIDFromString(guid_string_w, if_guid); + pCLSIDFromString(guid_string_w, if_guid); guid[nb_guids++] = if_guid; usbi_dbg("extra GUID: %s", guid_to_string(if_guid)); } @@ -1392,7 +1400,7 @@ static int windows_get_device_list(struct libusb_context *ctx, struct discovered break; default: // DEV_PASS or EXT_PASS // Get the API type (after checking that the driver installation is OK) - if ( (!SetupDiGetDeviceRegistryProperty(dev_info, &dev_info_data, SPDRP_INSTALL_STATE, + if ( (!pSetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_INSTALL_STATE, ®_type, (BYTE*)&install_state, 4, &size)) || (size != 4) ){ usbi_warn(ctx, "could not detect installation state of driver for '%s': %s", diff --git a/libusb/os/windows_usb.h b/libusb/os/windows_usb.h index 80e3dec..133ef73 100644 --- a/libusb/os/windows_usb.h +++ b/libusb/os/windows_usb.h @@ -327,11 +327,11 @@ struct driver_lookup { /* * API macros - from libusb-win32 1.x */ -#define DLL_DECLARE(api, ret, name, args) \ +#define DLL_DECLARE_PREFIXED(api, ret, prefix, name, args) \ typedef ret (api * __dll_##name##_t)args; \ - static __dll_##name##_t name = NULL + static __dll_##name##_t prefix##name = NULL -#define DLL_LOAD(dll, name, ret_on_failure) \ +#define DLL_LOAD_PREFIXED(dll, prefix, name, ret_on_failure) \ do { \ HMODULE h = GetModuleHandleA(#dll); \ if (!h) \ @@ -340,16 +340,34 @@ struct driver_lookup { if (ret_on_failure) { return LIBUSB_ERROR_NOT_FOUND; }\ else { break; } \ } \ - name = (__dll_##name##_t)GetProcAddress(h, #name); \ - if (name) break; \ - name = (__dll_##name##_t)GetProcAddress(h, #name "A"); \ - if (name) break; \ - name = (__dll_##name##_t)GetProcAddress(h, #name "W"); \ - if (name) break; \ + prefix##name = (__dll_##name##_t)GetProcAddress(h, #name);\ + if (prefix##name) break; \ + prefix##name = (__dll_##name##_t)GetProcAddress(h, #name "A");\ + if (prefix##name) break; \ + prefix##name = (__dll_##name##_t)GetProcAddress(h, #name "W");\ + if (prefix##name) break; \ if(ret_on_failure) \ return LIBUSB_ERROR_NOT_FOUND; \ } while(0) +#define DLL_DECLARE(api, ret, name, args) DLL_DECLARE_PREFIXED(api, ret, , name, args) +#define DLL_LOAD(dll, name, ret_on_failure) DLL_LOAD_PREFIXED(dll, , name, ret_on_failure) + +/* OLE32 dependency */ +DLL_DECLARE_PREFIXED(WINAPI, HRESULT, p, CLSIDFromString, (LPCOLESTR, LPCLSID)); + +/* SetupAPI dependencies */ +DLL_DECLARE_PREFIXED(WINAPI, HDEVINFO, p, SetupDiGetClassDevsA, (const GUID*, PCSTR, HWND, DWORD)); +DLL_DECLARE_PREFIXED(WINAPI, BOOL, p, SetupDiEnumDeviceInfo, (HDEVINFO, DWORD, PSP_DEVINFO_DATA)); +DLL_DECLARE_PREFIXED(WINAPI, BOOL, p, SetupDiEnumDeviceInterfaces, (HDEVINFO, PSP_DEVINFO_DATA, + const GUID*, DWORD, PSP_DEVICE_INTERFACE_DATA)); +DLL_DECLARE_PREFIXED(WINAPI, BOOL, p, SetupDiGetDeviceInterfaceDetailA, (HDEVINFO, PSP_DEVICE_INTERFACE_DATA, + PSP_DEVICE_INTERFACE_DETAIL_DATA_A, DWORD, PDWORD, PSP_DEVINFO_DATA)); +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)); + /* * Windows DDK API definitions. Most of it copied from MinGW's includes diff --git a/libusb_dll.vcproj b/libusb_dll.vcproj index 4bfa498..aa4343e 100644 --- a/libusb_dll.vcproj +++ b/libusb_dll.vcproj @@ -64,7 +64,6 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="setupapi.lib ole32.lib advapi32.lib"
OutputFile="$(OutDir)\libusb-1.0.dll"
LinkIncremental="2"
ModuleDefinitionFile="libusb\libusb-1.0.def"
@@ -141,7 +140,6 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="setupapi.lib ole32.lib advapi32.lib"
OutputFile="$(OutDir)\libusb-1.0.dll"
LinkIncremental="1"
ModuleDefinitionFile="libusb\libusb-1.0.def"
@@ -223,7 +221,6 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="setupapi.lib"
OutputFile="$(OutDir)\libusb-1.0.dll"
LinkIncremental="2"
ModuleDefinitionFile="libusb\libusb-1.0.def"
@@ -301,7 +298,6 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="setupapi.lib"
OutputFile="$(OutDir)\libusb-1.0.dll"
LinkIncremental="1"
ModuleDefinitionFile="libusb\libusb-1.0.def"
diff --git a/libusb_dll_2008.vcproj b/libusb_dll_2008.vcproj index 40aa057..3512b98 100644 --- a/libusb_dll_2008.vcproj +++ b/libusb_dll_2008.vcproj @@ -60,7 +60,6 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="setupapi.lib advapi32.lib ole32.lib"
OutputFile="$(OutDir)\libusb-1.0.dll"
ModuleDefinitionFile="libusb\libusb-1.0.def"
EmbedManagedResourceFile="libusb-1.0.rc"
@@ -131,7 +130,6 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="setupapi.lib advapi32.lib ole32.lib"
OutputFile="$(OutDir)\libusb-1.0.dll"
ModuleDefinitionFile="libusb\libusb-1.0.def"
EmbedManagedResourceFile="libusb-1.0.rc"
@@ -200,7 +198,6 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="setupapi.lib advapi32.lib ole32.lib"
OutputFile="$(OutDir)\libusb-1.0.dll"
ModuleDefinitionFile="libusb\libusb-1.0.def"
EmbedManagedResourceFile="libusb-1.0.rc"
@@ -269,7 +266,6 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="setupapi.lib advapi32.lib ole32.lib"
OutputFile="$(OutDir)\libusb-1.0.dll"
ModuleDefinitionFile="libusb\libusb-1.0.def"
EmbedManagedResourceFile="libusb-1.0.rc"
|