summaryrefslogtreecommitdiff
path: root/libusb/os/windows_usb.c
diff options
context:
space:
mode:
authorPete Batard <pbatard@gmail.com>2010-04-01 11:15:56 +0100
committerPete Batard <pbatard@gmail.com>2010-04-01 11:15:56 +0100
commitbaa9dc7601ba90a5068897a56f33958176089636 (patch)
tree21b8dc5094df866371e16ea1898be03eef0da293 /libusb/os/windows_usb.c
parentf9e40cc5bafe9ac44525d1c7313dabb7333d13f9 (diff)
downloadlibusb-baa9dc7601ba90a5068897a56f33958176089636.tar.gz
more explicit error codes on semaphore and DLL issuesr233
Diffstat (limited to 'libusb/os/windows_usb.c')
-rw-r--r--libusb/os/windows_usb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c
index 8ab7739..395c891 100644
--- a/libusb/os/windows_usb.c
+++ b/libusb/os/windows_usb.c
@@ -410,7 +410,7 @@ static int windows_init(struct libusb_context *ctx)
semaphore = CreateSemaphore(NULL, 1, 1, sem_name);
if (semaphore == NULL) {
usbi_err(ctx, "could not create semaphore: %s", windows_error_str(0));
- return LIBUSB_ERROR_OTHER;
+ return LIBUSB_ERROR_NO_MEM;
}
// A successful wait brings our semaphore count to 0 (unsignaled)
@@ -418,7 +418,7 @@ static int windows_init(struct libusb_context *ctx)
if (WaitForSingleObject(semaphore, INFINITE) != WAIT_OBJECT_0) {
usbi_err(ctx, "failure to access semaphore: %s", windows_error_str(0));
CloseHandle(semaphore);
- return LIBUSB_ERROR_OTHER;
+ return LIBUSB_ERROR_NO_MEM;
}
// NB: concurrent usage supposes that init calls are equally balanced with
@@ -449,7 +449,7 @@ static int windows_init(struct libusb_context *ctx)
// Load missing CFGMGR32.DLL imports
if (Cfgmgr32_init() != LIBUSB_SUCCESS) {
usbi_err(ctx, "could not resolve Cfgmgr32.dll functions");
- return LIBUSB_ERROR_OTHER;
+ return LIBUSB_ERROR_NOT_FOUND;
}
// Initialize the low level APIs