Index: trunk/src/VBox/HostDrivers/VBoxUSB/USBFilter.cpp
===================================================================
--- trunk/src/VBox/HostDrivers/VBoxUSB/USBFilter.cpp	(revision 62688)
+++ trunk/src/VBox/HostDrivers/VBoxUSB/USBFilter.cpp	(revision 62690)
@@ -286,4 +286,5 @@
      * sets ([0-9]) and such like.
      */
+    RT_NOREF1(psz);
     return VINF_SUCCESS;
 }
@@ -950,5 +951,5 @@
                     case USBFILTERIDX_BUS:              u16Value = pDevice->bBus; break;
                     case USBFILTERIDX_PORT:             u16Value = pDevice->bPort; break;
-                    default:                            u16Value = ~0; break;
+                    default:                            u16Value = UINT16_MAX; break;
 
                 }
Index: trunk/src/VBox/HostDrivers/VBoxUSB/win/lib/VBoxUsbLib-win.cpp
===================================================================
--- trunk/src/VBox/HostDrivers/VBoxUSB/win/lib/VBoxUsbLib-win.cpp	(revision 62688)
+++ trunk/src/VBox/HostDrivers/VBoxUSB/win/lib/VBoxUsbLib-win.cpp	(revision 62690)
@@ -114,6 +114,6 @@
     if (hOut == INVALID_HANDLE_VALUE)
     {
-        DWORD winEr = GetLastError();
-        AssertMsgFailed(("CreateFile FAILED to open %s, winEr (%d)\n", pVuDev->szName, winEr));
+        DWORD dwErr = GetLastError(); NOREF(dwErr);
+        AssertMsgFailed(("CreateFile FAILED to open %s, dwErr (%d)\n", pVuDev->szName, dwErr));
         return VERR_GENERAL_FAILURE;
     }
@@ -132,5 +132,8 @@
 
         if (   version.u32Major != USBDRV_MAJOR_VERSION
-            || version.u32Minor <  USBDRV_MINOR_VERSION)
+#if USBDRV_MINOR_VERSION != 0
+            || version.u32Minor <  USBDRV_MINOR_VERSION
+#endif
+           )
         {
             AssertMsgFailed(("Invalid version %d:%d vs %d:%d\n", version.u32Major, version.u32Minor, USBDRV_MAJOR_VERSION, USBDRV_MINOR_VERSION));
@@ -184,6 +187,6 @@
                                 &DevInfoData))
         {
-            DWORD winEr = GetLastError();
-            AssertMsgFailed(("SetupDiGetDeviceInterfaceDetail, cbRequired (%d), was (%d), winEr (%d)\n", cbDbgRequired, cbIfDetailData, winEr));
+            DWORD dwErr = GetLastError(); NOREF(dwErr);
+            AssertMsgFailed(("SetupDiGetDeviceInterfaceDetail, cbRequired (%d), was (%d), dwErr (%d)\n", cbDbgRequired, cbIfDetailData, dwErr));
             rc = VERR_GENERAL_FAILURE;
             break;
@@ -198,6 +201,6 @@
             &cbDbgRequired))
         {
-            DWORD winEr = GetLastError();
-            AssertMsgFailed(("SetupDiGetDeviceRegistryPropertyA, cbRequired (%d), was (%d), winEr (%d)\n", cbDbgRequired, sizeof (pVuDev->szDriverRegName), winEr));
+            DWORD dwErr = GetLastError(); NOREF(dwErr);
+            AssertMsgFailed(("SetupDiGetDeviceRegistryPropertyA, cbRequired (%d), was (%d), dwErr (%d)\n", cbDbgRequired, sizeof (pVuDev->szDriverRegName), dwErr));
             rc = VERR_GENERAL_FAILURE;
             break;
@@ -234,6 +237,6 @@
     if (hDevInfo == INVALID_HANDLE_VALUE)
     {
-        DWORD winEr = GetLastError();
-        AssertMsgFailed(("SetupDiGetClassDevs, winEr (%d)\n", winEr));
+        DWORD dwErr = GetLastError(); NOREF(dwErr);
+        AssertMsgFailed(("SetupDiGetClassDevs, dwErr (%d)\n", dwErr));
         return VERR_GENERAL_FAILURE;
     }
@@ -249,9 +252,9 @@
                             &IfData))
         {
-            DWORD winEr = GetLastError();
-            if (winEr == ERROR_NO_MORE_ITEMS)
+            DWORD dwErr = GetLastError();
+            if (dwErr == ERROR_NO_MORE_ITEMS)
                 break;
 
-            AssertMsgFailed(("SetupDiEnumDeviceInterfaces, winEr (%d), resuming\n", winEr));
+            AssertMsgFailed(("SetupDiEnumDeviceInterfaces, dwErr (%d), resuming\n", dwErr));
             continue;
         }
