Changeset 37233 in vbox for trunk/src/VBox/Devices/USB
- Timestamp:
- May 27, 2011 1:31:57 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 71955
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/USB/win/USBProxyDevice-win.cpp
r37158 r37233 39 39 #include "../USBProxyDevice.h" 40 40 #include <VBox/usblib.h> 41 //#include "USBLibInternal.h"42 41 43 42 … … 312 311 } 313 312 else 314 { 315 /* do not use GetLastError() in AssertMsgFailed directly since the "real" err will be overwritten with the 316 * RTAssertMsg1Weak((const char *)0, __LINE__, __FILE__, __PRETTY_FUNCTION__); call encapsulated by AssertMsgFailed */ 317 DWORD winEr = GetLastError(); 318 AssertMsgFailed(("lasterr=%d\n", winEr)); 319 } 313 AssertMsgFailed(("lasterr=%u\n", GetLastError())); 320 314 321 315 return 0; … … 374 368 } 375 369 else 376 { 377 /* do not use GetLastError() in AssertMsgFailed directly since the "real" err will be overwritten with the 378 * RTAssertMsg1Weak((const char *)0, __LINE__, __FILE__, __PRETTY_FUNCTION__); call encapsulated by AssertMsgFailed */ 379 DWORD winEr = GetLastError(); 380 AssertMsgFailed(("lasterr=%d\n", winEr)); 381 } 370 AssertMsgFailed(("lasterr=%d\n", GetLastError())); 382 371 return 0; 383 372 } … … 408 397 } 409 398 else 410 { 411 /* do not use GetLastError() in AssertMsgFailed directly since the "real" err will be overwritten with the 412 * RTAssertMsg1Weak((const char *)0, __LINE__, __FILE__, __PRETTY_FUNCTION__); call encapsulated by AssertMsgFailed */ 413 DWORD winEr = GetLastError(); 414 AssertMsgFailed(("lasterr=%d\n", winEr)); 415 } 399 AssertMsgFailed(("lasterr=%d\n", GetLastError())); 416 400 return 0; 417 401 } … … 444 428 } 445 429 else 446 { 447 /* do not use GetLastError() in AssertMsgFailed directly since the "real" err will be overwritten with the 448 * RTAssertMsg1Weak((const char *)0, __LINE__, __FILE__, __PRETTY_FUNCTION__); call encapsulated by AssertMsgFailed */ 449 DWORD winEr = GetLastError(); 450 AssertMsgFailed(("lasterr=%d\n", winEr)); 451 } 430 AssertMsgFailed(("lasterr=%d\n", rc)); 452 431 return RTErrConvertFromWin32(rc); 453 432 } … … 635 614 /* 636 615 * Wait/poll. 616 * 617 * ASSUMPTIONS: 618 * 1. The usbProxyWinUrbReap can not be run concurrently with each other 619 * so racing the cQueuedUrbs access/modification can not occur. 620 * 2. The usbProxyWinUrbReap can not be run concurrently with 621 * usbProxyWinUrbQueue so they can not race the pPriv->paHandles 622 * access/realloc. 637 623 */ 624 unsigned cQueuedUrbs = ASMAtomicReadU32((volatile uint32_t *)&pPriv->cQueuedUrbs); 638 625 PVUSBURB pUrb = NULL; 639 unsigned cQueuedUrbs = ASMAtomicReadU32((volatile uint32_t *)&pPriv->cQueuedUrbs);640 641 /* we assume here642 * 1. the usbProxyWinUrbReap can not be run concurrently with each other so racing the cQueuedUrbs access/modification can not occur643 * 2. the usbProxyWinUrbReap can not be run concurrently with usbProxyWinUrbQueue so they can not race the pPriv->paHandles access/realloc */644 626 DWORD rc = WaitForMultipleObjects(cQueuedUrbs, pPriv->paHandles, FALSE, cMillies); 645 627 if (rc >= WAIT_OBJECT_0 && rc < WAIT_OBJECT_0 + cQueuedUrbs) … … 697 679 else if ( rc == WAIT_FAILED 698 680 || (rc >= WAIT_ABANDONED_0 && rc < WAIT_ABANDONED_0 + cQueuedUrbs)) 699 { 700 /* do not use GetLastError() in AssertMsgFailed directly since the "real" err will be overwritten with the 701 * RTAssertMsg1Weak((const char *)0, __LINE__, __FILE__, __PRETTY_FUNCTION__); call encapsulated by AssertMsgFailed */ 702 DWORD winEr = GetLastError(); 703 AssertMsgFailed(("USB: WaitForMultipleObjects %d objects failed with rc=%d and last error %d\n", cQueuedUrbs, rc, winEr)); 704 } 681 AssertMsgFailed(("USB: WaitForMultipleObjects %d objects failed with rc=%d and last error %d\n", cQueuedUrbs, rc, GetLastError())); 705 682 706 683 return pUrb; … … 823 800 } 824 801 else 825 { 826 /* do not use GetLastError() in AssertMsgFailed directly since the "real" err will be overwritten with the 827 * RTAssertMsg1Weak((const char *)0, __LINE__, __FILE__, __PRETTY_FUNCTION__); call encapsulated by AssertMsgFailed */ 828 DWORD winEr = GetLastError(); 829 AssertMsgFailed(("lasterr=%d\n", winEr)); 830 } 802 AssertMsgFailed(("lasterr=%d\n", rc)); 831 803 } 832 804
Note:
See TracChangeset
for help on using the changeset viewer.