Index: trunk/src/VBox/HostDrivers/win/cfg/VBoxDrvCfg.cpp
===================================================================
--- trunk/src/VBox/HostDrivers/win/cfg/VBoxDrvCfg.cpp	(revision 40993)
+++ trunk/src/VBox/HostDrivers/win/cfg/VBoxDrvCfg.cpp	(revision 41012)
@@ -203,7 +203,7 @@
     if (!SetupFindFirstLineW(hInf, lpszSection, lpszKey, pCtx))
     {
-        DWORD winEr = GetLastError();
-        NonStandardLogRelCrap((__FUNCTION__ ": SetupFindFirstLine failed WinEr (%d) for Section(%S), Key(%S)\n", winEr, lpszSection, lpszKey));
-        return HRESULT_FROM_WIN32(winEr);
+        DWORD dwErr = GetLastError();
+        NonStandardLogRelCrap((__FUNCTION__ ": SetupFindFirstLine failed WinEr (%d) for Section(%S), Key(%S)\n", dwErr, lpszSection, lpszKey));
+        return HRESULT_FROM_WIN32(dwErr);
     }
     return S_OK;
@@ -212,15 +212,15 @@
 static HRESULT vboxDrvCfgInfQueryKeyValue(PINFCONTEXT pCtx, DWORD iValue, LPWSTR *lppszValue, PDWORD pcValue)
 {
-    DWORD winEr;
+    DWORD dwErr;
     DWORD cValue;
 
     if (!SetupGetStringFieldW(pCtx, iValue, NULL, 0, &cValue))
     {
-        winEr = GetLastError();
-//        NonStandardAssert(winEr == ERROR_INSUFFICIENT_BUFFER);
-        if (winEr != ERROR_INSUFFICIENT_BUFFER)
-        {
-            NonStandardLogFlowCrap((__FUNCTION__ ": SetupGetStringField failed WinEr (%d) for iValue(%d)\n", winEr, iValue));
-            return HRESULT_FROM_WIN32(winEr);
+        dwErr = GetLastError();
+//        NonStandardAssert(dwErr == ERROR_INSUFFICIENT_BUFFER);
+        if (dwErr != ERROR_INSUFFICIENT_BUFFER)
+        {
+            NonStandardLogFlowCrap((__FUNCTION__ ": SetupGetStringField failed WinEr (%d) for iValue(%d)\n", dwErr, iValue));
+            return HRESULT_FROM_WIN32(dwErr);
         }
     }
@@ -230,5 +230,5 @@
     if (!lpszValue)
     {
-        NonStandardLogRelCrap((__FUNCTION__ ": SetCoTaskMemAlloc failed to alloc mem of size (%d), for iValue(%d)\n", cValue * sizeof (lpszValue[0]), winEr, iValue));
+        NonStandardLogRelCrap((__FUNCTION__ ": SetCoTaskMemAlloc failed to alloc mem of size (%d), for iValue(%d)\n", cValue * sizeof (lpszValue[0]), dwErr, iValue));
         return E_FAIL;
     }
@@ -236,9 +236,9 @@
     if (!SetupGetStringFieldW(pCtx, iValue, lpszValue, cValue, &cValue))
     {
-        winEr = GetLastError();
-        NonStandardLogRelCrap((__FUNCTION__ ": SetupGetStringField failed WinEr (%d) for iValue(%d)\n", winEr, iValue));
+        dwErr = GetLastError();
+        NonStandardLogRelCrap((__FUNCTION__ ": SetupGetStringField failed WinEr (%d) for iValue(%d)\n", dwErr, iValue));
         NonStandardAssert(0);
         free(lpszValue);
-        return HRESULT_FROM_WIN32(winEr);
+        return HRESULT_FROM_WIN32(dwErr);
     }
 
@@ -265,5 +265,5 @@
     if (hr != S_OK)
     {
-        NonStandardLogCrap((__FUNCTION__ ": vboxDrvCfgInfQueryContext for Manufacturer failed, hr = (0x%x)\n", hr));
+        NonStandardLogCrap((__FUNCTION__ ": vboxDrvCfgInfQueryContext for Manufacturer failed, hr=0x%x\n", hr));
         return hr;
     }
@@ -272,5 +272,5 @@
     if (hr != S_OK)
     {
-        NonStandardLogRelCrap((__FUNCTION__ ": vboxDrvCfgRegQueryKeyValue 1 for Manufacturer failed, hr = (0x%x)\n", hr));
+        NonStandardLogRelCrap((__FUNCTION__ ": vboxDrvCfgRegQueryKeyValue 1 for Manufacturer failed, hr=0x%x\n", hr));
         return hr;
     }
@@ -354,5 +354,5 @@
     if (hr != S_OK)
     {
-        NonStandardLogCrap((__FUNCTION__ ": vboxDrvCfgRegQueryKeyValue for Manufacturer failed, hr = (0x%x)\n", hr));
+        NonStandardLogCrap((__FUNCTION__ ": vboxDrvCfgRegQueryKeyValue for Manufacturer failed, hr=0x%x\n", hr));
         return hr;
     }
@@ -362,5 +362,5 @@
     if (hr != S_OK)
     {
-        NonStandardLogRelCrap((__FUNCTION__ ": vboxDrvCfgInfQueryContext for models (%S) failed, hr = (0x%x)\n", lpszModels, hr));
+        NonStandardLogRelCrap((__FUNCTION__ ": vboxDrvCfgInfQueryContext for models (%S) failed, hr=0x%x\n", lpszModels, hr));
     }
     else
@@ -369,5 +369,5 @@
         if (hr != S_OK)
         {
-            NonStandardLogRelCrap((__FUNCTION__ ": vboxDrvCfgRegQueryKeyValue for models (%S) failed, hr = (0x%x)\n", lpszModels, hr));
+            NonStandardLogRelCrap((__FUNCTION__ ": vboxDrvCfgRegQueryKeyValue for models (%S) failed, hr=0x%x\n", lpszModels, hr));
         }
     }
@@ -399,9 +399,9 @@
             lpszDstNameComponent))
     {
-        DWORD winEr = GetLastError();
-        HRESULT hr = HRESULT_FROM_WIN32(winEr);
+        DWORD dwErr = GetLastError();
+        HRESULT hr = HRESULT_FROM_WIN32(dwErr);
         if (fCopyStyle != SP_COPY_REPLACEONLY || hr != VBOXDRVCFG_S_INFEXISTS)
         {
-            NonStandardLogRelCrap((__FUNCTION__ ": SetupCopyOEMInf fail winEr (%d)\n", winEr));
+            NonStandardLogRelCrap((__FUNCTION__ ": SetupCopyOEMInf fail dwErr=%ld\n", dwErr));
         }
         return hr;
@@ -430,8 +430,8 @@
         if (!SetupUninstallOEMInfW(DstInfName, fFlags, NULL /*__in PVOID Reserved == NULL */))
         {
-            DWORD winEr = GetLastError();
-            NonStandardLogRelCrap((__FUNCTION__ ": SetupUninstallOEMInf failed for file (%S), oem(%S), winEr (%d)\n", lpszInfPath, DstInfName, winEr));
+            DWORD dwErr = GetLastError();
+            NonStandardLogRelCrap((__FUNCTION__ ": SetupUninstallOEMInf failed for file (%S), oem(%S), dwErr=%ld\n", lpszInfPath, DstInfName, dwErr));
             NonStandardAssert(0);
-            return HRESULT_FROM_WIN32(winEr);
+            return HRESULT_FROM_WIN32(dwErr);
         }
     }
