Index: /trunk/src/VBox/Main/src-all/win/VBoxProxyStub.c
===================================================================
--- /trunk/src/VBox/Main/src-all/win/VBoxProxyStub.c	(revision 59560)
+++ /trunk/src/VBox/Main/src-all/win/VBoxProxyStub.c	(revision 59561)
@@ -86,4 +86,11 @@
                   ((PKUSER_SHARED_DATA)MM_SHARED_USER_DATA_VA)->NtMajorVersion) >= RT_MAKE_U64(1/*Lo*/,6/*Hi*/) \
       ? "VBoxProxyStub.dll" : "VBoxProxyStubLegacy.dll" )
+
+/** For use with AssertLogRel except a_Expr1 from assertions but not LogRel. */
+#ifdef RT_STRICT
+# define VBPS_LOGREL_NO_ASSERT(a_Expr1) (a_Expr)
+#else
+# define VBPS_LOGREL_NO_ASSERT false
+#endif
 
 
@@ -225,5 +232,5 @@
      * /target being set to NT51.
      */
-    AssertMsg(hrc == S_OK, ("%Rhrc\n",  hrc));
+    AssertLogRelMsg(hrc == S_OK, ("%Rhrc\n",  hrc));
     return hrc;
 }
@@ -413,8 +420,8 @@
         /* Ignore access denied errors as these may easily happen for
            non-admin users. Just give up when this happens */
-        AssertMsgReturn(rc == ERROR_ACCESS_DENIED, ("%u\n", rc), pState->rc = rc);
+        AssertLogRelMsgReturn(rc == ERROR_ACCESS_DENIED, ("%u\n", rc), pState->rc = rc);
     }
     else
-        AssertMsgReturn(rc == ERROR_ACCESS_DENIED, ("%u\n", rc), pState->rc = rc);
+       AssertLogRelMsgReturn(rc == ERROR_ACCESS_DENIED, ("%u\n", rc), pState->rc = rc);
     return pState->rc = rc;
 }
@@ -513,5 +520,5 @@
             return ERROR_SUCCESS;
         }
-        AssertMsgFailed(("%u\n", rc));
+        AssertLogRelMsgFailed(("%u\n", rc));
         RegCloseKey(pState->aAltDeletes[i].hkeyClasses);
     }
@@ -521,5 +528,5 @@
     else
     {
-        AssertMsgFailed(("%u\n", rc));
+        AssertLogRelMsgFailed(("%u (%#x %s)\n", rc));
         pState->rc = rc;
     }
@@ -556,5 +563,5 @@
             rc = RegOpenKeyExW(pState->hkeyClassesRootDst, L"Interface", 0 /*fOptions*/, pState->fSamBoth,
                                &pState->hkeyClsidRootDst);
-        AssertMsgReturnStmt(rc == ERROR_SUCCESS, ("%u\n", rc), pState->hkeyInterfaceRootDst = NULL,  pState->rc = rc);
+        AssertLogRelMsgReturnStmt(rc == ERROR_SUCCESS, ("%u\n", rc), pState->hkeyInterfaceRootDst = NULL,  pState->rc = rc);
     }
 
@@ -570,5 +577,5 @@
             if (rc != ERROR_SUCCESS)
             {
-                AssertMsgStmt(rc == ERROR_FILE_NOT_FOUND, ("%u\n", rc), pState->rc = rc);
+                AssertMsgStmt(rc == ERROR_FILE_NOT_FOUND || ERROR_ACCESS_DENIED, ("%u\n", rc), pState->rc = rc);
                 pState->aAltDeletes[i].hkeyInterface = NULL;
             }
@@ -702,5 +709,6 @@
     }
 
-    AssertMsgFailed(("%d: '%ls'='%ls' -> %u\n", uLine, pwszValueNm, pwszValue, rc));
+    AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(rc == ERROR_ACCESS_DENIED),
+                    ("%d: '%ls'='%ls' -> %u\n", uLine, pwszValueNm, pwszValue, rc));
     pState->rc = rc;
     return rc;
@@ -768,5 +776,6 @@
     }
 
-    AssertMsgFailed(("%d: '%s'='%s' -> %u\n", uLine, pszValueNm, pszValue, rc));
+    AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(rc == ERROR_ACCESS_DENIED),
+                    ("%d: '%s'='%s' -> %u\n", uLine, pszValueNm, pszValue, rc));
     pState->rc = rc;
     return rc;
@@ -788,5 +797,5 @@
         return ERROR_SUCCESS;
 
-    AssertMsgFailed(("%d: close key -> %u\n", uLine, rc));
+    AssertLogRelMsgFailed(("%d: close key -> %u\n", uLine, rc));
     pState->rc = rc;
     return rc;
