Index: trunk/src/VBox/Main/Makefile.kmk
===================================================================
--- trunk/src/VBox/Main/Makefile.kmk	(revision 83819)
+++ trunk/src/VBox/Main/Makefile.kmk	(revision 83820)
@@ -1309,7 +1309,15 @@
  DLLS += VBoxProxyStub
  VBoxProxyStub_TEMPLATE = VBOXMAINCOMP
- VBoxProxyStub_DEFS     = REGISTER_PROXY_DLL PROXY_CLSID_IS="$(VBOX_MIDL_PROXY_CLSID_IS)" \
-	$(if $(VBOX_WITH_SDS),VBOX_WITH_SDS,)\
- 	$(if $(VBOX_WITH_SDS_CLIENT_WATCHER),VBOX_WITH_SDS_CLIENT_WATCHER,)
+ ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
+  VBoxProxyStub_DEFS   := REGISTER_PROXY_DLL PROXY_CLSID_IS=$(quote $(VBOX_MIDL_PROXY_CLSID_IS))
+ else
+  VBoxProxyStub_DEFS   := REGISTER_PROXY_DLL PROXY_CLSID_IS="$(VBOX_MIDL_PROXY_CLSID_IS)"
+ endif
+ ifdef VBOX_WITH_SDS
+  VBoxProxyStub_DEFS   += VBOX_WITH_SDS
+ endif
+ ifdef VBOX_WITH_SDS_CLIENT_WATCHER
+  VBoxProxyStub_DEFS   +=  VBOX_WITH_SDS_CLIENT_WATCHER,)
+ endif
  VBoxProxyStub_DEFS.win.x86 = WIN32
  VBoxProxyStub_SDKS     = VBOX_NTDLL
Index: trunk/src/VBox/Main/cbinding/tstCAPIGlue.c
===================================================================
--- trunk/src/VBox/Main/cbinding/tstCAPIGlue.c	(revision 83819)
+++ trunk/src/VBox/Main/cbinding/tstCAPIGlue.c	(revision 83820)
@@ -137,5 +137,5 @@
     if (FAILED(rc))
     {
-        printf("cannot get event type, rc=%#x\n", rc);
+        printf("cannot get event type, rc=%#lx\n", rc);
         return S_OK;
     }
@@ -162,5 +162,5 @@
             if (FAILED(rc))
             {
-                printf("cannot get StateChangedEvent interface, rc=%#x\n", rc);
+                printf("cannot get StateChangedEvent interface, rc=%#lx\n", rc);
                 return S_OK;
             }
@@ -172,5 +172,5 @@
             rc = IStateChangedEvent_get_State(ev, &state);
             if (FAILED(rc))
-                printf("warning: cannot get state, rc=%#x\n", rc);
+                printf("warning: cannot get state, rc=%#lx\n", rc);
             IStateChangedEvent_Release(ev);
             printf("OnStateChanged: %s\n", GetStateName(state));