@@ -360,6 +363,6 @@
     {
 #ifdef VBOX_WITH_ANNOYING_USB_ASSERTIONS
-        DWORD winEr = GetLastError();
-        AssertMsgFailed(("DeviceIoControl 1 fail winEr (%d)\n", winEr));
+        DWORD dwErr = GetLastError();
+        AssertMsgFailed(("DeviceIoControl 1 fail dwErr (%d)\n", dwErr));
 #endif
         return VERR_GENERAL_FAILURE;
@@ -390,6 +393,6 @@
     else
     {
-        DWORD winEr = GetLastError();
-        AssertMsgFailed(("DeviceIoControl 2 fail winEr (%d)\n", winEr));
+        DWORD dwErr = GetLastError(); NOREF(dwErr);
+        AssertMsgFailed(("DeviceIoControl 2 fail dwErr (%d)\n", dwErr));
         rc = VERR_GENERAL_FAILURE;
     }
@@ -488,6 +491,6 @@
                                 &cbReturned, NULL))
     {
-        DWORD winEr = GetLastError();
-        LogRelFunc(("DeviceIoControl 1 fail winEr (%d)\n", winEr));
+        DWORD dwErr = GetLastError();
+        LogRelFunc(("DeviceIoControl 1 fail dwErr (%d)\n", dwErr));
 #ifdef VBOX_WITH_ANNOYING_USB_ASSERTIONS
         AssertFailed();
@@ -525,6 +528,6 @@
                                     &cbReturned, NULL))
         {
-            DWORD winEr = GetLastError();
-            LogRelFunc(("DeviceIoControl 2 fail winEr (%d)\n", winEr));
+            DWORD dwErr = GetLastError();
+            LogRelFunc(("DeviceIoControl 2 fail dwErr (%d)\n", dwErr));
 #ifdef VBOX_WITH_ANNOYING_USB_ASSERTIONS
             AssertFailed();
@@ -729,5 +732,5 @@
     char Buf[sizeof (USB_NODE_CONNECTION_INFORMATION_EX) + (sizeof (USB_PIPE_INFO) * 20)];
     PUSB_NODE_CONNECTION_INFORMATION_EX pConInfo = (PUSB_NODE_CONNECTION_INFORMATION_EX)Buf;
-    PUSB_PIPE_INFO paPipeInfo = (PUSB_PIPE_INFO)(Buf + sizeof (PUSB_NODE_CONNECTION_INFORMATION_EX));
+    //PUSB_PIPE_INFO paPipeInfo = (PUSB_PIPE_INFO)(Buf + sizeof (PUSB_NODE_CONNECTION_INFORMATION_EX));
     DWORD cbReturned = 0;
     memset(&Buf, 0, sizeof (Buf));
@@ -738,6 +741,6 @@
                                   &cbReturned, NULL))
     {
-        DWORD winEr = GetLastError();
-        AssertMsg(winEr == ERROR_DEVICE_NOT_CONNECTED, (__FUNCTION__": DeviceIoControl failed winEr (%d)\n", winEr));
+        DWORD dwErr = GetLastError(); NOREF(dwErr);
+        AssertMsg(dwErr == ERROR_DEVICE_NOT_CONNECTED, (__FUNCTION__": DeviceIoControl failed dwErr (%d)\n", dwErr));
         return VERR_GENERAL_FAILURE;
     }