@@ -822,5 +831,6 @@
     else
     {
-        AssertMsgFailed(("%d: create key '%s' -> %u\n", uLine, pszKey,  rc));
+        AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(rc == ERROR_ACCESS_DENIED),
+                        ("%d: create key '%s' -> %u\n", uLine, pszKey,  rc));
         pState->rc = rc;
         *phkey = NULL;
@@ -853,5 +863,6 @@
     else
     {
-        AssertMsgFailed(("%d: create key '%s'(/Default='%s') -> %u\n", uLine, pszKey, pszValue, rc));
+        AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(rc == ERROR_ACCESS_DENIED),
+                        ("%d: create key '%s'(/Default='%s') -> %u\n", uLine, pszKey, pszValue, rc));
         pState->rc = rc;
     }
@@ -883,5 +894,6 @@
     else
     {
-        AssertMsgFailed(("%d: create key '%s'(/Default='%ls') -> %u\n", uLine, pszKey, pwszValue, rc));
+        AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(rc == ERROR_ACCESS_DENIED),
+                        ("%d: create key '%s'(/Default='%ls') -> %u\n", uLine, pszKey, pwszValue, rc));
         pState->rc = rc;
     }
@@ -914,5 +926,6 @@
     else
     {
-        AssertMsgFailed(("%d: create key '%s'(/Default='%s') -> %u\n", uLine, pszKey, pszValue, rc));
+        AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(rc == ERROR_ACCESS_DENIED),
+                        ("%d: create key '%s'(/Default='%s') -> %u\n", uLine, pszKey, pszValue, rc));
         pState->rc = rc;
         *phkey = NULL;
@@ -955,5 +968,6 @@
         return ERROR_SUCCESS;
 
-    AssertMsgFailed(("%d: delete key '%s' -> %u\n", uLine, pszKey, rc));
+    AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(rc == ERROR_ACCESS_DENIED),
+                    ("%d: delete key '%s' -> %u\n", uLine, pszKey, rc));
     pState->rc = rc;
     return rc;
@@ -994,5 +1008,6 @@
         return ERROR_SUCCESS;
 
-    AssertMsgFailed(("%d: delete key '%ls' -> %u\n", uLine, pwszKey, rc));
+    AssertLogRelMsg(VBPS_LOGREL_NO_ASSERT(rc == ERROR_ACCESS_DENIED),
+                    ("%d: delete key '%ls' -> %u\n", uLine, pwszKey, rc));
     pState->rc = rc;
     return rc;
@@ -1023,5 +1038,5 @@
         {
             rc = RegOpenKeyExW(pState->aAltDeletes[i].hkeyClasses, L"AppID", 0 /*fOptions*/, pState->fSamDelete, &hkeyAppIds);
-            AssertMsgStmt(rc == ERROR_SUCCESS || rc == ERROR_FILE_NOT_FOUND, ("%u\n", rc), pState->rc = rc);
+            AssertLogRelMsgStmt(rc == ERROR_SUCCESS || rc == ERROR_FILE_NOT_FOUND, ("%u\n", rc), pState->rc = rc);
             if (rc == ERROR_SUCCESS)
             {
@@ -1042,5 +1057,5 @@
             return ERROR_SUCCESS;
     }
-    AssertMsgReturn(rc == ERROR_SUCCESS, ("%u\n", rc), pState->rc = rc);
+    AssertLogRelMsgReturn(rc == ERROR_SUCCESS, ("%u\n", rc), pState->rc = rc);
 
     if (pState->fDelete)
@@ -1315,5 +1330,6 @@
     /* Open Classes/TypeLib/. */
     rc = vbpsCreateRegKeyA(pState, pState->hkeyClassesRootDst, "TypeLib", &hkeyTypeLibs, __LINE__);
-    AssertReturnVoid(rc == ERROR_SUCCESS);
+    if (rc != ERROR_SUCCESS)
+        return;
 
     /* Create TypeLib/{UUID}. */
@@ -1421,5 +1437,6 @@
     Assert(pState->fUpdate && !pState->fDelete);
     rc = vbpsRegOpenInterfaceKeys(pState);
-    AssertReturnVoid(rc == ERROR_SUCCESS);
+    if (rc != ERROR_SUCCESS)
+        return rc;
 
     /*
@@ -1450,6 +1467,4 @@
             AssertReturnVoidStmt(cMethods >= 3 && cMethods < 1024, pState->rc = ERROR_INVALID_DATA);
             sprintf(szMethods, "%u", cMethods);
-
-            AssertReturnVoid(rc == ERROR_SUCCESS);
 
             rc = vbpsCreateRegKeyWithDefaultValueAAEx(pState, pState->hkeyInterfaceRootDst,
