Changeset 38713 in vbox for trunk/src/VBox/HostDrivers/VBoxUSB/win/lib/VBoxUsbLib-win.cpp
- Timestamp:
- Sep 12, 2011 11:21:20 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxUSB/win/lib/VBoxUsbLib-win.cpp
r38280 r38713 97 97 { 98 98 DWORD winEr = GetLastError(); 99 AssertMsgFailed(( __FUNCTION__":CreateFile FAILED to open %s, winEr (%d)\n", pVuDev->szName, winEr));99 AssertMsgFailed(("CreateFile FAILED to open %s, winEr (%d)\n", pVuDev->szName, winEr)); 100 100 return VERR_GENERAL_FAILURE; 101 101 } … … 109 109 if (!DeviceIoControl(hOut, SUPUSB_IOCTL_GET_VERSION, NULL, 0,&version, sizeof(version), &cbReturned, NULL)) 110 110 { 111 AssertMsgFailed(( __FUNCTION__":DeviceIoControl SUPUSB_IOCTL_GET_VERSION failed with LastError=%Rwa\n", GetLastError()));111 AssertMsgFailed(("DeviceIoControl SUPUSB_IOCTL_GET_VERSION failed with LastError=%Rwa\n", GetLastError())); 112 112 break; 113 113 } … … 116 116 || version.u32Minor < USBDRV_MINOR_VERSION) 117 117 { 118 AssertMsgFailed(( __FUNCTION__":Invalid version %d:%d vs %d:%d\n", version.u32Major, version.u32Minor, USBDRV_MAJOR_VERSION, USBDRV_MINOR_VERSION));118 AssertMsgFailed(("Invalid version %d:%d vs %d:%d\n", version.u32Major, version.u32Minor, USBDRV_MAJOR_VERSION, USBDRV_MINOR_VERSION)); 119 119 break; 120 120 } … … 122 122 if (!DeviceIoControl(hOut, SUPUSB_IOCTL_IS_OPERATIONAL, NULL, 0, NULL, NULL, &cbReturned, NULL)) 123 123 { 124 AssertMsgFailed(( __FUNCTION__":DeviceIoControl SUPUSB_IOCTL_IS_OPERATIONAL failed with LastError=%Rwa\n", GetLastError()));124 AssertMsgFailed(("DeviceIoControl SUPUSB_IOCTL_IS_OPERATIONAL failed with LastError=%Rwa\n", GetLastError())); 125 125 break; 126 126 } … … 149 149 if (!pIfDetailData) 150 150 { 151 AssertMsgFailed(( __FUNCTION__":RTMemAllocZ failed\n"));151 AssertMsgFailed(("RTMemAllocZ failed\n")); 152 152 return VERR_OUT_OF_RESOURCES; 153 153 } … … 167 167 { 168 168 DWORD winEr = GetLastError(); 169 AssertMsgFailed(( __FUNCTION__":SetupDiGetDeviceInterfaceDetail, cbRequired (%d), was (%d), winEr (%d)\n", cbDbgRequired, cbIfDetailData, winEr));169 AssertMsgFailed(("SetupDiGetDeviceInterfaceDetail, cbRequired (%d), was (%d), winEr (%d)\n", cbDbgRequired, cbIfDetailData, winEr)); 170 170 rc = VERR_GENERAL_FAILURE; 171 171 break; … … 181 181 { 182 182 DWORD winEr = GetLastError(); 183 AssertMsgFailed(( __FUNCTION__":SetupDiGetDeviceRegistryPropertyA, cbRequired (%d), was (%d), winEr (%d)\n", cbDbgRequired, sizeof (pVuDev->szDriverRegName), winEr));183 AssertMsgFailed(("SetupDiGetDeviceRegistryPropertyA, cbRequired (%d), was (%d), winEr (%d)\n", cbDbgRequired, sizeof (pVuDev->szDriverRegName), winEr)); 184 184 rc = VERR_GENERAL_FAILURE; 185 185 break; … … 217 217 { 218 218 DWORD winEr = GetLastError(); 219 AssertMsgFailed(( __FUNCTION__":SetupDiGetClassDevs, winEr (%d)\n", winEr));219 AssertMsgFailed(("SetupDiGetClassDevs, winEr (%d)\n", winEr)); 220 220 return VERR_GENERAL_FAILURE; 221 221 } … … 235 235 break; 236 236 237 AssertMsgFailed(( __FUNCTION__":SetupDiEnumDeviceInterfaces, winEr (%d), resuming\n", winEr));237 AssertMsgFailed(("SetupDiEnumDeviceInterfaces, winEr (%d), resuming\n", winEr)); 238 238 continue; 239 239 } … … 243 243 if (!pVuDev) 244 244 { 245 AssertMsgFailed(( __FUNCTION__":RTMemAllocZ failed, resuming\n"));245 AssertMsgFailed(("RTMemAllocZ failed, resuming\n")); 246 246 continue; 247 247 } … … 250 250 if (!RT_SUCCESS(rc)) 251 251 { 252 AssertMsgFailed(( __FUNCTION__":usbLibVuDevicePopulate failed, rc (%d), resuming\n", rc));252 AssertMsgFailed(("usbLibVuDevicePopulate failed, rc (%d), resuming\n", rc)); 253 253 continue; 254 254 } … … 356 356 #ifdef VBOX_WITH_ANNOYING_USB_ASSERTIONS 357 357 DWORD winEr = GetLastError(); 358 AssertMsgFailed(( __FUNCTION__":DeviceIoControl 1 fail winEr (%d)\n", winEr));358 AssertMsgFailed(("DeviceIoControl 1 fail winEr (%d)\n", winEr)); 359 359 #endif 360 360 return VERR_GENERAL_FAILURE; … … 386 386 { 387 387 DWORD winEr = GetLastError(); 388 AssertMsgFailed(( __FUNCTION__":DeviceIoControl 2 fail winEr (%d)\n", winEr));388 AssertMsgFailed(("DeviceIoControl 2 fail winEr (%d)\n", winEr)); 389 389 rc = VERR_GENERAL_FAILURE; 390 390 } … … 954 954 DWORD winEr = GetLastError(); 955 955 /* ERROR_DEVICE_NOT_CONNECTED -> device was removed just now */ 956 AssertMsgFailed(( __FUNCTION__":Monitor DeviceIoControl failed winEr (%d)\n", winEr));956 AssertMsgFailed(("Monitor DeviceIoControl failed winEr (%d)\n", winEr)); 957 957 Log(("SUPUSBFLT_IOCTL_GET_DEVICE: DeviceIoControl no longer connected\n")); 958 958 CloseHandle(hDev); … … 1039 1039 { 1040 1040 DWORD winEr = GetLastError(); 1041 AssertMsgFailed(( __FUNCTION__":WaitForMultipleObjects failed, winEr (%d)\n", winEr));1041 AssertMsgFailed(("WaitForMultipleObjects failed, winEr (%d)\n", winEr)); 1042 1042 return VERR_GENERAL_FAILURE; 1043 1043 } … … 1058 1058 { 1059 1059 DWORD winEr = GetLastError(); 1060 AssertMsgFailed(( __FUNCTION__":SetEvent failed, winEr (%d)\n", winEr));1060 AssertMsgFailed(("SetEvent failed, winEr (%d)\n", winEr)); 1061 1061 return VERR_GENERAL_FAILURE; 1062 1062 } … … 1195 1195 { 1196 1196 DWORD winEr = GetLastError(); 1197 AssertMsgFailed(( __FUNCTION__":CreateTimerQueueTimer failed, winEr (%d)\n", winEr));1197 AssertMsgFailed(("CreateTimerQueueTimer failed, winEr (%d)\n", winEr)); 1198 1198 1199 1199 /* call it directly */ … … 1366 1366 return VINF_SUCCESS; 1367 1367 else 1368 AssertMsgFailed(( __FUNCTION__":SetEvent failed, rc (%d)\n", rc));1368 AssertMsgFailed(("SetEvent failed, rc (%d)\n", rc)); 1369 1369 } 1370 1370 else 1371 1371 { 1372 1372 DWORD winEr = GetLastError(); 1373 AssertMsgFailed(( __FUNCTION__":SetEvent Ioctl failed, winEr (%d)\n", winEr));1373 AssertMsgFailed(("SetEvent Ioctl failed, winEr (%d)\n", winEr)); 1374 1374 rc = VERR_VERSION_MISMATCH; 1375 1375 } … … 1404 1404 { 1405 1405 DWORD winEr = GetLastError(); 1406 AssertMsgFailed(( __FUNCTION__":CloseHandle for hThread failed winEr(%d)\n", winEr));1406 AssertMsgFailed(("CloseHandle for hThread failed winEr(%d)\n", winEr)); 1407 1407 } 1408 1408 } … … 1410 1410 { 1411 1411 DWORD winEr = GetLastError(); 1412 AssertMsgFailed(( __FUNCTION__":CreateThread failed, winEr (%d)\n", winEr));1412 AssertMsgFailed(("CreateThread failed, winEr (%d)\n", winEr)); 1413 1413 rc = VERR_GENERAL_FAILURE; 1414 1414 } … … 1417 1417 { 1418 1418 DWORD winEr = GetLastError(); 1419 AssertMsgFailed(( __FUNCTION__":CreateTimerQueue failed winEr(%d)\n", winEr));1419 AssertMsgFailed(("CreateTimerQueue failed winEr(%d)\n", winEr)); 1420 1420 } 1421 1421 #endif … … 1433 1433 { 1434 1434 DWORD winEr = GetLastError(); 1435 AssertMsgFailed(( __FUNCTION__":DeviceIoControl failed winEr(%d)\n", winEr));1435 AssertMsgFailed(("DeviceIoControl failed winEr(%d)\n", winEr)); 1436 1436 rc = VERR_VERSION_MISMATCH; 1437 1437 } … … 1453 1453 { 1454 1454 DWORD winEr = GetLastError(); 1455 AssertMsgFailed(( __FUNCTION__":CreateEvent for InterruptEvent failed winEr(%d)\n", winEr));1455 AssertMsgFailed(("CreateEvent for InterruptEvent failed winEr(%d)\n", winEr)); 1456 1456 rc = VERR_GENERAL_FAILURE; 1457 1457 } … … 1462 1462 { 1463 1463 DWORD winEr = GetLastError(); 1464 AssertMsgFailed(( __FUNCTION__":CreateEvent for NotifyEvent failed winEr(%d)\n", winEr));1464 AssertMsgFailed(("CreateEvent for NotifyEvent failed winEr(%d)\n", winEr)); 1465 1465 rc = VERR_GENERAL_FAILURE; 1466 1466 } … … 1495 1495 { 1496 1496 DWORD winEr = GetLastError(); 1497 AssertMsgFailed((__FUNCTION__": PostMessage for hWnd failed winEr(%d)\n", winEr)); 1498 } 1499 1500 DWORD dwResult = WaitForSingleObject(g_VBoxUsbGlobal.hThread, INFINITE); 1501 Assert(dwResult == WAIT_OBJECT_0); 1502 bRc = CloseHandle(g_VBoxUsbGlobal.hThread); 1503 if (!bRc) 1504 { 1505 DWORD winEr = GetLastError(); 1506 AssertMsgFailed((__FUNCTION__": CloseHandle for hThread failed winEr(%d)\n", winEr)); 1497 AssertMsgFailed(("PostMessage for hWnd failed winEr(%d)\n", winEr)); 1498 } 1499 1500 if (g_VBoxUsbGlobal.hThread != NULL) 1501 { 1502 DWORD dwResult = WaitForSingleObject(g_VBoxUsbGlobal.hThread, INFINITE); 1503 Assert(dwResult == WAIT_OBJECT_0); 1504 bRc = CloseHandle(g_VBoxUsbGlobal.hThread); 1505 if (!bRc) 1506 { 1507 DWORD winEr = GetLastError(); 1508 AssertMsgFailed(("CloseHandle for hThread failed winEr(%d)\n", winEr)); 1509 } 1507 1510 } 1508 1511 … … 1515 1518 { 1516 1519 DWORD winEr = GetLastError(); 1517 AssertMsgFailed((__FUNCTION__": DeleteTimerQueueEx failed winEr(%d)\n", winEr)); 1518 } 1519 } 1520 1521 bRc = DeleteTimerQueueEx(g_VBoxUsbGlobal.hTimerQueue, 1522 INVALID_HANDLE_VALUE /* <-- to block until all timers are completed */ 1523 ); 1524 if (!bRc) 1525 { 1526 DWORD winEr = GetLastError(); 1527 AssertMsgFailed((__FUNCTION__": DeleteTimerQueueEx failed winEr(%d)\n", winEr)); 1520 AssertMsgFailed(("DeleteTimerQueueEx failed winEr(%d)\n", winEr)); 1521 } 1522 } 1523 1524 if (g_VBoxUsbGlobal.hTimerQueue) 1525 { 1526 bRc = DeleteTimerQueueEx(g_VBoxUsbGlobal.hTimerQueue, 1527 INVALID_HANDLE_VALUE /* <-- to block until all timers are completed */ 1528 ); 1529 if (!bRc) 1530 { 1531 DWORD winEr = GetLastError(); 1532 AssertMsgFailed(("DeleteTimerQueueEx failed winEr(%d)\n", winEr)); 1533 } 1528 1534 } 1529 1535 #endif … … 1533 1539 { 1534 1540 DWORD winEr = GetLastError(); 1535 AssertMsgFailed(( __FUNCTION__":CloseHandle for hMonitor failed winEr(%d)\n", winEr));1541 AssertMsgFailed(("CloseHandle for hMonitor failed winEr(%d)\n", winEr)); 1536 1542 } 1537 1543 … … 1540 1546 { 1541 1547 DWORD winEr = GetLastError(); 1542 AssertMsgFailed(( __FUNCTION__":CloseHandle for hInterruptEvent failed winEr(%d)\n", winEr));1548 AssertMsgFailed(("CloseHandle for hInterruptEvent failed winEr(%d)\n", winEr)); 1543 1549 } 1544 1550 … … 1547 1553 { 1548 1554 DWORD winEr = GetLastError(); 1549 AssertMsgFailed(( __FUNCTION__":CloseHandle for hNotifyEvent failed winEr(%d)\n", winEr));1555 AssertMsgFailed(("CloseHandle for hNotifyEvent failed winEr(%d)\n", winEr)); 1550 1556 } 1551 1557
Note:
See TracChangeset
for help on using the changeset viewer.