Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp	(revision 38635)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp	(revision 38636)
@@ -2831,5 +2831,5 @@
             vboxVDbgVEHandlerRegister();
 #endif
-            int rc = RTR3Init();
+            int rc = RTR3InitDll(0);
             AssertRC(rc);
             if (RT_SUCCESS(rc))
Index: trunk/src/VBox/Additions/WINNT/SharedFolders/redirector/dll/dllmain.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/SharedFolders/redirector/dll/dllmain.cpp	(revision 38635)
+++ trunk/src/VBox/Additions/WINNT/SharedFolders/redirector/dll/dllmain.cpp	(revision 38636)
@@ -37,5 +37,5 @@
     case DLL_PROCESS_ATTACH:
 
-        RTR3Init();
+        RTR3InitDll(0);
         VbglR3Init();
         LogRel(("VBOXNP: DLL loaded.\n"));
Index: trunk/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProv.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProv.cpp	(revision 38635)
+++ trunk/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProv.cpp	(revision 38636)
@@ -30,5 +30,5 @@
     LONG l = DllAddRef();
 
-    int rc = RTR3Init(); /* Never terminate the runtime! */
+    int rc = RTR3InitDll(0); /* Never terminate the runtime! */
     if (RT_FAILURE(rc))
         LogRel(("VBoxCredProv: Could not init runtime! rc = %Rrc\n", rc));
Index: trunk/src/VBox/Additions/WINNT/VBoxGINA/VBoxGINA.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/VBoxGINA/VBoxGINA.cpp	(revision 38635)
+++ trunk/src/VBox/Additions/WINNT/VBoxGINA/VBoxGINA.cpp	(revision 38636)
@@ -78,5 +78,5 @@
         case DLL_PROCESS_ATTACH:
         {
-            RTR3Init();
+            RTR3InitDll();
             VbglR3Init();
             LogRel(("VBoxGINA: DLL loaded.\n"));
Index: trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp	(revision 38635)
+++ trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp	(revision 38636)
@@ -680,5 +680,5 @@
     LogRel(("VBoxTray: %s r%s\n", RTBldCfgVersion(), RTBldCfgRevisionStr()));
 
-    int rc = RTR3Init();
+    int rc = RTR3InitExeNoArguments(0);
     if (RT_SUCCESS(rc))
     {
Index: trunk/src/VBox/Additions/common/VBoxControl/VBoxControl.cpp
===================================================================
--- trunk/src/VBox/Additions/common/VBoxControl/VBoxControl.cpp	(revision 38635)
+++ trunk/src/VBox/Additions/common/VBoxControl/VBoxControl.cpp	(revision 38636)
@@ -1542,5 +1542,5 @@
     bool fOnlyInfo = false;
 
-    rrc = RTR3Init();
+    rrc = RTR3InitExe(argc, &argv, 0);
     if (RT_FAILURE(rrc))
         return RTMsgInitFailure(rrc);
Index: trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp
===================================================================
--- trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp	(revision 38635)
+++ trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp	(revision 38636)
@@ -597,5 +597,5 @@
      * Init globals and such.
      */
-    int rc = RTR3Init();
+    int rc = RTR3InitExe(argc, &argv, 0);
     if (RT_FAILURE(rc))
         return RTMsgInitFailure(rc);
Index: trunk/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp
===================================================================
--- trunk/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp	(revision 38635)
+++ trunk/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp	(revision 38636)
@@ -1185,27 +1185,4 @@
 
     /*
-     * The input is ASSUMED to be in the current process codeset (NT guarantees
-     * ACP, unixy systems doesn't guarantee anything).  This loop converts all
-     * the argv[*] strings to UTF-8, which is a tad ugly but who cares.
-     * (As a rule all strings in VirtualBox are UTF-8.)
-     */
-    for (int i = 0; i < argc; i++)
-    {
-        char *pszConverted;
-        int rc = RTStrCurrentCPToUtf8(&pszConverted, argv[i]);
-        if (RT_SUCCESS(rc))
-            argv[i] = pszConverted;
-        else
-        {
-            RTMsgError("Failed to convert argument %d to UTF-8, rc=%Rrc\n",
-                       i + 1, rc);
-
-            /* Conversion was not possible,probably due to invalid characters.
-             * Keep in mind that we do RTStrFree on the whole array below. */
-            argv[i] = RTStrDup(argv[i]);
-        }
-    }
-
-    /*
      * Invoke the handler.
      */
@@ -1213,14 +1190,5 @@
     *prcExit = pfnHandler(argc, argv);
 
-    /*
-     * Free converted argument vector
-     */
-    for (int i = 0; i < argc; i++)
-    {
-        RTStrFree(argv[i]);
-        argv[i] = NULL;
-    }
     return true;
-
-}
-
+}
+
Index: trunk/src/VBox/Additions/common/VBoxService/testcase/tstUserInfo.cpp
===================================================================
--- trunk/src/VBox/Additions/common/VBoxService/testcase/tstUserInfo.cpp	(revision 38635)
+++ trunk/src/VBox/Additions/common/VBoxService/testcase/tstUserInfo.cpp	(revision 38636)
@@ -41,5 +41,5 @@
      * Init globals and such.
      */