@@ -894,4 +897,5 @@
 }
 
+#if 0 /* unused */
 static PUSBSUP_GET_DEVICES usbLibMonGetDevRqAlloc(uint32_t cDevs, PDWORD pcbRq)
 {
@@ -905,4 +909,5 @@
     return pRq;
 }
+#endif
 
 static int usbLibMonDevicesCmp(PUSBDEVICE pDev, PVBOXUSB_DEV pDevInfo)
@@ -913,6 +918,7 @@
 }
 
-static int usbLibMonDevicesUpdate(PVBOXUSBGLOBALSTATE pGlobal, PUSBDEVICE pDevs, uint32_t cDevs, PVBOXUSB_DEV pDevInfos, uint32_t cDevInfos)
-{
+static int usbLibMonDevicesUpdate(PVBOXUSBGLOBALSTATE pGlobal, PUSBDEVICE pDevs, PVBOXUSB_DEV pDevInfos)
+{
+
     PUSBDEVICE pDevsHead = pDevs;
     for (; pDevInfos; pDevInfos = pDevInfos->pNext)
@@ -941,8 +947,8 @@
             if (!DeviceIoControl(hDev, SUPUSB_IOCTL_GET_DEVICE, &Dev, sizeof (Dev), &Dev, sizeof (Dev), &cbReturned, NULL))
             {
-                 DWORD winEr = GetLastError();
+#ifdef VBOX_WITH_ANNOYING_USB_ASSERTIONS
+                 DWORD dwErr = GetLastError(); NOREF(dwErr);
                  /* ERROR_DEVICE_NOT_CONNECTED -> device was removed just now */
-#ifdef VBOX_WITH_ANNOYING_USB_ASSERTIONS
-                 AssertMsg(winEr == ERROR_DEVICE_NOT_CONNECTED, (__FUNCTION__": DeviceIoControl failed winEr (%d)\n", winEr));
+                 AssertMsg(dwErr == ERROR_DEVICE_NOT_CONNECTED, (__FUNCTION__": DeviceIoControl failed dwErr (%d)\n", dwErr));
 #endif
                  Log(("SUPUSB_IOCTL_GET_DEVICE: DeviceIoControl no longer connected\n"));
@@ -958,7 +964,7 @@
             if (!DeviceIoControl(pGlobal->hMonitor, SUPUSBFLT_IOCTL_GET_DEVICE, &hDevice, sizeof (hDevice), &MonInfo, sizeof (MonInfo), &cbReturned, NULL))
             {
-                 DWORD winEr = GetLastError();
+                 DWORD dwErr = GetLastError(); NOREF(dwErr);
                  /* ERROR_DEVICE_NOT_CONNECTED -> device was removed just now */
-                 AssertMsgFailed(("Monitor DeviceIoControl failed winEr (%d)\n", winEr));
+                 AssertMsgFailed(("Monitor DeviceIoControl failed dwErr (%d)\n", dwErr));
                  Log(("SUPUSBFLT_IOCTL_GET_DEVICE: DeviceIoControl no longer connected\n"));
                  CloseHandle(hDev);
@@ -1021,5 +1027,5 @@
         if (RT_SUCCESS(rc))
         {
-            rc = usbLibMonDevicesUpdate(pGlobal, *ppDevs, *pcDevs, pDevInfos, cDevInfos);
+            rc = usbLibMonDevicesUpdate(pGlobal, *ppDevs, pDevInfos);
             AssertRC(rc);
             usbLibVuFreeDevices(pDevInfos);
@@ -1049,6 +1055,6 @@
         default:
         {
-            DWORD winEr = GetLastError();
-            AssertMsgFailed(("WaitForMultipleObjects failed, winEr (%d)\n", winEr));
+            DWORD dwErr = GetLastError(); NOREF(dwErr);
+            AssertMsgFailed(("WaitForMultipleObjects failed, dwErr (%d)\n", dwErr));
             return VERR_GENERAL_FAILURE;
         }
@@ -1065,9 +1071,9 @@
 static int usbLibInterruptWaitChange(PVBOXUSBGLOBALSTATE pGlobal)
 {
-    BOOL bRc = SetEvent(pGlobal->hInterruptEvent);
-    if (!bRc)
-    {
-        DWORD winEr = GetLastError();
-        AssertMsgFailed(("SetEvent failed, winEr (%d)\n", winEr));
+    BOOL fRc = SetEvent(pGlobal->hInterruptEvent);
+    if (!fRc)
+    {
+        DWORD dwErr = GetLastError(); NOREF(dwErr);
+        AssertMsgFailed(("SetEvent failed, dwErr (%d)\n", dwErr));
         return VERR_GENERAL_FAILURE;
     }
@@ -1117,6 +1123,6 @@
                 &cbReturned, NULL))
     {
-        DWORD winEr = GetLastError();
-        AssertMsgFailed(("DeviceIoControl failed with winEr (%d(\n", winEr));
+        DWORD dwErr = GetLastError(); NOREF(dwErr);
+        AssertMsgFailed(("DeviceIoControl failed with dwErr (%d(\n", dwErr));
         return NULL;
     }
@@ -1162,7 +1168,7 @@
                 &cbReturned, NULL))
     {
-        DWORD winEr = GetLastError();
-        AssertMsgFailed(("DeviceIoControl failed with winEr (%d(\n", winEr));
-        return RTErrConvertFromWin32(winEr);
+        DWORD dwErr = GetLastError();
+        AssertMsgFailed(("DeviceIoControl failed with dwErr (%d(\n", dwErr));
+        return RTErrConvertFromWin32(dwErr);
     }
 
@@ -1175,4 +1181,5 @@
 static VOID CALLBACK usbLibTimerCallback(__in PVOID lpParameter, __in BOOLEAN TimerOrWaitFired)
 {
+    RT_NOREF2(lpParameter, TimerOrWaitFired);
     SetEvent(g_VBoxUsbGlobal.hNotifyEvent);
 }
@@ -1190,6 +1197,6 @@
         if (!DeleteTimerQueueTimer(g_VBoxUsbGlobal.hTimerQueue, g_VBoxUsbGlobal.hTimer, NULL))
         {
-            DWORD winEr = GetLastError();
-            AssertMsg(winEr == ERROR_IO_PENDING, ("DeleteTimerQueueTimer failed, winEr (%d)\n", winEr));
+            DWORD dwErr = GetLastError(); NOREF(dwErr);
+            AssertMsg(dwErr == ERROR_IO_PENDING, ("DeleteTimerQueueTimer failed, dwErr (%d)\n", dwErr));
         }
     }
@@ -1202,6 +1209,6 @@
                                WT_EXECUTEONLYONCE))
     {
-        DWORD winEr = GetLastError();
-        AssertMsgFailed(("CreateTimerQueueTimer failed, winEr (%d)\n", winEr));
+        DWORD dwErr = GetLastError(); NOREF(dwErr);
+        AssertMsgFailed(("CreateTimerQueueTimer failed, dwErr (%d)\n", dwErr));
 
         /* call it directly */
@@ -1243,4 +1250,5 @@
     static LPCSTR   s_szVBoxUsbWndClassName = "VBoxUsbLibClass";
     const HINSTANCE hInstance               = (HINSTANCE)GetModuleHandle(NULL);
+    RT_NOREF1(lpParameter);
 
     Assert(g_VBoxUsbGlobal.hWnd == NULL);
@@ -1361,6 +1369,6 @@
                     if (g_VBoxUsbGlobal.hMonitor == INVALID_HANDLE_VALUE)
                     {
-                        DWORD winEr = GetLastError();
-                        LogRelFunc(("CreateFile failed winEr(%d)\n", winEr));
+                        DWORD dwErr = GetLastError();
+                        LogRelFunc(("CreateFile failed dwErr(%d)\n", dwErr));
                         rc = VERR_FILE_NOT_FOUND;
                     }
@@ -1387,5 +1395,8 @@
                 {
                     if (   Version.u32Major == USBMON_MAJOR_VERSION
-                        && Version.u32Minor >= USBMON_MINOR_VERSION)
+#if USBMON_MINOR_VERSION != 0
+                        && Version.u32Minor >= USBMON_MINOR_VERSION
+#endif
+                        )
                     {
 #ifndef VBOX_USB_USE_DEVICE_NOTIFICATION
@@ -1415,6 +1426,6 @@
                         else
                         {
-                            DWORD winEr = GetLastError();
-                            AssertMsgFailed(("SetEvent Ioctl failed, winEr (%d)\n", winEr));
+                            DWORD dwErr = GetLastError();
+                            AssertMsgFailed(("SetEvent Ioctl failed, dwErr (%d)\n", dwErr));
                             rc = VERR_VERSION_MISMATCH;
                         }
@@ -1460,12 +1471,13 @@
                                 dwResult = WaitForSingleObject(g_VBoxUsbGlobal.hThread, INFINITE);
                                 Assert(dwResult == WAIT_OBJECT_0);
-                                BOOL bRc = CloseHandle(g_VBoxUsbGlobal.hThread);
-                                AssertMsg(bRc, ("CloseHandle for hThread failed winEr(%d)\n", GetLastError()));
+                                BOOL fRc = CloseHandle(g_VBoxUsbGlobal.hThread); NOREF(fRc);
+                                DWORD dwErr = GetLastError(); NOREF(dwErr);
+                                AssertMsg(fRc, ("CloseHandle for hThread failed dwErr(%d)\n", dwErr));
                                 g_VBoxUsbGlobal.hThread = INVALID_HANDLE_VALUE;
                             }
                             else
                             {
-                                DWORD winEr = GetLastError();
-                                AssertMsgFailed(("CreateThread failed, winEr (%d)\n", winEr));
+                                DWORD dwErr = GetLastError(); NOREF(dwErr);
+                                AssertMsgFailed(("CreateThread failed, dwErr (%d)\n", dwErr));
                                 rc = VERR_GENERAL_FAILURE;
                             }
@@ -1476,6 +1488,6 @@
                         else
                         {
-                            DWORD winEr = GetLastError();
-                            AssertMsgFailed(("CreateTimerQueue failed winEr(%d)\n", winEr));
+                            DWORD dwErr = GetLastError(); NOREF(dwErr);
+                            AssertMsgFailed(("CreateTimerQueue failed dwErr(%d)\n", dwErr));
                         }
 #endif
@@ -1493,6 +1505,6 @@
                 else
                 {
-                    DWORD winEr = GetLastError();
-                    AssertMsgFailed(("DeviceIoControl failed winEr(%d)\n", winEr));
+                    DWORD dwErr = GetLastError(); NOREF(dwErr);
+                    AssertMsgFailed(("DeviceIoControl failed dwErr(%d)\n", dwErr));
                     rc = VERR_VERSION_MISMATCH;
                 }
@@ -1515,6 +1527,6 @@
         else
         {
-            DWORD winEr = GetLastError();
-            AssertMsgFailed(("CreateEvent for InterruptEvent failed winEr(%d)\n", winEr));
+            DWORD dwErr = GetLastError(); NOREF(dwErr);
+            AssertMsgFailed(("CreateEvent for InterruptEvent failed dwErr(%d)\n", dwErr));
             rc = VERR_GENERAL_FAILURE;
         }
@@ -1525,6 +1537,6 @@
     else
     {
-        DWORD winEr = GetLastError();
-        AssertMsgFailed(("CreateEvent for NotifyEvent failed winEr(%d)\n", winEr));
+        DWORD dwErr = GetLastError(); NOREF(dwErr);
+        AssertMsgFailed(("CreateEvent for NotifyEvent failed dwErr(%d)\n", dwErr));
         rc = VERR_GENERAL_FAILURE;
     }
@@ -1552,42 +1564,42 @@
     }
 