@@ -442,5 +442,5 @@
 static HRESULT vboxDrvCfgCollectInfsSetupDi(const GUID * pGuid, LPCWSTR pPnPId, VBoxDrvCfgStringList & list)
 {
-    DWORD winEr = ERROR_SUCCESS;
+    DWORD dwErr = ERROR_SUCCESS;
     int counter = 0;
     HDEVINFO hDevInfo = SetupDiCreateDeviceInfoList(
@@ -494,6 +494,6 @@
                     else
                     {
-                        DWORD winEr = GetLastError();
-                        NonStandardLogRelCrap((__FUNCTION__": SetupDiGetDriverInfoDetail fail winEr (%d), size(%d)", winEr, dwReq));
+                        DWORD dwErr = GetLastError();
+                        NonStandardLogRelCrap((__FUNCTION__": SetupDiGetDriverInfoDetail fail dwErr=%ld, size(%d)", dwErr, dwReq));
 //                        NonStandardAssert(0);
                     }
@@ -502,6 +502,6 @@
                 else
                 {
-                    DWORD winEr = GetLastError();
-                    if (winEr == ERROR_NO_MORE_ITEMS)
+                    DWORD dwErr = GetLastError();
+                    if (dwErr == ERROR_NO_MORE_ITEMS)
                     {
                         break;
@@ -519,5 +519,5 @@
         else
         {
-            winEr = GetLastError();
+            dwErr = GetLastError();
             NonStandardAssert(0);
         }
@@ -527,9 +527,9 @@
     else
     {
-        winEr = GetLastError();
+        dwErr = GetLastError();
         NonStandardAssert(0);
     }
 
-    return HRESULT_FROM_WIN32(winEr);
+    return HRESULT_FROM_WIN32(dwErr);
 }
 
@@ -603,10 +603,10 @@
             if (!bNext)
             {
-                int winEr = GetLastError();
-                if (winEr != ERROR_NO_MORE_FILES)
+                DWORD dwErr = GetLastError();
+                if (dwErr != ERROR_NO_MORE_FILES)
                 {
-                    NonStandardLogRelCrap((__FUNCTION__": FindNextFile fail winEr (%d)\n", winEr));
+                    NonStandardLogRelCrap((__FUNCTION__": FindNextFile fail dwErr=%ld\n", dwErr));
                     NonStandardAssert(0);
-                    hr = HRESULT_FROM_WIN32(winEr);
+                    hr = HRESULT_FROM_WIN32(dwErr);
                 }
                 break;
@@ -617,10 +617,10 @@
     else
     {
-        int winEr = GetLastError();
-        if (winEr != ERROR_NO_MORE_FILES)
-        {
-            NonStandardLogRelCrap((__FUNCTION__": FindFirstFile fail winEr (%d)\n", winEr));
+        DWORD dwErr = GetLastError();
+        if (dwErr != ERROR_NO_MORE_FILES)
+        {
+            NonStandardLogRelCrap((__FUNCTION__": FindFirstFile fail dwErr=%ld\n", dwErr));
             NonStandardAssert(0);
-            hr = HRESULT_FROM_WIN32(winEr);
+            hr = HRESULT_FROM_WIN32(dwErr);
         }
     }
@@ -632,5 +632,5 @@
 {
     PINFENUM_CONTEXT pContext = (PINFENUM_CONTEXT)pCtxt;
-    DWORD winEr;
+    DWORD dwErr;
 //    NonStandardLogRelCrap(("vboxDrvCfgInfEnumerationCallback: pFileName (%S)\n", pFileName));
 
@@ -638,9 +638,9 @@
     if (hInf == INVALID_HANDLE_VALUE)
     {
-        winEr = GetLastError();
-//        NonStandardAssert(winEr == ERROR_CLASS_MISMATCH);
-        if (winEr != ERROR_CLASS_MISMATCH)
-        {
-            NonStandardLogCrap((__FUNCTION__ ": SetupOpenInfFileW err winEr (%d)\n", winEr));
+        dwErr = GetLastError();
+//        NonStandardAssert(dwErr == ERROR_CLASS_MISMATCH);
+        if (dwErr != ERROR_CLASS_MISMATCH)
+        {
+            NonStandardLogCrap((__FUNCTION__ ": SetupOpenInfFileW err dwErr=%ld\n", dwErr));
         }
 
@@ -659,8 +659,8 @@
                         ))
             {
-                winEr = GetLastError();
-                NonStandardLogRelCrap((__FUNCTION__ ": SetupUninstallOEMInf failed for file (%S), winEr (%d)\n", lpszFileName, winEr));
+                dwErr = GetLastError();
+                NonStandardLogRelCrap((__FUNCTION__ ": SetupUninstallOEMInf failed for file (%S), dwErr=%ld\n", lpszFileName, dwErr));
                 NonStandardAssert(0);
-                hr = HRESULT_FROM_WIN32( winEr );
+                hr = HRESULT_FROM_WIN32( dwErr );
             }
         }
@@ -670,5 +670,5 @@
     else
     {
-        NonStandardLogCrap((__FUNCTION__ ": vboxDrvCfgInfQueryFirstPnPId failed, hr = (0x%x)\n", hr));
+        NonStandardLogCrap((__FUNCTION__ ": vboxDrvCfgInfQueryFirstPnPId failed, hr=0x%x\n", hr));
     }
 
@@ -704,10 +704,10 @@
         else
         {
-            NonStandardLogRelCrap((__FUNCTION__": vboxDrvCfgEnumFiles failed, hr = (0x%x)\n", hr));
+            NonStandardLogRelCrap((__FUNCTION__": vboxDrvCfgEnumFiles failed, hr=0x%x\n", hr));
         }
     }
     else
     {
-        NonStandardLogRelCrap((__FUNCTION__": SHGetFolderPathW failed, hr = (0x%x)\n", hr));
+        NonStandardLogRelCrap((__FUNCTION__": SHGetFolderPathW failed, hr=0x%x\n", hr));
     }
 
@@ -729,7 +729,7 @@
     if (hMgr == NULL)
     {
-        DWORD winEr = GetLastError();
-        NonStandardLogRelCrap((__FUNCTION__": OpenSCManager failed, winEr (%d)\n", winEr));
-        return HRESULT_FROM_WIN32(winEr);
+        DWORD dwErr = GetLastError();
+        NonStandardLogRelCrap((__FUNCTION__": OpenSCManager failed, dwErr=%ld\n", dwErr));
+        return HRESULT_FROM_WIN32(dwErr);
     }
 
@@ -744,7 +744,7 @@
             if (!fRc)
             {
-                DWORD winEr = GetLastError();
-                NonStandardLogRelCrap((__FUNCTION__": QueryServiceStatus failed winEr (%d)\n", winEr));
-                hr = HRESULT_FROM_WIN32(winEr);
+                DWORD dwErr = GetLastError();
+                NonStandardLogRelCrap((__FUNCTION__": QueryServiceStatus failed dwErr=%ld\n", dwErr));
+                hr = HRESULT_FROM_WIN32(dwErr);
                 break;
             }
@@ -757,7 +757,7 @@
                 if (!fRc)
                 {
-                    DWORD winEr = GetLastError();
-                    NonStandardLogRelCrap((__FUNCTION__": StartService failed winEr (%d)\n", winEr));
-                    hr = HRESULT_FROM_WIN32(winEr);
+                    DWORD dwErr = GetLastError();
+                    NonStandardLogRelCrap((__FUNCTION__": StartService failed dwErr=%ld\n", dwErr));
+                    hr = HRESULT_FROM_WIN32(dwErr);
                     break;
                 }
@@ -767,7 +767,7 @@
             if (!fRc)
             {
-                DWORD winEr = GetLastError();
-                NonStandardLogRelCrap((__FUNCTION__": QueryServiceStatus failed winEr (%d)\n", winEr));
-                hr = HRESULT_FROM_WIN32(winEr);
+                DWORD dwErr = GetLastError();
+                NonStandardLogRelCrap((__FUNCTION__": QueryServiceStatus failed dwErr=%ld\n", dwErr));
+                hr = HRESULT_FROM_WIN32(dwErr);
                 break;
             }
@@ -781,7 +781,7 @@
                     if (!fRc)
                     {
-                        DWORD winEr = GetLastError();
-                        NonStandardLogRelCrap((__FUNCTION__": QueryServiceStatus failed winEr (%d)\n", winEr));
-                        hr = HRESULT_FROM_WIN32(winEr);
+                        DWORD dwErr = GetLastError();
+                        NonStandardLogRelCrap((__FUNCTION__": QueryServiceStatus failed dwErr=%ld\n", dwErr));
+                        hr = HRESULT_FROM_WIN32(dwErr);
                         break;
                     }
@@ -804,7 +804,7 @@
     else
     {
-        DWORD winEr = GetLastError();
-        NonStandardLogRelCrap((__FUNCTION__": OpenServiceW failed, winEr (%d)\n", winEr));
-        hr = HRESULT_FROM_WIN32(winEr);
+        DWORD dwErr = GetLastError();
+        NonStandardLogRelCrap((__FUNCTION__": OpenServiceW failed, dwErr=%ld\n", dwErr));
+        hr = HRESULT_FROM_WIN32(dwErr);
     }
 
@@ -828,5 +828,6 @@
     if (!dwChars || dwChars >= MAX_PATH)
     {
-        NonStandardLogCrap(("GetFullPathNameW failed, WinEr(%d), dwChars(%d)\n", GetLastError(), dwChars));
+        NonStandardLogCrap(("GetFullPathNameW failed, dwErr=%ld, dwChars=%ld\n",
+                            GetLastError(), dwChars));
         return E_INVALIDARG;
     }
@@ -839,6 +840,8 @@
             &bRebootRequired))
     {
-        NonStandardLogCrap(("UpdateDriverForPlugAndPlayDevicesW failed, WinEr(%d)\n", GetLastError(), dwChars));
-        return E_FAIL;
+        DWORD dwErr = GetLastError();
+        NonStandardLogCrap(("UpdateDriverForPlugAndPlayDevicesW failed, dwErr=%ld\n",
+                            dwErr));
+        return HRESULT_FROM_WIN32(dwErr);
     }
 
