Lines Matching defs:g_VBoxUsbGlobal
102 static VBOXUSBGLOBALSTATE g_VBoxUsbGlobal;
1071 return usbLibStateWaitChange(&g_VBoxUsbGlobal, msWaitTimeout);
1088 return usbLibInterruptWaitChange(&g_VBoxUsbGlobal);
1101 Assert(g_VBoxUsbGlobal.hMonitor != INVALID_HANDLE_VALUE);
1102 return usbLibGetDevices(&g_VBoxUsbGlobal, ppDevices, pcbNumDevices);
1110 if (g_VBoxUsbGlobal.hMonitor == INVALID_HANDLE_VALUE)
1123 if (!DeviceIoControl(g_VBoxUsbGlobal.hMonitor, SUPUSBFLT_IOCTL_ADD_FILTER,
1147 if (g_VBoxUsbGlobal.hMonitor == INVALID_HANDLE_VALUE)
1158 if (!DeviceIoControl(g_VBoxUsbGlobal.hMonitor, SUPUSBFLT_IOCTL_REMOVE_FILTER, &uId, sizeof(uId), NULL, 0,&cbReturned, NULL))
1166 Assert(g_VBoxUsbGlobal.hMonitor != INVALID_HANDLE_VALUE);
1168 if (!DeviceIoControl(g_VBoxUsbGlobal.hMonitor, SUPUSBFLT_IOCTL_RUN_FILTERS,
1186 SetEvent(g_VBoxUsbGlobal.hNotifyEvent);
1197 if (g_VBoxUsbGlobal.hTimer)
1199 if (!DeleteTimerQueueTimer(g_VBoxUsbGlobal.hTimerQueue, g_VBoxUsbGlobal.hTimer, NULL))
1206 if (!CreateTimerQueueTimer(&g_VBoxUsbGlobal.hTimer, g_VBoxUsbGlobal.hTimerQueue,
1252 Assert(g_VBoxUsbGlobal.hWnd == NULL);
1253 g_VBoxUsbGlobal.hWnd = NULL;
1271 g_VBoxUsbGlobal.hWnd = CreateWindowEx(WS_EX_TOOLWINDOW | WS_EX_TRANSPARENT | WS_EX_TOPMOST,
1282 SetEvent(g_VBoxUsbGlobal.hNotifyEvent);
1284 if (g_VBoxUsbGlobal.hWnd)
1287 SetWindowPos(g_VBoxUsbGlobal.hWnd, HWND_TOPMOST, -200, -200, 0, 0,
1303 DestroyWindow(g_VBoxUsbGlobal.hWnd);
1325 RT_ZERO(g_VBoxUsbGlobal);
1326 g_VBoxUsbGlobal.hMonitor = INVALID_HANDLE_VALUE;
1331 g_VBoxUsbGlobal.hNotifyEvent = CreateEvent(NULL, /* LPSECURITY_ATTRIBUTES lpEventAttributes */
1339 if (g_VBoxUsbGlobal.hNotifyEvent)
1341 g_VBoxUsbGlobal.hInterruptEvent = CreateEvent(NULL, /* LPSECURITY_ATTRIBUTES lpEventAttributes */
1345 if (g_VBoxUsbGlobal.hInterruptEvent)
1350 g_VBoxUsbGlobal.hMonitor = CreateFile(USBMON_DEVICE_NAME,
1358 if (g_VBoxUsbGlobal.hMonitor == INVALID_HANDLE_VALUE)
1363 g_VBoxUsbGlobal.hMonitor = CreateFile(USBMON_DEVICE_NAME,
1370 if (g_VBoxUsbGlobal.hMonitor == INVALID_HANDLE_VALUE)
1379 if (g_VBoxUsbGlobal.hMonitor != INVALID_HANDLE_VALUE)
1392 if (DeviceIoControl(g_VBoxUsbGlobal.hMonitor, SUPUSBFLT_IOCTL_GET_VERSION,
1406 Assert(g_VBoxUsbGlobal.hNotifyEvent);
1407 SetEvent.u.hEvent = g_VBoxUsbGlobal.hNotifyEvent;
1408 if (DeviceIoControl(g_VBoxUsbGlobal.hMonitor, SUPUSBFLT_IOCTL_SET_NOTIFY_EVENT,
1442 g_VBoxUsbGlobal.hTimerQueue = CreateTimerQueue();
1443 if (g_VBoxUsbGlobal.hTimerQueue)
1445 g_VBoxUsbGlobal.hThread = CreateThread(
1453 if (g_VBoxUsbGlobal.hThread)
1455 DWORD dwResult = WaitForSingleObject(g_VBoxUsbGlobal.hNotifyEvent, INFINITE);
1457 if (g_VBoxUsbGlobal.hWnd)
1465 SetEvent(g_VBoxUsbGlobal.hNotifyEvent);
1469 dwResult = WaitForSingleObject(g_VBoxUsbGlobal.hThread, INFINITE);
1471 BOOL bRc = CloseHandle(g_VBoxUsbGlobal.hThread);
1473 g_VBoxUsbGlobal.hThread = INVALID_HANDLE_VALUE;
1482 DeleteTimerQueueEx(g_VBoxUsbGlobal.hTimerQueue, INVALID_HANDLE_VALUE /* see term */);
1483 g_VBoxUsbGlobal.hTimerQueue = NULL;
1509 CloseHandle(g_VBoxUsbGlobal.hMonitor);
1510 g_VBoxUsbGlobal.hMonitor = INVALID_HANDLE_VALUE;
1521 CloseHandle(g_VBoxUsbGlobal.hInterruptEvent);
1522 g_VBoxUsbGlobal.hInterruptEvent = NULL;
1531 CloseHandle(g_VBoxUsbGlobal.hNotifyEvent);
1532 g_VBoxUsbGlobal.hNotifyEvent = NULL;
1556 if (g_VBoxUsbGlobal.hMonitor == INVALID_HANDLE_VALUE)
1558 Assert(g_VBoxUsbGlobal.hInterruptEvent == NULL);
1559 Assert(g_VBoxUsbGlobal.hNotifyEvent == NULL);
1565 bRc = PostMessage(g_VBoxUsbGlobal.hWnd, WM_QUIT, 0, 0);
1568 if (g_VBoxUsbGlobal.hThread != NULL)
1570 DWORD dwResult = WaitForSingleObject(g_VBoxUsbGlobal.hThread, INFINITE);
1572 bRc = CloseHandle(g_VBoxUsbGlobal.hThread);
1576 if (g_VBoxUsbGlobal.hTimer)
1578 bRc = DeleteTimerQueueTimer(g_VBoxUsbGlobal.hTimerQueue, g_VBoxUsbGlobal.hTimer,
1583 if (g_VBoxUsbGlobal.hTimerQueue)
1585 bRc = DeleteTimerQueueEx(g_VBoxUsbGlobal.hTimerQueue,
1591 bRc = CloseHandle(g_VBoxUsbGlobal.hMonitor);
1593 g_VBoxUsbGlobal.hMonitor = INVALID_HANDLE_VALUE;
1595 bRc = CloseHandle(g_VBoxUsbGlobal.hInterruptEvent);
1597 g_VBoxUsbGlobal.hInterruptEvent = NULL;
1599 bRc = CloseHandle(g_VBoxUsbGlobal.hNotifyEvent);
1601 g_VBoxUsbGlobal.hNotifyEvent = NULL;