Index: trunk/src/VBox/Devices/USB/win/USBProxyDevice-win.cpp
===================================================================
--- trunk/src/VBox/Devices/USB/win/USBProxyDevice-win.cpp	(revision 37228)
+++ trunk/src/VBox/Devices/USB/win/USBProxyDevice-win.cpp	(revision 37233)
@@ -39,5 +39,4 @@
 #include "../USBProxyDevice.h"
 #include <VBox/usblib.h>
-//#include "USBLibInternal.h"
 
 
@@ -312,10 +311,5 @@
     }
     else
-    {
-        /* do not use GetLastError() in AssertMsgFailed directly since the "real" err will be overwritten with the
-         * RTAssertMsg1Weak((const char *)0, __LINE__, __FILE__, __PRETTY_FUNCTION__); call encapsulated by AssertMsgFailed */
-        DWORD winEr = GetLastError();
-        AssertMsgFailed(("lasterr=%d\n", winEr));
-    }
+        AssertMsgFailed(("lasterr=%u\n", GetLastError()));
 
     return 0;
@@ -374,10 +368,5 @@
     }
     else
-    {
-        /* do not use GetLastError() in AssertMsgFailed directly since the "real" err will be overwritten with the
-         * RTAssertMsg1Weak((const char *)0, __LINE__, __FILE__, __PRETTY_FUNCTION__); call encapsulated by AssertMsgFailed */
-        DWORD winEr = GetLastError();
-        AssertMsgFailed(("lasterr=%d\n", winEr));
-    }
+        AssertMsgFailed(("lasterr=%d\n", GetLastError()));
     return 0;
 }
@@ -408,10 +397,5 @@
     }
     else
-    {
-        /* do not use GetLastError() in AssertMsgFailed directly since the "real" err will be overwritten with the
-         * RTAssertMsg1Weak((const char *)0, __LINE__, __FILE__, __PRETTY_FUNCTION__); call encapsulated by AssertMsgFailed */
-        DWORD winEr = GetLastError();
-        AssertMsgFailed(("lasterr=%d\n", winEr));
-    }
+        AssertMsgFailed(("lasterr=%d\n", GetLastError()));
     return 0;
 }
@@ -444,10 +428,5 @@
     }
     else
-    {
-        /* do not use GetLastError() in AssertMsgFailed directly since the "real" err will be overwritten with the
-         * RTAssertMsg1Weak((const char *)0, __LINE__, __FILE__, __PRETTY_FUNCTION__); call encapsulated by AssertMsgFailed */
-        DWORD winEr = GetLastError();
-        AssertMsgFailed(("lasterr=%d\n", winEr));
-    }
+        AssertMsgFailed(("lasterr=%d\n", rc));
     return RTErrConvertFromWin32(rc);
 }
@@ -635,11 +614,14 @@
     /*
      * Wait/poll.
+     *
+     * ASSUMPTIONS:
+     *   1. The usbProxyWinUrbReap can not be run concurrently with each other
+     *      so racing the cQueuedUrbs access/modification can not occur.
+     *   2. The usbProxyWinUrbReap can not be run concurrently with
+     *      usbProxyWinUrbQueue so they can not race the pPriv->paHandles
+     *      access/realloc.
      */
+    unsigned cQueuedUrbs = ASMAtomicReadU32((volatile uint32_t *)&pPriv->cQueuedUrbs);
     PVUSBURB pUrb = NULL;
-    unsigned cQueuedUrbs = ASMAtomicReadU32((volatile uint32_t *)&pPriv->cQueuedUrbs);
-
-    /* we assume here
-     * 1. the usbProxyWinUrbReap can not be run concurrently with each other so racing the cQueuedUrbs access/modification can not occur
-     * 2. the usbProxyWinUrbReap can not be run concurrently with usbProxyWinUrbQueue so they can not race the pPriv->paHandles access/realloc */
     DWORD rc = WaitForMultipleObjects(cQueuedUrbs, pPriv->paHandles, FALSE, cMillies);
     if (rc >= WAIT_OBJECT_0 && rc < WAIT_OBJECT_0 + cQueuedUrbs)
@@ -697,10 +679,5 @@
     else if (   rc == WAIT_FAILED
              || (rc >= WAIT_ABANDONED_0 && rc < WAIT_ABANDONED_0 + cQueuedUrbs))
-    {
-        /* do not use GetLastError() in AssertMsgFailed directly since the "real" err will be overwritten with the
-         * RTAssertMsg1Weak((const char *)0, __LINE__, __FILE__, __PRETTY_FUNCTION__); call encapsulated by AssertMsgFailed */
-        DWORD winEr = GetLastError();
-        AssertMsgFailed(("USB: WaitForMultipleObjects %d objects failed with rc=%d and last error %d\n", cQueuedUrbs, rc, winEr));
-    }
+        AssertMsgFailed(("USB: WaitForMultipleObjects %d objects failed with rc=%d and last error %d\n", cQueuedUrbs, rc, GetLastError()));
 
     return pUrb;
@@ -823,10 +800,5 @@
     }
     else
-    {
-        /* do not use GetLastError() in AssertMsgFailed directly since the "real" err will be overwritten with the
-         * RTAssertMsg1Weak((const char *)0, __LINE__, __FILE__, __PRETTY_FUNCTION__); call encapsulated by AssertMsgFailed */
-        DWORD winEr = GetLastError();
-        AssertMsgFailed(("lasterr=%d\n", winEr));
-    }
+        AssertMsgFailed(("lasterr=%d\n", rc));
 }
 