-    BOOL bRc;
+    BOOL fRc;
 #ifdef VBOX_USB_USE_DEVICE_NOTIFICATION
-    bRc = PostMessage(g_VBoxUsbGlobal.hWnd, WM_CLOSE, 0, 0);
-    AssertMsg(bRc, ("PostMessage for hWnd failed winEr(%d)\n", GetLastError()));
+    fRc = PostMessage(g_VBoxUsbGlobal.hWnd, WM_CLOSE, 0, 0);
+    AssertMsg(fRc, ("PostMessage for hWnd failed dwErr(%d)\n", GetLastError()));
 
     if (g_VBoxUsbGlobal.hThread != NULL)
     {
         DWORD dwResult = WaitForSingleObject(g_VBoxUsbGlobal.hThread, INFINITE);
-        Assert(dwResult == WAIT_OBJECT_0);
-        bRc = CloseHandle(g_VBoxUsbGlobal.hThread);
-        AssertMsg(bRc, ("CloseHandle for hThread failed winEr(%d)\n", GetLastError()));
+        Assert(dwResult == WAIT_OBJECT_0); NOREF(dwResult);
+        fRc = CloseHandle(g_VBoxUsbGlobal.hThread);
+        AssertMsg(fRc, ("CloseHandle for hThread failed dwErr(%d)\n", GetLastError()));
     }
 
     if (g_VBoxUsbGlobal.hTimer)
     {
-        bRc = DeleteTimerQueueTimer(g_VBoxUsbGlobal.hTimerQueue, g_VBoxUsbGlobal.hTimer,
+        fRc = DeleteTimerQueueTimer(g_VBoxUsbGlobal.hTimerQueue, g_VBoxUsbGlobal.hTimer,
                                     INVALID_HANDLE_VALUE); /* <-- to block until the timer is completed */
-        AssertMsg(bRc, ("DeleteTimerQueueTimer failed winEr(%d)\n", GetLastError()));
+        AssertMsg(fRc, ("DeleteTimerQueueTimer failed dwErr(%d)\n", GetLastError()));
     }
 
     if (g_VBoxUsbGlobal.hTimerQueue)
     {
-        bRc = DeleteTimerQueueEx(g_VBoxUsbGlobal.hTimerQueue,
+        fRc = DeleteTimerQueueEx(g_VBoxUsbGlobal.hTimerQueue,
                                  INVALID_HANDLE_VALUE); /* <-- to block until all timers are completed */
-        AssertMsg(bRc, ("DeleteTimerQueueEx failed winEr(%d)\n", GetLastError()));
+        AssertMsg(fRc, ("DeleteTimerQueueEx failed dwErr(%d)\n", GetLastError()));
     }
 #endif /* VBOX_USB_USE_DEVICE_NOTIFICATION */
 
-    bRc = CloseHandle(g_VBoxUsbGlobal.hMonitor);
-    AssertMsg(bRc, ("CloseHandle for hMonitor failed winEr(%d)\n", GetLastError()));
+    fRc = CloseHandle(g_VBoxUsbGlobal.hMonitor);
+    AssertMsg(fRc, ("CloseHandle for hMonitor failed dwErr(%d)\n", GetLastError()));
     g_VBoxUsbGlobal.hMonitor = INVALID_HANDLE_VALUE;
 
-    bRc = CloseHandle(g_VBoxUsbGlobal.hInterruptEvent);
-    AssertMsg(bRc, ("CloseHandle for hInterruptEvent failed lasterr=%u\n", GetLastError()));
+    fRc = CloseHandle(g_VBoxUsbGlobal.hInterruptEvent);
+    AssertMsg(fRc, ("CloseHandle for hInterruptEvent failed lasterr=%u\n", GetLastError()));
     g_VBoxUsbGlobal.hInterruptEvent = NULL;
 
-    bRc = CloseHandle(g_VBoxUsbGlobal.hNotifyEvent);
-    AssertMsg(bRc, ("CloseHandle for hNotifyEvent failed winEr(%d)\n", GetLastError()));
+    fRc = CloseHandle(g_VBoxUsbGlobal.hNotifyEvent);
+    AssertMsg(fRc, ("CloseHandle for hNotifyEvent failed dwErr(%d)\n", GetLastError()));
     g_VBoxUsbGlobal.hNotifyEvent = NULL;
 
