Windows: DuplicateHandle failure is not a warning
authorPete Batard <pbatard@gmail.com>
Thu, 29 Jul 2010 23:30:31 +0000 (00:30 +0100)
committerDaniel Drake <dan@reactivated.net>
Sat, 7 Aug 2010 03:45:31 +0000 (21:45 -0600)
This is because WinUSB handles are not duplicable, and generate a
lot of these warnings.

libusb/os/poll_windows.c

index 59c3b07..9ae9895 100644 (file)
@@ -411,7 +411,7 @@ struct winfd usbi_create_fd(HANDLE handle, int access_mode)
                                _poll_fd[i].thread_id = GetCurrentThreadId();
                                if (!DuplicateHandle(GetCurrentProcess(), handle, GetCurrentProcess(),
                                        &wfd.handle, 0, TRUE, DUPLICATE_SAME_ACCESS)) {
-                                       usbi_warn(NULL, "could not duplicate handle for CancelIo - using original one");
+                                       usbi_dbg("could not duplicate handle for CancelIo - using original one");
                                        wfd.handle = handle;
                                        // Make sure we won't close the original handle on fd deletion then
                                        _poll_fd[i].original_handle = INVALID_HANDLE_VALUE;