summaryrefslogtreecommitdiff
path: root/libusb
diff options
context:
space:
mode:
authorPete Batard <pbatard@gmail.com>2010-03-03 20:36:46 +0000
committerPete Batard <pbatard@gmail.com>2010-03-03 20:36:46 +0000
commit666106e8366806bf2a3a14391561bd33ee8875fa (patch)
treee1584a1736f4d3849fde8a3e6e06e5759e802a79 /libusb
parentbb23fcc74b8bc76b2c0d2d66970c4c074d9cffd9 (diff)
downloadlibusb-666106e8366806bf2a3a14391561bd33ee8875fa.tar.gz
more residual cleanup (Michael Plante)r191
Diffstat (limited to 'libusb')
-rw-r--r--libusb/os/windows_usb.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c
index 1cba34f..7f05576 100644
--- a/libusb/os/windows_usb.c
+++ b/libusb/os/windows_usb.c
@@ -404,11 +404,6 @@ static int windows_init(struct libusb_context *ctx)
struct windows_hcd_priv** _hcd_cur;
TCHAR sem_name[11+1+8]; // strlen(libusb_init)+'\0'+(32-bit hex PID)
- if (Cfgmgr32_init() != LIBUSB_SUCCESS) {
- usbi_err(ctx, "could not resolve Cfgmgr32.dll functions");
- return LIBUSB_ERROR_OTHER;
- }
-
sprintf(sem_name, "libusb_init%08X", (unsigned int)GetCurrentProcessId()&0xFFFFFFFF);
semaphore = CreateSemaphore(NULL, 1, 1, sem_name);
if (semaphore == NULL) {
@@ -449,6 +444,12 @@ 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");
+ return LIBUSB_ERROR_OTHER;
+ }
+
// Initialize the low level APIs
for (i=0; i<USB_API_MAX; i++) {
r = usb_api_backend[i].init(ctx);