-    RTR3Init();
+    RTR3InitExeNoArguments(0);
 
     int rc = VbglR3Init();
Index: trunk/src/VBox/Additions/common/crOpenGL/load.c
===================================================================
--- trunk/src/VBox/Additions/common/crOpenGL/load.c	(revision 38635)
+++ trunk/src/VBox/Additions/common/crOpenGL/load.c	(revision 38636)
@@ -103,5 +103,5 @@
         devMode.dmSize = sizeof(DEVMODE);
         EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &devMode);
-        
+
         if (devMode.dmPelsWidth!=window->dmPelsWidth || devMode.dmPelsHeight!=window->dmPelsHeight)
         {
@@ -327,5 +327,5 @@
     ASMAtomicWriteBool(&stub.bShutdownSyncThread, true);
 #endif
-  
+
     //delete all created contexts
     stubMakeCurrent( NULL, NULL);
@@ -409,5 +409,5 @@
             /*Same issue as on linux, RTThreadWait exits before system thread is terminated, which leads
              * to issues as our dll goes to be unloaded.
-             *@todo 
+             *@todo
              *We usually call this function from DllMain which seems to be holding some lock and thus we have to
              * kill thread via TerminateThread.
@@ -653,5 +653,5 @@
         line[crStrlen(line) - 1] = 0; /* remove trailing newline */
         if (crStrncmp(line, procName, procNameLen) == 0 &&
-            (line[procNameLen] == ' ' || line[procNameLen] == '\t')) 
+            (line[procNameLen] == ' ' || line[procNameLen] == '\t'))
         {
             crWarning("Using Chromium configuration for %s from %s",
@@ -888,5 +888,5 @@
         if (pWindow->hVisibleRegion!=INVALID_HANDLE_VALUE)
         {
-            CombineRgn(hNewRgn, pWindow->hVisibleRegion, hNewRgn, 
+            CombineRgn(hNewRgn, pWindow->hVisibleRegion, hNewRgn,
                        pRegions->pRegions->fFlags.bAddHiddenRects ? RGN_DIFF:RGN_OR);
 
@@ -1105,10 +1105,10 @@
 {
     /* Here is where we contact the mothership to find out what we're supposed
-     * to  be doing.  Networking code in a DLL initializer.  I sure hope this 
-     * works :) 
-     * 
+     * to  be doing.  Networking code in a DLL initializer.  I sure hope this
+     * works :)
+     *
      * HOW can I pass the mothership address to this if I already know it?
      */
-    
+
     CRConnection *conn = NULL;
     char response[1024];
@@ -1200,5 +1200,5 @@
     crSPUInitDispatchTable( &glim );
 
-    /* This is unlikely to change -- We still want to initialize our dispatch 
+    /* This is unlikely to change -- We still want to initialize our dispatch
      * table with the functions of the first SPU in the chain. */
     stubInitSPUDispatch( stub.spu );
@@ -1225,5 +1225,5 @@
         int rc;
 
-        RTR3Init();
+        RTR3InitDll(0);
 
         if (!disable_sync)
@@ -1258,9 +1258,9 @@
 }
 
-/* Sigh -- we can't do initialization at load time, since Windows forbids 
+/* Sigh -- we can't do initialization at load time, since Windows forbids
  * the loading of other libraries from DLLMain. */
 
 #ifdef LINUX
-/* GCC crap 
+/* GCC crap
  *void (*stub_init_ptr)(void) __attribute__((section(".ctors"))) = __stubInit; */
 #endif
@@ -1275,5 +1275,5 @@
     (void) lpvReserved;
 
-    switch (fdwReason) 
+    switch (fdwReason)
     {
     case DLL_PROCESS_ATTACH:
Index: trunk/src/VBox/Additions/common/pam/pam_vbox.cpp
===================================================================
--- trunk/src/VBox/Additions/common/pam/pam_vbox.cpp	(revision 38635)
+++ trunk/src/VBox/Additions/common/pam/pam_vbox.cpp	(revision 38636)
@@ -227,5 +227,5 @@
     RTAssertSetMayPanic(false);
 
-    int rc = RTR3Init();
+    int rc = RTR3InitDll(0);
     if (RT_FAILURE(rc))
     {
Index: trunk/src/VBox/Additions/common/testcase/tstPageFusion.cpp
===================================================================
--- trunk/src/VBox/Additions/common/testcase/tstPageFusion.cpp	(revision 38635)
+++ trunk/src/VBox/Additions/common/testcase/tstPageFusion.cpp	(revision 38636)
@@ -23,4 +23,5 @@
 #include <iprt/asm.h>
 #include <iprt/mem.h>
+#include <iprt/messages.h>
 #include <iprt/stream.h>
 #include <iprt/string.h>
@@ -349,9 +350,10 @@
 int main(int argc, char **argv)
 {
-    int rc = VINF_SUCCESS;
     /*
      * Init globals and such.
      */
-    RTR3Init();
+    int rc = RTR3InitExe(argc, &argv, 0);
+    if (RT_FAILURE(rc))
+        return RTMsgInitFailure(rc);
 
     /*
Index: trunk/src/VBox/Additions/x11/VBoxClient/main.cpp
===================================================================
--- trunk/src/VBox/Additions/x11/VBoxClient/main.cpp	(revision 38635)
+++ trunk/src/VBox/Additions/x11/VBoxClient/main.cpp	(revision 38636)
@@ -30,4 +30,5 @@
 #include <iprt/env.h>
 #include <iprt/initterm.h>
+#include <iprt/message.h>
 #include <iprt/path.h>
 #include <iprt/param.h>
@@ -159,5 +160,10 @@
 int main(int argc, char *argv[])
 {
-    int rcClipboard, rc;
+    /* Initialise our runtime before all else. */
+    int rc = RTR3InitExe(argc, &argv, 0);
+    if (RT_FAILURE(rc))
+        return RTMsgInitFailure(rc);
+
+    int rcClipboard;
     const char *pszFileName = RTPathFilename(argv[0]);
     bool fDaemonise = true;
@@ -170,13 +176,4 @@
         pszFileName = "VBoxClient";
 
-    /* Initialise our runtime before all else. */
-    rc = RTR3Init();
-    if (RT_FAILURE(rc))
-    {
-        /* Of course, this should never happen. */
-        RTPrintf("%s: Failed to initialise the run-time library, rc=%Rrc\n", pszFileName, rc);
-        exit(1);
-    }
-
     /* Initialise our global clean-up critical section */
     rc = RTCritSectInit(&g_critSect);
@@ -185,5 +182,5 @@
         /* Of course, this should never happen. */
         RTPrintf("%s: Failed to initialise the global critical section, rc=%Rrc\n", pszFileName, rc);
-        exit(1);
+        return 1;
     }
 
@@ -225,5 +222,5 @@
         {
             vboxClientUsage(pszFileName);
-            exit(0);
+            return 0;
         }
         else
@@ -231,5 +228,5 @@
             RTPrintf("%s: unrecognized option `%s'\n", pszFileName, argv[i]);
             RTPrintf("Try `%s --help' for more information\n", pszFileName);
-            exit(1);
+            return 1;
         }
     }
@@ -237,5 +234,5 @@
     {
         vboxClientUsage(pszFileName);
-        exit(1);
+        return 1;
     }
     /* Get the path for the pidfiles */
Index: trunk/src/VBox/Additions/x11/VBoxClient/testcase/tstSeamlessX11-auto.cpp
===================================================================
--- trunk/src/VBox/Additions/x11/VBoxClient/testcase/tstSeamlessX11-auto.cpp	(revision 38635)
+++ trunk/src/VBox/Additions/x11/VBoxClient/testcase/tstSeamlessX11-auto.cpp	(revision 38636)
@@ -685,5 +685,5 @@
 int main( int argc, char **argv)
 {
-    RTR3Init();
+    RTR3InitExe(argc, &argv, 0);
     unsigned cErrs = 0;
     g_pszTestName = RTPathFilename(argv[0]);
Index: trunk/src/VBox/Additions/x11/VBoxClient/testcase/tstSeamlessX11.cpp
===================================================================
--- trunk/src/VBox/Additions/x11/VBoxClient/testcase/tstSeamlessX11.cpp	(revision 38635)
+++ trunk/src/VBox/Additions/x11/VBoxClient/testcase/tstSeamlessX11.cpp	(revision 38636)
@@ -107,5 +107,5 @@
     char ach[2];
 
-    RTR3Init();
+    RTR3InitExe(argc, &argv, 0);
     RTPrintf("VirtualBox guest additions X11 seamless mode testcase\n");
     if (0 == XInitThreads())