@@ -621,5 +621,5 @@
                         if (FAILED(rc))
                         {
-                            printf("Failed getting event: %#x\n", rc);
+                            printf("Failed getting event: %#lx\n", rc);
                             g_fStop = 1;
                             continue;
@@ -631,5 +631,5 @@
                         if (FAILED(rc))
                         {
-                            printf("Failed processing event: %#x\n", rc);
+                            printf("Failed processing event: %#lx\n", rc);
                             g_fStop = 1;
                             /* finish processing the event */
@@ -638,5 +638,5 @@
                         if (FAILED(rc))
                         {
-                            printf("Failed to mark event as processed: %#x\n", rc);
+                            printf("Failed to mark event as processed: %#lx\n", rc);
                             g_fStop = 1;
                             /* continue with event release */
@@ -771,5 +771,5 @@
             char *group;
             g_pVBoxFuncs->pfnUtf16ToUtf8(groups[i], &group);
-            printf("Groups[%d]: %s\n", i, group);
+            printf("Groups[%lu]: %s\n", i, group);
             g_pVBoxFuncs->pfnUtf8Free(group);
         }
@@ -933,5 +933,5 @@
 
                 IMachine_get_MemorySize(machine, &memorySize);
-                printf("\tMemory size: %uMB\n", memorySize);
+                printf("\tMemory size: %luMB\n", memorySize);
             }
 
@@ -1061,5 +1061,5 @@
     rc = IVirtualBox_get_Revision(vbox, &revision);
     if (SUCCEEDED(rc))
-        printf("\tRevision: %u\n", revision);
+        printf("\tRevision: %lu\n", revision);
     else
         PrintErrorInfo(argv[0], "GetRevision() failed", rc);
Index: trunk/src/VBox/Main/src-all/win/VBoxProxyStub.c
===================================================================
--- trunk/src/VBox/Main/src-all/win/VBoxProxyStub.c	(revision 83819)
+++ trunk/src/VBox/Main/src-all/win/VBoxProxyStub.c	(revision 83820)
@@ -2113,5 +2113,5 @@
          */
         HKEY hkeyTypeLibs;
-        LRESULT rc;
+        LSTATUS rc;
         rc = RegOpenKeyExW(pState->aAltDeletes[iAlt].hkeyClasses, L"TypeLib", 0 /*fOptions*/, pState->fSamDelete, &hkeyTypeLibs);
         if (rc == ERROR_SUCCESS)
@@ -2124,5 +2124,5 @@
             {
                 HKEY hkeyTypeLibId;
-                LONG rc = RegOpenKeyExW(hkeyTypeLibs, g_apwszTypeLibIds[iTlb], 0 /*fOptions*/, pState->fSamDelete, &hkeyTypeLibId);
+                rc = RegOpenKeyExW(hkeyTypeLibs, g_apwszTypeLibIds[iTlb], 0 /*fOptions*/, pState->fSamDelete, &hkeyTypeLibId);
                 if (rc == ERROR_SUCCESS)
                 {
Index: trunk/src/VBox/Main/src-helper-apps/VBoxExtPackHelperApp.cpp
===================================================================
--- trunk/src/VBox/Main/src-helper-apps/VBoxExtPackHelperApp.cpp	(revision 83819)
+++ trunk/src/VBox/Main/src-helper-apps/VBoxExtPackHelperApp.cpp	(revision 83820)
@@ -1344,5 +1344,4 @@
                                 break;
                             }
-                            MSG Msg;
                             while (PeekMessageW(&Msg, NULL, 0, 0, PM_REMOVE))
                             {
Index: trunk/src/VBox/Main/testcase/msiDarwinDescriptorDecoder.cpp
===================================================================
--- trunk/src/VBox/Main/testcase/msiDarwinDescriptorDecoder.cpp	(revision 83819)
+++ trunk/src/VBox/Main/testcase/msiDarwinDescriptorDecoder.cpp	(revision 83820)
@@ -54,5 +54,5 @@
                     " ->     FeatureId=%ls\n"
                     " -> ComponentCode=%ls\n"
-                    " ->  offArguments=%#x (%d)\n"
+                    " ->  offArguments=%#lx (%ld)\n"
                     , iArg, papwszArgs[iArg], wszProductCode, wszFeatureId, wszComponentCode, offArguments, offArguments);
         }
@@ -61,5 +61,5 @@
             fprintf(stderr,
                     "#%u: '%ls'\n"
-                    " -> error %u (%#x)\n"
+                    " -> error %lu (%#lx)\n"
                     , iArg, papwszArgs[iArg], dwErr, dwErr);
             rcExit = 1;
Index: trunk/src/VBox/Main/testcase/tstVBoxAPIWin.cpp
===================================================================
--- trunk/src/VBox/Main/testcase/tstVBoxAPIWin.cpp	(revision 83819)
+++ trunk/src/VBox/Main/testcase/tstVBoxAPIWin.cpp	(revision 83820)
@@ -117,5 +117,5 @@
 
         if (FAILED(rc))
-            printf("Error getting error info! rc = 0x%x\n", rc);
+            printf("Error getting error info! rc=%#lx\n", rc);
         else
         {
@@ -125,5 +125,5 @@
 
             if (FAILED(rc) || !errorDescription)
-                printf("Error getting error description! rc = 0x%x\n", rc);
+                printf("Error getting error description! rc=%#lx\n", rc);
             else
             {
@@ -161,5 +161,5 @@
 
         if (FAILED(rc))
-            printf("Error getting error info! rc = 0x%x\n", rc);
+            printf("Error getting error info! rc=%#lx\n", rc);
         else
         {
@@ -169,5 +169,5 @@
 
             if (FAILED(rc) || !errorDescription)
-                printf("Error getting error description! rc = 0x%x\n", rc);
+                printf("Error getting error description! rc=%#lx\n", rc);
             else
             {
@@ -193,5 +193,5 @@
             if (!SUCCEEDED(rc))
             {
-                printf("Error retrieving machine ID! rc = 0x%x\n", rc);
+                printf("Error retrieving machine ID! rc=%#lx\n", rc);
                 break;
             }
@@ -205,5 +205,5 @@
             if (!SUCCEEDED(rc))
             {
-                printf("Error creating Session instance! rc = 0x%x\n", rc);
+                printf("Error creating Session instance! rc=%#lx\n", rc);
                 break;
             }
@@ -214,5 +214,5 @@
             if (!SUCCEEDED(rc))
             {
-                printf("Could not open remote session! rc = 0x%x\n", rc);
+                printf("Could not open remote session! rc=%#lx\n", rc);
                 break;
             }
@@ -287,5 +287,5 @@
         }
         else
-            printf("Error creating VirtualBox instance! rc = 0x%x\n", rc);
+            printf("Error creating VirtualBox instance! rc=%#lx\n", rc);
     }
 
