Changeset 38636 in vbox
- Timestamp:
- Sep 5, 2011 1:49:45 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 73843
- Location:
- trunk
- Files:
-
- 147 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/initterm.h
r36508 r38636 41 41 42 42 #ifdef IN_RING3 43 /** @name RTR3Init flags (RTR3INIT_XXX). 44 * @{ */ 45 /** Try initialize SUPLib. */ 46 #define RTR3INIT_FLAGS_SUPLIB RT_BIT(0) 47 /** Initializing IPRT from a DLL. */ 48 #define RTR3INIT_FLAGS_DLL RT_BIT(1) 49 /** @} */ 50 51 /** @name RTR3InitEx version 52 * @{ */ 53 /** Version 1. */ 54 #define RTR3INIT_VER_1 UINT32_C(1) 55 /** The current version. */ 56 #define RTR3INIT_VER_CUR RTR3INIT_VER_1 57 /** @} */ 58 43 59 /** 44 60 * Initializes the runtime library. 45 61 * 46 62 * @returns iprt status code. 47 */ 48 RTR3DECL(int) RTR3Init(void); 49 50 51 /** 52 * Initializes the runtime library and try initialize SUPLib too. 53 * 54 * @returns IPRT status code. 55 * 56 * @remarks Failure to initialize SUPLib is ignored. 57 */ 58 RTR3DECL(int) RTR3InitAndSUPLib(void); 59 60 /** 61 * Initializes the runtime library passing it the program path. 62 * 63 * @returns IPRT status code. 64 * @param pszProgramPath The path to the program file. 65 */ 66 RTR3DECL(int) RTR3InitWithProgramPath(const char *pszProgramPath); 67 68 /** 69 * Initializes the runtime library passing it the program path, 70 * and try initialize SUPLib too (failures ignored). 71 * 72 * @returns IPRT status code. 73 * @param pszProgramPath The path to the program file. 74 * 75 * @remarks Failure to initialize SUPLib is ignored. 76 */ 77 RTR3DECL(int) RTR3InitAndSUPLibWithProgramPath(const char *pszProgramPath); 63 * @param fFlags Flags, see RTR3INIT_XXX. 64 */ 65 RTR3DECL(int) RTR3InitExeNoArguments(uint32_t fFlags); 66 67 /** 68 * Initializes the runtime library. 69 * 70 * @returns iprt status code. 71 * @param cArgs Pointer to the argument count. 72 * @param ppapszArgs Pointer to the argument vector pointer. 73 * @param fFlags Flags, see RTR3INIT_XXX. 74 */ 75 RTR3DECL(int) RTR3InitExe(int cArgs, char ***papszArgs, uint32_t fFlags); 76 77 /** 78 * Initializes the runtime library. 79 * 80 * @returns iprt status code. 81 * @param fFlags Flags, see RTR3INIT_XXX. 82 */ 83 RTR3DECL(int) RTR3InitDll(uint32_t fFlags); 78 84 79 85 /** … … 84 90 * @returns IPRT status code. 85 91 * @param iVersion The interface version. Must be 0 atm. 86 * @param pszProgramPath The program path. Pass NULL if we're to figure it out ourselves. 87 * @param fInitSUPLib Whether to initialize the support library or not. 88 */ 89 RTR3DECL(int) RTR3InitEx(uint32_t iVersion, const char *pszProgramPath, bool fInitSUPLib); 92 * @param fFlags Flags, see RTR3INIT_XXX. 93 * @param cArgs Pointer to the argument count. 94 * @param ppapszArgs Pointer to the argument vector pointer. NULL 95 * allowed if @a cArgs is 0. 96 * @param pszProgramPath The program path. Pass NULL if we're to figure it 97 * out ourselves. 98 */ 99 RTR3DECL(int) RTR3InitEx(uint32_t iVersion, uint32_t fFlags, int cArgs, char ***papszArgs, const char *pszProgramPath); 90 100 91 101 /** -
trunk/include/iprt/mangling.h
r38581 r38636 980 980 # define RTR0Term RT_MANGLER(RTR0Term) /* r0drv */ 981 981 # define RTR0TermForced RT_MANGLER(RTR0TermForced) /* r0drv */ 982 # define RTR3Init RT_MANGLER(RTR3Init)983 # define RTR3Init AndSUPLib RT_MANGLER(RTR3InitAndSUPLib)984 # define RTR3Init AndSUPLibWithProgramPath RT_MANGLER(RTR3InitAndSUPLibWithProgramPath)982 # define RTR3InitDll RT_MANGLER(RTR3InitDll) 983 # define RTR3InitExe RT_MANGLER(RTR3InitExe) 984 # define RTR3InitExeNoArguments RT_MANGLER(RTR3InitExeNoArguments) 985 985 # define RTR3InitEx RT_MANGLER(RTR3InitEx) 986 # define RTR3InitWithProgramPath RT_MANGLER(RTR3InitWithProgramPath)987 986 # define rtR3MemAlloc RT_MANGLER(rtR3MemAlloc) 988 987 # define rtR3MemFree RT_MANGLER(rtR3MemFree) -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp
r38565 r38636 2831 2831 vboxVDbgVEHandlerRegister(); 2832 2832 #endif 2833 int rc = RTR3Init ();2833 int rc = RTR3InitDll(0); 2834 2834 AssertRC(rc); 2835 2835 if (RT_SUCCESS(rc)) -
trunk/src/VBox/Additions/WINNT/SharedFolders/redirector/dll/dllmain.cpp
r31634 r38636 37 37 case DLL_PROCESS_ATTACH: 38 38 39 RTR3Init ();39 RTR3InitDll(0); 40 40 VbglR3Init(); 41 41 LogRel(("VBOXNP: DLL loaded.\n")); -
trunk/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProv.cpp
r36454 r38636 30 30 LONG l = DllAddRef(); 31 31 32 int rc = RTR3Init (); /* Never terminate the runtime! */32 int rc = RTR3InitDll(0); /* Never terminate the runtime! */ 33 33 if (RT_FAILURE(rc)) 34 34 LogRel(("VBoxCredProv: Could not init runtime! rc = %Rrc\n", rc)); -
trunk/src/VBox/Additions/WINNT/VBoxGINA/VBoxGINA.cpp
r38313 r38636 78 78 case DLL_PROCESS_ATTACH: 79 79 { 80 RTR3Init ();80 RTR3InitDll(); 81 81 VbglR3Init(); 82 82 LogRel(("VBoxGINA: DLL loaded.\n")); -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp
r37423 r38636 680 680 LogRel(("VBoxTray: %s r%s\n", RTBldCfgVersion(), RTBldCfgRevisionStr())); 681 681 682 int rc = RTR3Init ();682 int rc = RTR3InitExeNoArguments(0); 683 683 if (RT_SUCCESS(rc)) 684 684 { -
trunk/src/VBox/Additions/common/VBoxControl/VBoxControl.cpp
r33540 r38636 1542 1542 bool fOnlyInfo = false; 1543 1543 1544 rrc = RTR3Init ();1544 rrc = RTR3InitExe(argc, &argv, 0); 1545 1545 if (RT_FAILURE(rrc)) 1546 1546 return RTMsgInitFailure(rrc); -
trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp
r38633 r38636 597 597 * Init globals and such. 598 598 */ 599 int rc = RTR3Init ();599 int rc = RTR3InitExe(argc, &argv, 0); 600 600 if (RT_FAILURE(rc)) 601 601 return RTMsgInitFailure(rc); -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp
r38633 r38636 1185 1185 1186 1186 /* 1187 * The input is ASSUMED to be in the current process codeset (NT guarantees1188 * ACP, unixy systems doesn't guarantee anything). This loop converts all1189 * the argv[*] strings to UTF-8, which is a tad ugly but who cares.1190 * (As a rule all strings in VirtualBox are UTF-8.)1191 */1192 for (int i = 0; i < argc; i++)1193 {1194 char *pszConverted;1195 int rc = RTStrCurrentCPToUtf8(&pszConverted, argv[i]);1196 if (RT_SUCCESS(rc))1197 argv[i] = pszConverted;1198 else1199 {1200 RTMsgError("Failed to convert argument %d to UTF-8, rc=%Rrc\n",1201 i + 1, rc);1202 1203 /* Conversion was not possible,probably due to invalid characters.1204 * Keep in mind that we do RTStrFree on the whole array below. */1205 argv[i] = RTStrDup(argv[i]);1206 }1207 }1208 1209 /*1210 1187 * Invoke the handler. 1211 1188 */ … … 1213 1190 *prcExit = pfnHandler(argc, argv); 1214 1191 1215 /*1216 * Free converted argument vector1217 */1218 for (int i = 0; i < argc; i++)1219 {1220 RTStrFree(argv[i]);1221 argv[i] = NULL;1222 }1223 1192 return true; 1224 1225 } 1226 1193 } 1194 -
trunk/src/VBox/Additions/common/VBoxService/testcase/tstUserInfo.cpp
r32652 r38636 41 41 * Init globals and such. 42 42 */ 43 RTR3Init ();43 RTR3InitExeNoArguments(0); 44 44 45 45 int rc = VbglR3Init(); -
trunk/src/VBox/Additions/common/crOpenGL/load.c
r38315 r38636 103 103 devMode.dmSize = sizeof(DEVMODE); 104 104 EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &devMode); 105 105 106 106 if (devMode.dmPelsWidth!=window->dmPelsWidth || devMode.dmPelsHeight!=window->dmPelsHeight) 107 107 { … … 327 327 ASMAtomicWriteBool(&stub.bShutdownSyncThread, true); 328 328 #endif 329 329 330 330 //delete all created contexts 331 331 stubMakeCurrent( NULL, NULL); … … 409 409 /*Same issue as on linux, RTThreadWait exits before system thread is terminated, which leads 410 410 * to issues as our dll goes to be unloaded. 411 *@todo 411 *@todo 412 412 *We usually call this function from DllMain which seems to be holding some lock and thus we have to 413 413 * kill thread via TerminateThread. … … 653 653 line[crStrlen(line) - 1] = 0; /* remove trailing newline */ 654 654 if (crStrncmp(line, procName, procNameLen) == 0 && 655 (line[procNameLen] == ' ' || line[procNameLen] == '\t')) 655 (line[procNameLen] == ' ' || line[procNameLen] == '\t')) 656 656 { 657 657 crWarning("Using Chromium configuration for %s from %s", … … 888 888 if (pWindow->hVisibleRegion!=INVALID_HANDLE_VALUE) 889 889 { 890 CombineRgn(hNewRgn, pWindow->hVisibleRegion, hNewRgn, 890 CombineRgn(hNewRgn, pWindow->hVisibleRegion, hNewRgn, 891 891 pRegions->pRegions->fFlags.bAddHiddenRects ? RGN_DIFF:RGN_OR); 892 892 … … 1105 1105 { 1106 1106 /* Here is where we contact the mothership to find out what we're supposed 1107 * to be doing. Networking code in a DLL initializer. I sure hope this 1108 * works :) 1109 * 1107 * to be doing. Networking code in a DLL initializer. I sure hope this 1108 * works :) 1109 * 1110 1110 * HOW can I pass the mothership address to this if I already know it? 1111 1111 */ 1112 1112 1113 1113 CRConnection *conn = NULL; 1114 1114 char response[1024]; … … 1200 1200 crSPUInitDispatchTable( &glim ); 1201 1201 1202 /* This is unlikely to change -- We still want to initialize our dispatch 1202 /* This is unlikely to change -- We still want to initialize our dispatch 1203 1203 * table with the functions of the first SPU in the chain. */ 1204 1204 stubInitSPUDispatch( stub.spu ); … … 1225 1225 int rc; 1226 1226 1227 RTR3Init ();1227 RTR3InitDll(0); 1228 1228 1229 1229 if (!disable_sync) … … 1258 1258 } 1259 1259 1260 /* Sigh -- we can't do initialization at load time, since Windows forbids 1260 /* Sigh -- we can't do initialization at load time, since Windows forbids 1261 1261 * the loading of other libraries from DLLMain. */ 1262 1262 1263 1263 #ifdef LINUX 1264 /* GCC crap 1264 /* GCC crap 1265 1265 *void (*stub_init_ptr)(void) __attribute__((section(".ctors"))) = __stubInit; */ 1266 1266 #endif … … 1275 1275 (void) lpvReserved; 1276 1276 1277 switch (fdwReason) 1277 switch (fdwReason) 1278 1278 { 1279 1279 case DLL_PROCESS_ATTACH: -
trunk/src/VBox/Additions/common/pam/pam_vbox.cpp
r38548 r38636 227 227 RTAssertSetMayPanic(false); 228 228 229 int rc = RTR3Init ();229 int rc = RTR3InitDll(0); 230 230 if (RT_FAILURE(rc)) 231 231 { -
trunk/src/VBox/Additions/common/testcase/tstPageFusion.cpp
r37955 r38636 23 23 #include <iprt/asm.h> 24 24 #include <iprt/mem.h> 25 #include <iprt/messages.h> 25 26 #include <iprt/stream.h> 26 27 #include <iprt/string.h> … … 349 350 int main(int argc, char **argv) 350 351 { 351 int rc = VINF_SUCCESS;352 352 /* 353 353 * Init globals and such. 354 354 */ 355 RTR3Init(); 355 int rc = RTR3InitExe(argc, &argv, 0); 356 if (RT_FAILURE(rc)) 357 return RTMsgInitFailure(rc); 356 358 357 359 /* -
trunk/src/VBox/Additions/x11/VBoxClient/main.cpp
r35617 r38636 30 30 #include <iprt/env.h> 31 31 #include <iprt/initterm.h> 32 #include <iprt/message.h> 32 33 #include <iprt/path.h> 33 34 #include <iprt/param.h> … … 159 160 int main(int argc, char *argv[]) 160 161 { 161 int rcClipboard, rc; 162 /* Initialise our runtime before all else. */ 163 int rc = RTR3InitExe(argc, &argv, 0); 164 if (RT_FAILURE(rc)) 165 return RTMsgInitFailure(rc); 166 167 int rcClipboard; 162 168 const char *pszFileName = RTPathFilename(argv[0]); 163 169 bool fDaemonise = true; … … 170 176 pszFileName = "VBoxClient"; 171 177 172 /* Initialise our runtime before all else. */173 rc = RTR3Init();174 if (RT_FAILURE(rc))175 {176 /* Of course, this should never happen. */177 RTPrintf("%s: Failed to initialise the run-time library, rc=%Rrc\n", pszFileName, rc);178 exit(1);179 }180 181 178 /* Initialise our global clean-up critical section */ 182 179 rc = RTCritSectInit(&g_critSect); … … 185 182 /* Of course, this should never happen. */ 186 183 RTPrintf("%s: Failed to initialise the global critical section, rc=%Rrc\n", pszFileName, rc); 187 exit(1);184 return 1; 188 185 } 189 186 … … 225 222 { 226 223 vboxClientUsage(pszFileName); 227 exit(0);224 return 0; 228 225 } 229 226 else … … 231 228 RTPrintf("%s: unrecognized option `%s'\n", pszFileName, argv[i]); 232 229 RTPrintf("Try `%s --help' for more information\n", pszFileName); 233 exit(1);230 return 1; 234 231 } 235 232 } … … 237 234 { 238 235 vboxClientUsage(pszFileName); 239 exit(1);236 return 1; 240 237 } 241 238 /* Get the path for the pidfiles */ -
trunk/src/VBox/Additions/x11/VBoxClient/testcase/tstSeamlessX11-auto.cpp
r37173 r38636 685 685 int main( int argc, char **argv) 686 686 { 687 RTR3Init ();687 RTR3InitExe(argc, &argv, 0); 688 688 unsigned cErrs = 0; 689 689 g_pszTestName = RTPathFilename(argv[0]); -
trunk/src/VBox/Additions/x11/VBoxClient/testcase/tstSeamlessX11.cpp
r36808 r38636 107 107 char ach[2]; 108 108 109 RTR3Init ();109 RTR3InitExe(argc, &argv, 0); 110 110 RTPrintf("VirtualBox guest additions X11 seamless mode testcase\n"); 111 111 if (0 == XInitThreads()) -
trunk/src/VBox/Debugger/testcase/tstVBoxDbg.cpp
r35346 r38636 39 39 int cErrors = 0; /* error count. */ 40 40 41 RTR3Init AndSUPLib();41 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB); 42 42 RTPrintf(TESTCASE ": TESTING...\n"); 43 43 -
trunk/src/VBox/Devices/Network/testcase/tstIntNet-1.cpp
r36470 r38636 602 602 * Init the runtime and parse the arguments. 603 603 */ 604 RTR3Init ();604 RTR3InitExe(argc, &argv, 0); 605 605 606 606 static RTGETOPTDEF const s_aOptions[] = -
trunk/src/VBox/Disassembler/testcase/tstDisasm-2.cpp
r33540 r38636 805 805 int main(int argc, char **argv) 806 806 { 807 RTR3Init ();807 RTR3InitExe(argc, &argv, 0); 808 808 const char * const argv0 = RTPathFilename(argv[0]); 809 809 -
trunk/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp
r37596 r38636 914 914 * Before we do *anything*, we initialize the runtime. 915 915 */ 916 int rc = RTR3Init ();916 int rc = RTR3InitExe(argc, &argv, 0); 917 917 if (RT_FAILURE(rc)) 918 return FatalError("RTR3Init failed rc=%Rrc\n", rc);918 return FatalError("RTR3InitExe failed rc=%Rrc\n", rc); 919 919 920 920 return TrustedMain(argc, argv, NULL); -
trunk/src/VBox/Frontends/VBoxBalloonCtrl/VBoxBalloonCtrl.cpp
r37103 r38636 1273 1273 * the support driver. 1274 1274 */ 1275 int rc = RTR3Init ();1275 int rc = RTR3InitExe(argc, &argv, 0); 1276 1276 if (RT_FAILURE(rc)) 1277 1277 return RTMsgInitFailure(rc); -
trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
r38626 r38636 1352 1352 { 1353 1353 // initialize VBox Runtime 1354 int rc = RTR3Init AndSUPLib();1354 int rc = RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB); 1355 1355 if (RT_FAILURE(rc)) 1356 1356 { -
trunk/src/VBox/Frontends/VBoxHeadless/testcase/tstHeadless.cpp
r35521 r38636 41 41 { 42 42 // initialize VBox Runtime 43 RTR3Init ();43 RTR3InitExe(argc, &argv, 0); 44 44 45 45 // the below cannot be Bstr because on Linux Bstr doesn't work -
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r38417 r38636 244 244 * the support driver. 245 245 */ 246 RTR3Init ();246 RTR3InitExe(argc, &argv, 0); 247 247 248 248 /* … … 329 329 if (FAILED(hrc)) 330 330 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to initialize COM!"); 331 332 /*333 * The input is ASSUMED to be in the current process codeset (NT guarantees334 * ACP, unixy systems doesn't guarantee anything). This loop converts all335 * the argv[*] strings to UTF-8, which is a tad ugly but who cares.336 * (As a rule all strings in VirtualBox are UTF-8.)337 */338 for (int i = iCmdArg; i < argc; i++)339 {340 char *pszConverted;341 int rc = RTStrCurrentCPToUtf8(&pszConverted, argv[i]);342 if (RT_SUCCESS(rc))343 argv[i] = pszConverted;344 else345 /* Conversion was not possible,probably due to invalid characters.346 * Keep in mind that we do RTStrFree on the whole array below. */347 argv[i] = RTStrDup(argv[i]);348 }349 331 350 332 RTEXITCODE rcExit = RTEXITCODE_FAILURE; … … 500 482 com::Shutdown(); 501 483 502 /*503 * Free converted argument vector504 */505 for (int i = iCmdArg; i < argc; i++)506 {507 RTStrFree(argv[i]);508 argv[i] = NULL;509 }510 511 484 return rcExit; 512 485 #else /* VBOX_ONLY_DOCS */ -
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r37525 r38636 67 67 #include <iprt/ldr.h> 68 68 #include <iprt/initterm.h> 69 #include <iprt/message.h> 69 70 #include <iprt/path.h> 70 71 #include <iprt/process.h> … … 2912 2913 * Before we do *anything*, we initialize the runtime. 2913 2914 */ 2914 int rcRT = RTR3InitAndSUPLib(); 2915 if (RT_FAILURE(rcRT)) 2916 { 2917 RTPrintf("Error: RTR3Init failed rcRC=%d\n", rcRT); 2918 return 1; 2919 } 2915 int rc = RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB); 2916 if (RT_FAILURE(rc)) 2917 return RTMsgInitFailure(rc); 2920 2918 return TrustedMain(argc, argv, NULL); 2921 2919 } -
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDLTest.cpp
r37043 r38636 71 71 { 72 72 int rc; 73 RTR3Init ();73 RTR3InitExe(argc, &argv, 0); 74 74 75 75 for (int i = 1; i < argc; i++) -
trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
r38476 r38636 568 568 } 569 569 570 int rc; 571 if (!fInitSUPLib) 572 rc = RTR3Init(); 573 else 574 rc = RTR3InitAndSUPLib(); 570 int rc = RTR3InitExe(argc, &argv, fInitSUPLib ? RTR3INIT_FLAGS_SUPLIB : 0); 575 571 if (RT_FAILURE(rc)) 576 572 { -
trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/tstDarwinKeyboard.cpp
r28800 r38636 32 32 int main(int argc, char **argv) 33 33 { 34 int rc = RTR3Init ();34 int rc = RTR3InitExe(argc, &argv, 0); 35 35 AssertReleaseRCReturn(rc, 1); 36 36 -
trunk/src/VBox/HostDrivers/Support/SUPLibInternal.h
r37596 r38636 277 277 * 278 278 * This is dynamically resolved and invoked by the static library before it 279 * calls RTR3Init and thereby SUPR3Init.279 * calls RTR3InitEx and thereby SUPR3Init. 280 280 * 281 281 * @returns IPRT status code. -
trunk/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp
r38076 r38636 79 79 #include <VBox/err.h> 80 80 #include <iprt/string.h> 81 #include <iprt/initterm.h> 81 82 #include <iprt/param.h> 82 83 … … 110 111 *******************************************************************************/ 111 112 /** @see RTR3InitEx */ 112 typedef DECLCALLBACK(int) FNRTR3INITEX(uint32_t iVersion, const char *pszProgramPath, bool fInitSUPLib); 113 typedef DECLCALLBACK(int) FNRTR3INITEX(uint32_t iVersion, uint32_t fFlags, int cArgs, 114 char **papszArgs, const char *pszProgramPath); 113 115 typedef FNRTR3INITEX *PFNRTR3INITEX; 114 116 … … 826 828 /** 827 829 * Loads the VBoxRT DLL/SO/DYLIB, hands it the open driver, 828 * and calls RTR3Init .830 * and calls RTR3InitEx. 829 831 * 830 832 * @param fFlags The SUPR3HardenedMain fFlags argument, passed to supR3PreInit. … … 896 898 pszExePath = g_szSupLibHardenedExePath; 897 899 #endif 898 rc = pfnRTInitEx(0, pszExePath, !(fFlags & SUPSECMAIN_FLAGS_DONT_OPEN_DEV)); 900 rc = pfnRTInitEx(RTR3INIT_VER_1, 901 fFlags & SUPSECMAIN_FLAGS_DONT_OPEN_DEV ? 0 : RTR3INIT_FLAGS_SUPLIB, 902 0 /*cArgs*/, NULL /*papszArgs*/, pszExePath); 899 903 if (RT_FAILURE(rc)) 900 904 supR3HardenedFatalMsg("supR3HardenedMainInitRuntime", kSupInitOp_IPRT, rc, 901 "RTR3Init failed with rc=%d", rc);905 "RTR3InitEx failed with rc=%d", rc); 902 906 } 903 907 … … 1085 1089 /* 1086 1090 * Load the IPRT, hand the SUPLib part the open driver and 1087 * call RTR3Init .1091 * call RTR3InitEx. 1088 1092 */ 1089 1093 supR3HardenedMainInitRuntime(fFlags); -
trunk/src/VBox/HostDrivers/Support/testcase/SUPInstall.cpp
r28800 r38636 37 37 int main(int argc, char **argv) 38 38 { 39 RTR3Init ();39 RTR3InitExeNoArguments(0); 40 40 int rc = SUPR3Install(); 41 41 if (RT_SUCCESS(rc)) -
trunk/src/VBox/HostDrivers/Support/testcase/SUPLoggerCtl.cpp
r28800 r38636 58 58 int main(int argc, char **argv) 59 59 { 60 RTR3Init AndSUPLib();60 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB); 61 61 62 62 /* -
trunk/src/VBox/HostDrivers/Support/testcase/SUPUninstall.cpp
r28800 r38636 37 37 int main(int argc, char **argv) 38 38 { 39 RTR3Init ();39 RTR3InitExeNoArguments(0); 40 40 int rc = SUPR3Uninstall(); 41 41 if (RT_SUCCESS(rc)) -
trunk/src/VBox/HostDrivers/Support/testcase/tstContiguous.cpp
r28800 r38636 42 42 int rcRet = 0; 43 43 44 RTR3Init ();44 RTR3InitExe(argc, &argv, 0); 45 45 rc = SUPR3Init(NULL); 46 46 RTPrintf("tstContiguous: SUPR3Init -> rc=%Rrc\n", rc); -
trunk/src/VBox/HostDrivers/Support/testcase/tstGIP-2.cpp
r33595 r38636 43 43 int main(int argc, char **argv) 44 44 { 45 RTR3Init ();45 RTR3InitExe(argc, &argv, 0); 46 46 47 47 /* -
trunk/src/VBox/HostDrivers/Support/testcase/tstGetPagingMode.cpp
r28800 r38636 38 38 { 39 39 int rc; 40 RTR3Init ();40 RTR3InitExe(argc, &argv, 0); 41 41 rc = SUPR3Init(NULL); 42 42 if (RT_SUCCESS(rc)) -
trunk/src/VBox/HostDrivers/Support/testcase/tstInit.cpp
r28800 r38636 38 38 { 39 39 int rc; 40 RTR3Init ();40 RTR3InitExe(argc, &argv, 0); 41 41 rc = SUPR3Init(NULL); 42 42 RTPrintf("tstInit: SUPR3Init -> rc=%d\n", rc); -
trunk/src/VBox/HostDrivers/Support/testcase/tstInt.cpp
r35346 r38636 78 78 * Init. 79 79 */ 80 RTR3Init ();80 RTR3InitExe(argc, &argv, 0); 81 81 PSUPDRVSESSION pSession; 82 82 rc = SUPR3Init(&pSession); -
trunk/src/VBox/HostDrivers/Support/testcase/tstLow.cpp
r28800 r38636 42 42 int rcRet = 0; 43 43 44 RTR3Init ();44 RTR3InitExe(argc, &argv, 0); 45 45 RTPrintf("tstLow: TESTING...\n"); 46 46 -
trunk/src/VBox/HostDrivers/Support/testcase/tstPage.cpp
r28800 r38636 39 39 { 40 40 int cErrors = 0; 41 int rc = 0; 42 RTR3Init AndSUPLib();43 rc = SUPR3Init(NULL);41 42 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB); 43 int rc = SUPR3Init(NULL); 44 44 cErrors += rc != 0; 45 45 if (!rc) -
trunk/src/VBox/HostDrivers/Support/testcase/tstPin.cpp
r28800 r38636 46 46 RTHCPHYS HCPhys; 47 47 48 RTR3Init AndSUPLib();48 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB); 49 49 rc = SUPR3Init(NULL); 50 50 RTPrintf("SUPR3Init -> rc=%d\n", rc); -
trunk/src/VBox/HostDrivers/Support/testcase/tstSupLoadModule.cpp
r35188 r38636 45 45 * Init. 46 46 */ 47 int rc = RTR3Init AndSUPLib();47 int rc = RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB); 48 48 if (RT_FAILURE(rc)) 49 { 50 RTMsgError("RTR3InitAndSUPLib failed with rc=%Rrc\n", rc); 51 return 1; 52 } 49 return RTMsgInitFailure(rc); 53 50 54 51 /* -
trunk/src/VBox/HostDrivers/Support/testcase/tstSupSem-Zombie.cpp
r28800 r38636 95 95 * Init. 96 96 */ 97 int rc = RTR3Init AndSUPLib();97 int rc = RTR3InitExeNoArguments(RTR3INIT_FLAGS_SUPLIB); 98 98 if (RT_FAILURE(rc)) 99 99 { 100 RTPrintf("tstSupSem-Zombie-Child: fatal error: RTR3Init AndSUPLibfailed with rc=%Rrc\n", rc);100 RTPrintf("tstSupSem-Zombie-Child: fatal error: RTR3InitExeNoArguments failed with rc=%Rrc\n", rc); 101 101 return 1; 102 102 } -
trunk/src/VBox/HostDrivers/Support/testcase/tstSupSem.cpp
r33383 r38636 34 34 #include <iprt/err.h> 35 35 #include <iprt/initterm.h> 36 #include <iprt/message.h> 36 37 #include <iprt/stream.h> 37 38 #include <iprt/test.h> … … 79 80 * Init. 80 81 */ 81 int rc = RTR3Init AndSUPLib();82 int rc = RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB); 82 83 if (RT_FAILURE(rc)) 83 { 84 RTPrintf("tstSupSem: fatal error: RTR3InitAndSUPLib failed with rc=%Rrc\n", rc); 85 return 1; 86 } 84 return RTMsgInitFailure(rc); 87 85 88 86 if (argc == 2 && !strcmp(argv[1], "child")) -
trunk/src/VBox/HostDrivers/Support/win/SUPSvc-win.cpp
r33540 r38636 775 775 RTEnvSet("VBOX_LOG_FLAGS", "unbuffered thread msprog"); 776 776 #endif 777 int rc = RTR3Init ();777 int rc = RTR3InitExe(argc, &argv, 0); 778 778 if (RT_FAILURE(rc)) 779 779 { 780 supSvcLogError("RTR3Init failed with rc=%Rrc", rc);780 supSvcLogError("RTR3InitExe failed with rc=%Rrc", rc); 781 781 return 1; 782 782 } -
trunk/src/VBox/HostDrivers/VBoxUSB/darwin/testcase/tstOpenUSBDev.cpp
r31898 r38636 168 168 int main(int argc, char **argv) 169 169 { 170 RTR3Init ();170 RTR3InitExe(argc, &argv, 0); 171 171 172 172 /* -
trunk/src/VBox/HostDrivers/VBoxUSB/testcase/tstUSBFilter.cpp
r31898 r38636 78 78 { 79 79 unsigned cErrors = 0; 80 RTR3Init ();80 RTR3InitExeNoArguments(0); 81 81 82 82 /* -
trunk/src/VBox/HostDrivers/VBoxUSB/win/Install/USBInstall.cpp
r36941 r38636 59 59 int __cdecl main(int argc, char **argv) 60 60 { 61 if (RTR3Init () != VINF_SUCCESS)61 if (RTR3InitExe(argc, &argv, 0) != VINF_SUCCESS) 62 62 { 63 63 printf("Could not init IPRT!\n"); -
trunk/src/VBox/HostDrivers/win/cfg/VBoxDrvCfg.cpp
r36941 r38636 535 535 VBOXDRVCFG_DECL(HRESULT) VBoxDrvCfgInit() 536 536 { 537 int rc = RTR3Init ();537 int rc = RTR3InitDll(0); 538 538 if (rc != VINF_SUCCESS) 539 539 { -
trunk/src/VBox/HostServices/SharedClipboard/x11-clipboard.cpp
r37472 r38636 509 509 VBOXCLIPBOARDCLIENTDATA client; 510 510 unsigned cErrors = 0; 511 int rc = RTR3Init ();511 int rc = RTR3InitExeNoArguments(0); 512 512 RTPrintf(TEST_NAME ": TESTING\n"); 513 513 AssertRCReturn(rc, 1); -
trunk/src/VBox/ImageMounter/VBoxFUSE/VBoxFUSE.cpp
r33540 r38636 1421 1421 * Initialize the runtime and VD. 1422 1422 */ 1423 int rc = RTR3Init ();1423 int rc = RTR3InitExe(argc, &argv, 0); 1424 1424 if (RT_FAILURE(rc)) 1425 1425 { 1426 RTStrmPrintf(g_pStdErr, "VBoxFUSE: RTR3Init failed, rc=%Rrc\n", rc);1426 RTStrmPrintf(g_pStdErr, "VBoxFUSE: RTR3InitExe failed, rc=%Rrc\n", rc); 1427 1427 return 1; 1428 1428 } -
trunk/src/VBox/Installer/win/Stub/VBoxStub.cpp
r37989 r38636 346 346 347 347 /* Init IPRT. */ 348 int vrc = RTR3Init ();348 int vrc = RTR3InitExe(argc, &argv, 0); 349 349 if (RT_FAILURE(vrc)) 350 350 return vrc; -
trunk/src/VBox/Main/src-client/win/dllmain.cpp
r35368 r38636 46 46 47 47 // idempotent, so doesn't harm, and needed for COM embedding scenario 48 RTR3Init ();48 RTR3InitDll(0); 49 49 } 50 50 else if (dwReason == DLL_PROCESS_DETACH) -
trunk/src/VBox/Main/src-helper-apps/VBoxExtPackHelperApp.cpp
r36527 r38636 1746 1746 * Initialize IPRT and check that we're correctly installed. 1747 1747 */ 1748 int rc = RTR3Init ();1748 int rc = RTR3InitExe(argc, &argv, 0); 1749 1749 if (RT_FAILURE(rc)) 1750 1750 return RTMsgInitFailure(rc); … … 1885 1885 NOREF(hPrevInstance); NOREF(nShowCmd); NOREF(lpCmdLine); 1886 1886 1887 int rc = RTR3Init ();1887 int rc = RTR3InitExeNoArguments(0); 1888 1888 if (RT_FAILURE(rc)) 1889 1889 return RTMsgInitFailure(rc); -
trunk/src/VBox/Main/src-server/darwin/iokit.cpp
r33540 r38636 1683 1683 int main(int argc, char **argv) 1684 1684 { 1685 RTR3Init ();1685 RTR3InitExe(argc, &argv, 0); 1686 1686 1687 1687 if (1) -
trunk/src/VBox/Main/src-server/generic/OpenGLTestApp.cpp
r36344 r38636 211 211 int rc = 0; 212 212 213 RTR3Init ();213 RTR3InitExe(argc, &argv, 0); 214 214 215 215 if(argc < 2) -
trunk/src/VBox/Main/src-server/win/svcmain.cpp
r37683 r38636 159 159 LPCTSTR lpCmdLine = GetCommandLine(); /* this line necessary for _ATL_MIN_CRT */ 160 160 161 /* Need to parse the command line before initializing the VBox runtime. */ 161 /* 162 * Need to parse the command line before initializing the VBox runtime. 163 */ 162 164 TCHAR szTokens[] = _T("-/"); 163 165 LPCTSTR lpszToken = FindOneOf(lpCmdLine, szTokens); … … 188 190 * the support driver. 189 191 */ 190 RTR3Init(); 192 int argc = __argc; 193 char **argv = __argv; 194 RTR3InitExe(argc, &argv, 0); 191 195 192 196 /* Note that all options are given lowercase/camel case/uppercase to … … 233 237 234 238 RTGETOPTSTATE GetOptState; 235 int vrc = RTGetOptInit(&GetOptState, __argc, __argv, &s_aOptions[0], RT_ELEMENTS(s_aOptions), 1, 0 /*fFlags*/);239 int vrc = RTGetOptInit(&GetOptState, argc, argv, &s_aOptions[0], RT_ELEMENTS(s_aOptions), 1, 0 /*fFlags*/); 236 240 AssertRC(vrc); 237 241 -
trunk/src/VBox/Main/src-server/xpcom/server.cpp
r37666 r38636 789 789 * the support driver 790 790 */ 791 RTR3Init(); 791 int vrc = RTR3InitExe(argc, &argv, 0); 792 if (RT_FAILURE(vrc)) 793 return RTMsgInitFailure(vrc); 792 794 793 795 static const RTGETOPTDEF s_aOptions[] = … … 811 813 812 814 RTGETOPTSTATE GetOptState; 813 intvrc = RTGetOptInit(&GetOptState, argc, argv, &s_aOptions[0], RT_ELEMENTS(s_aOptions), 1, 0 /*fFlags*/);815 vrc = RTGetOptInit(&GetOptState, argc, argv, &s_aOptions[0], RT_ELEMENTS(s_aOptions), 1, 0 /*fFlags*/); 814 816 AssertRC(vrc); 815 817 -
trunk/src/VBox/Main/testcase/tstAPI.cpp
r36128 r38636 201 201 * the support driver. 202 202 */ 203 RTR3Init ();203 RTR3InitExe(argc, &argv, 0); 204 204 205 205 HRESULT rc; -
trunk/src/VBox/Main/testcase/tstCollector.cpp
r35368 r38636 148 148 * the support driver. 149 149 */ 150 int rc = RTR3Init ();151 if (RT_FAILURE(rc)) 152 { 153 RTPrintf("tstCollector: RTR3Init () -> %d\n", rc);150 int rc = RTR3InitExe(argc, &argv, 0); 151 if (RT_FAILURE(rc)) 152 { 153 RTPrintf("tstCollector: RTR3InitExe() -> %d\n", rc); 154 154 return 1; 155 155 } -
trunk/src/VBox/Main/testcase/tstOVF.cpp
r37862 r38636 282 282 int main(int argc, char *argv[]) 283 283 { 284 RTR3Init ();284 RTR3InitExe(argc, &argv, 0); 285 285 286 286 HRESULT rc = S_OK; -
trunk/src/VBox/Main/webservice/vboxweb.cpp
r37167 r38636 784 784 { 785 785 // initialize runtime 786 int rc = RTR3Init ();786 int rc = RTR3InitExe(argc, &argv, 0); 787 787 if (RT_FAILURE(rc)) 788 788 return RTMsgInitFailure(rc); -
trunk/src/VBox/NetworkServices/DHCP/VBoxNetDHCP.cpp
r36469 r38636 31 31 #include <iprt/getopt.h> 32 32 #include <iprt/initterm.h> 33 #include <iprt/message.h> 33 34 #include <iprt/param.h> 34 35 #include <iprt/path.h> … … 2038 2039 int main(int argc, char **argv, char **envp) 2039 2040 { 2040 int rc = RTR3Init AndSUPLib();2041 int rc = RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB); 2041 2042 if (RT_FAILURE(rc)) 2042 { 2043 RTStrmPrintf(g_pStdErr, "VBoxNetDHCP: RTR3InitAndSupLib failed, rc=%Rrc\n", rc); 2044 return 1; 2045 } 2043 return RTMsgInitFailure(rc); 2046 2044 2047 2045 return TrustedMain(argc, argv, envp); -
trunk/src/VBox/NetworkServices/NAT/VBoxNetNAT.cpp
r37596 r38636 39 39 #include <iprt/string.h> 40 40 #include <iprt/mem.h> 41 #include <iprt/message.h> 41 42 #include <iprt/req.h> 42 43 #include <iprt/file.h> … … 561 562 int main(int argc, char **argv, char **envp) 562 563 { 563 int rc = RTR3Init AndSUPLib();564 int rc = RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB); 564 565 if (RT_FAILURE(rc)) 565 { 566 RTStrmPrintf(g_pStdErr, "VBoxNetDHCP: RTR3InitAndSupLib failed, rc=%Rrc\n", rc); 567 return 1; 568 } 566 return RTMsgInitFailure(rc); 569 567 570 568 return TrustedMain(argc, argv, envp); -
trunk/src/VBox/Runtime/VBox/VBoxRTImp.def
r35185 r38636 858 858 RTProcWait 859 859 RTProcWaitNoResume 860 RTR3Init 861 RTR3Init AndSUPLib862 RTR3Init AndSUPLibWithProgramPath860 RTR3InitDll 861 RTR3InitExe 862 RTR3InitExeNoArguments 863 863 RTR3InitEx 864 RTR3InitWithProgramPath865 864 RTRandAdvBytes 866 865 RTRandAdvCreateParkMiller -
trunk/src/VBox/Runtime/common/misc/thread.cpp
r36951 r38636 107 107 * All the RTTHREADINT structures are kept in a AVL tree which is protected by a 108 108 * read/write lock for efficient access. A thread is inserted into the tree in 109 * three places in the code. The main thread is 'adopted' by IPRT on RTR3Init()109 * three places in the code. The main thread is 'adopted' by IPRT on rtR3Init() 110 110 * by rtThreadAdopt(). When creating a new thread there the child and the parent 111 111 * race inserting the thread, this is rtThreadMain() and RTThreadCreate. … … 981 981 * @param hThread The thread handle. 982 982 * 983 * @remarks This function may not return the correct value when RTR3Init was983 * @remarks This function may not return the correct value when rtR3Init was 984 984 * called on a thread of the than the main one. This could for 985 985 * instance happen when the DLL/DYLIB/SO containing IPRT is dynamically -
trunk/src/VBox/Runtime/common/time/timeprog.cpp
r28800 r38636 80 80 RTDECL(uint32_t) RTTimeProgramSecTS(void) 81 81 { 82 AssertMsg(g_u64ProgramStartMilliTS, (" RTR3Init hasn't been called!\n"));82 AssertMsg(g_u64ProgramStartMilliTS, ("rtR3Init hasn't been called!\n")); 83 83 return (uint32_t)(RTTimeProgramMilliTS() / 1000); 84 84 } -
trunk/src/VBox/Runtime/generic/RTProcDaemonize-generic.cpp
r33806 r38636 46 46 /* 47 47 * Get the executable name. 48 * If this asserts, it's probably because RTR3Init hasn't been called.48 * If this asserts, it's probably because rtR3Init hasn't been called. 49 49 */ 50 50 char szExecPath[RTPATH_MAX]; -
trunk/src/VBox/Runtime/r3/init.cpp
r36549 r38636 53 53 #include <iprt/err.h> 54 54 #include <iprt/log.h> 55 #include <iprt/mem.h> 55 56 #include <iprt/path.h> 56 57 #include <iprt/time.h> … … 74 75 * Global Variables * 75 76 *******************************************************************************/ 76 /** The number of calls to RTR3Init . */77 /** The number of calls to RTR3Init*. */ 77 78 static int32_t volatile g_cUsers = 0; 78 79 /** Whether we're currently initializing the IPRT. */ … … 89 90 DECLHIDDEN(size_t) g_offrtProcName; 90 91 92 /** The argument count of the program. */ 93 DECLHIDDEN(int) g_crtArgs = -1; 94 /** The arguments of the program (UTF-8). This is "leaked". */ 95 DECLHIDDEN(char **) g_papszrtArgs; 96 /** The original argument vector of the program. */ 97 DECLHIDDEN(char **) g_papszrtOrgArgs; 98 91 99 /** 92 100 * Program start nanosecond TS. … … 222 230 223 231 232 /** 233 * Internal worker which initializes or re-initializes the 234 * program path, name and directory globals. 235 * 236 * @returns IPRT status code. 237 * @param fFlags Flags, see RTR3INIT_XXX. 238 * @param cArgs Pointer to the argument count. 239 * @param ppapszArgs Pointer to the argument vector pointer. NULL 240 * allowed if @a cArgs is 0. 241 */ 242 static int rtR3InitArgv(uint32_t fFlags, int cArgs, char ***ppapszArgs) 243 { 244 NOREF(fFlags); 245 if (cArgs) 246 { 247 AssertPtr(ppapszArgs); 248 AssertPtr(*ppapszArgs); 249 char **papszOrgArgs = *ppapszArgs; 250 251 /* 252 * Normally we should only be asked to convert arguments once. If we 253 * are though, it should be the already convered arguments. 254 */ 255 if (g_crtArgs != -1) 256 { 257 AssertReturn( g_crtArgs == cArgs 258 && g_papszrtArgs == papszOrgArgs, 259 VERR_WRONG_ORDER); /* only init once! */ 260 return VINF_SUCCESS; 261 } 262 263 /* 264 * Convert the arguments. 265 */ 266 char **papszArgs = (char **)RTMemAllocZ((cArgs + 1) * sizeof(char *)); 267 if (!papszArgs) 268 return VERR_NO_MEMORY; 269 270 for (int i = 0; i < cArgs; i++) 271 { 272 int rc = RTStrCurrentCPToUtf8(&papszArgs[i], papszOrgArgs[i]); 273 if (RT_FAILURE(rc)) 274 { 275 while (i--) 276 RTStrFree(papszArgs[i]); 277 RTMemFree(papszArgs); 278 return rc; 279 } 280 } 281 papszArgs[cArgs] = NULL; 282 283 g_papszrtOrgArgs = papszOrgArgs; 284 g_papszrtArgs = papszArgs; 285 g_crtArgs = cArgs; 286 287 *ppapszArgs = papszArgs; 288 } 289 290 return VINF_SUCCESS; 291 } 292 293 224 294 #ifdef IPRT_USE_SIG_CHILD_DUMMY 225 295 /** … … 239 309 * rtR3Init worker. 240 310 */ 241 static int rtR3InitBody( bool fInitSUPLib, const char *pszProgramPath)311 static int rtR3InitBody(uint32_t fFlags, int cArgs, char ***papszArgs, const char *pszProgramPath) 242 312 { 243 313 /* … … 283 353 284 354 #if !defined(IN_GUEST) && !defined(RT_NO_GIP) 285 if (f InitSUPLib)355 if (fFlags & RTR3INIT_FLAGS_SUPLIB) 286 356 { 287 357 /* … … 295 365 296 366 /* 297 * The executable path, name and directory. 367 * The executable path, name and directory. Convert arguments. 298 368 */ 299 369 rc = rtR3InitProgramPath(pszProgramPath); 300 370 AssertLogRelMsgRCReturn(rc, ("Failed to get executable directory path, rc=%Rrc!\n", rc), rc); 301 371 372 rc = rtR3InitArgv(fFlags, cArgs, papszArgs); 373 AssertLogRelMsgRCReturn(rc, ("Failed to convert the arguments, rc=%Rrc!\n", rc), rc); 374 302 375 #if !defined(IN_GUEST) && !defined(RT_NO_GIP) 303 376 /* … … 305 378 * needs some time to update itself updating. 306 379 */ 307 if ( fInitSUPLib&& g_pSUPGlobalInfoPage)380 if ((fFlags & RTR3INIT_FLAGS_SUPLIB) && g_pSUPGlobalInfoPage) 308 381 { 309 382 RTThreadSleep(20); … … 386 459 * 387 460 * @returns IPRT status code. 388 * @param fInitSUPLib Whether to call SUPR3Init. 389 * @param pszProgramPath The program path, NULL if not specified. 390 */ 391 static int rtR3Init(bool fInitSUPLib, const char *pszProgramPath) 461 * @param fFlags Flags, see RTR3INIT_XXX. 462 * @param cArgs Pointer to the argument count. 463 * @param ppapszArgs Pointer to the argument vector pointer. NULL 464 * allowed if @a cArgs is 0. 465 * @param pszProgramPath The program path. Pass NULL if we're to figure it 466 * out ourselves. 467 */ 468 static int rtR3Init(uint32_t fFlags, int cArgs, char ***papszArgs, const char *pszProgramPath) 392 469 { 393 470 /* no entry log flow, because prefixes and thread may freak out. */ 471 Assert(!(fFlags & ~(RTR3INIT_FLAGS_DLL | RTR3INIT_FLAGS_SUPLIB))); 472 Assert(!(fFlags & RTR3INIT_FLAGS_DLL) || cArgs == 0); 394 473 395 474 /* 396 475 * Do reference counting, only initialize the first time around. 397 476 * 398 * We are ASSUMING that nobody will be able to race RTR3Init calls when the477 * We are ASSUMING that nobody will be able to race RTR3Init* calls when the 399 478 * first one, the real init, is running (second assertion). 400 479 */ … … 405 484 Assert(!g_fInitializing); 406 485 #if !defined(IN_GUEST) && !defined(RT_NO_GIP) 407 if (f InitSUPLib)486 if (fFlags & RTR3INIT_FLAGS_SUPLIB) 408 487 SUPR3Init(NULL); 409 488 #endif 410 489 if (!pszProgramPath) 411 490 return VINF_SUCCESS; 412 return rtR3InitProgramPath(pszProgramPath); 491 492 int rc = rtR3InitProgramPath(pszProgramPath); 493 if (RT_SUCCESS(rc)) 494 rc = rtR3InitArgv(fFlags, cArgs, papszArgs); 495 return rc; 413 496 } 414 497 ASMAtomicWriteBool(&g_fInitializing, true); … … 417 500 * Do the initialization. 418 501 */ 419 int rc = rtR3InitBody(f InitSUPLib, pszProgramPath);502 int rc = rtR3InitBody(fFlags, cArgs, papszArgs, pszProgramPath); 420 503 if (RT_FAILURE(rc)) 421 504 { … … 427 510 428 511 /* success */ 429 LogFlow((" RTR3Init: returns VINF_SUCCESS\n"));512 LogFlow(("rtR3Init: returns VINF_SUCCESS\n")); 430 513 ASMAtomicWriteBool(&g_fInitializing, false); 431 514 return VINF_SUCCESS; … … 433 516 434 517 435 RTR3DECL(int) RTR3Init(void) 436 { 437 return rtR3Init(false /* fInitSUPLib */, NULL); 438 } 439 440 441 RTR3DECL(int) RTR3InitEx(uint32_t iVersion, const char *pszProgramPath, bool fInitSUPLib) 442 { 443 AssertReturn(iVersion == 0, VERR_NOT_SUPPORTED); 444 return rtR3Init(fInitSUPLib, pszProgramPath); 445 } 446 447 448 RTR3DECL(int) RTR3InitWithProgramPath(const char *pszProgramPath) 449 { 450 return rtR3Init(false /* fInitSUPLib */, pszProgramPath); 451 } 452 453 454 RTR3DECL(int) RTR3InitAndSUPLib(void) 455 { 456 return rtR3Init(true /* fInitSUPLib */, NULL /* pszProgramPath */); 457 } 458 459 460 RTR3DECL(int) RTR3InitAndSUPLibWithProgramPath(const char *pszProgramPath) 461 { 462 return rtR3Init(true /* fInitSUPLib */, pszProgramPath); 518 RTR3DECL(int) RTR3InitExe(int cArgs, char ***papszArgs, uint32_t fFlags) 519 { 520 Assert(!(fFlags & RTR3INIT_FLAGS_DLL)); 521 return rtR3Init(fFlags, cArgs, papszArgs, NULL); 522 } 523 524 525 RTR3DECL(int) RTR3InitExeNoArguments(uint32_t fFlags) 526 { 527 Assert(!(fFlags & RTR3INIT_FLAGS_DLL)); 528 return rtR3Init(fFlags, 0, NULL, NULL); 529 } 530 531 532 RTR3DECL(int) RTR3InitDll(uint32_t fFlags) 533 { 534 Assert(!(fFlags & RTR3INIT_FLAGS_DLL)); 535 return rtR3Init(fFlags | RTR3INIT_FLAGS_DLL, 0, NULL, NULL); 536 } 537 538 539 RTR3DECL(int) RTR3InitEx(uint32_t iVersion, uint32_t fFlags, int cArgs, char ***papszArgs, const char *pszProgramPath) 540 { 541 AssertReturn(iVersion == RTR3INIT_VER_CUR, VERR_NOT_SUPPORTED); 542 return rtR3Init(fFlags, cArgs, papszArgs, pszProgramPath); 463 543 } 464 544 -
trunk/src/VBox/Runtime/r3/test.cpp
r33540 r38636 371 371 RTR3DECL(RTEXITCODE) RTTestInitAndCreate(const char *pszTest, PRTTEST phTest) 372 372 { 373 int rc = RTR3Init ();373 int rc = RTR3InitExeNoArguments(0); 374 374 if (RT_FAILURE(rc)) 375 375 { 376 RTStrmPrintf(g_pStdErr, "%s: fatal error: RTR3Init failed with rc=%Rrc\n", pszTest, rc);376 RTStrmPrintf(g_pStdErr, "%s: fatal error: RTR3InitExeNoArguments failed with rc=%Rrc\n", pszTest, rc); 377 377 return RTEXITCODE_INIT; 378 378 } -
trunk/src/VBox/Runtime/testcase/tstDir-2.cpp
r28800 r38636 33 33 { 34 34 int rcRet = 0; 35 RTR3Init ();35 RTR3InitExe(argc, &argv, 0); 36 36 37 37 /* -
trunk/src/VBox/Runtime/testcase/tstDir-3.cpp
r33464 r38636 80 80 int rc; 81 81 unsigned cMatch; 82 RTR3Init ();82 RTR3InitExe(argc, &argv, 0); 83 83 84 84 const char *pszTestDir = "."; -
trunk/src/VBox/Runtime/testcase/tstDir.cpp
r28800 r38636 35 35 { 36 36 int rcRet = 0; 37 RTR3Init ();37 RTR3InitExe(argc, &argv, 0); 38 38 39 39 /* -
trunk/src/VBox/Runtime/testcase/tstEnv.cpp
r28800 r38636 37 37 int main() 38 38 { 39 RTR3Init ();39 RTR3InitExeNoArguments(0); 40 40 RTPrintf("tstEnv: TESTING...\n"); 41 41 -
trunk/src/VBox/Runtime/testcase/tstErrUnique.cpp
r28800 r38636 63 63 { 64 64 int cErrors = 0; 65 RTR3Init ();65 RTR3InitExeNoArguments(0); 66 66 RTPrintf("tstErrUnique: TESTING\n"); 67 67 -
trunk/src/VBox/Runtime/testcase/tstFile.cpp
r28800 r38636 40 40 int cErrors = 0; 41 41 RTPrintf("tstFile: TESTING\n"); 42 RTR3Init ();42 RTR3InitExeNoArguments(0); 43 43 44 44 RTFILE File; -
trunk/src/VBox/Runtime/testcase/tstFileLock.cpp
r28800 r38636 48 48 int main() 49 49 { 50 RTR3Init ();50 RTR3InitExeNoArguments(0); 51 51 RTPrintf("tstFileLock: TESTING\n"); 52 52 -
trunk/src/VBox/Runtime/testcase/tstHandleTable.cpp
r28800 r38636 449 449 * Init the runtime and parse the arguments. 450 450 */ 451 RTR3Init ();451 RTR3InitExe(argc, &argv, 0); 452 452 453 453 static RTGETOPTDEF const s_aOptions[] = -
trunk/src/VBox/Runtime/testcase/tstLdr-2.cpp
r28800 r38636 173 173 int main(int argc, char **argv) 174 174 { 175 RTR3Init ();175 RTR3InitExe(argc, &argv, 0); 176 176 177 177 int rcRet = 0; -
trunk/src/VBox/Runtime/testcase/tstLdr-3.cpp
r32878 r38636 166 166 int main(int argc, char **argv) 167 167 { 168 RTR3Init ();168 RTR3InitExe(argc, &argv, 0); 169 169 170 170 int rcRet = 0; -
trunk/src/VBox/Runtime/testcase/tstLdr-4.cpp
r33269 r38636 217 217 { 218 218 int cErrors = 0; 219 RTR3Init ();219 RTR3InitExe(argc, &argv, 0); 220 220 221 221 /* -
trunk/src/VBox/Runtime/testcase/tstLdr.cpp
r33540 r38636 316 316 int main(int argc, char **argv) 317 317 { 318 RTR3Init ();318 RTR3InitExe(argc, &argv, 0); 319 319 320 320 int rcRet = 0; -
trunk/src/VBox/Runtime/testcase/tstLdrLoad.cpp
r28800 r38636 31 31 #include <iprt/err.h> 32 32 33 int main(int argc, c onst char * const*argv)33 int main(int argc, char **argv) 34 34 { 35 35 int rcRet = 0; 36 RTR3Init ();36 RTR3InitExe(argc, &argv, 0); 37 37 38 38 /* -
trunk/src/VBox/Runtime/testcase/tstLog.cpp
r28800 r38636 36 36 int main() 37 37 { 38 RTR3Init ();38 RTR3InitExeNoArguments(0); 39 39 printf("tstLog: Requires manual inspection of the log output!\n"); 40 40 RTLogPrintf("%%Rrc %d: %Rrc\n", VERR_INVALID_PARAMETER, VERR_INVALID_PARAMETER); -
trunk/src/VBox/Runtime/testcase/tstMemAutoPtr.cpp
r36529 r38636 125 125 int main() 126 126 { 127 RTR3Init ();127 RTR3InitExeNoArguments(0); 128 128 RTPrintf("tstMemAutoPtr: TESTING...\n"); 129 129 -
trunk/src/VBox/Runtime/testcase/tstMove.cpp
r28800 r38636 55 55 int main(int argc, char **argv) 56 56 { 57 RTR3Init ();57 RTR3InitExe(argc, &argv, 0); 58 58 59 59 /* -
trunk/src/VBox/Runtime/testcase/tstMp-1.cpp
r33814 r38636 44 44 int main() 45 45 { 46 RTR3Init ();46 RTR3InitExeNoArguments(0); 47 47 RTPrintf("tstMp-1: TESTING...\n"); 48 48 -
trunk/src/VBox/Runtime/testcase/tstNoCrt-1.cpp
r30320 r38636 119 119 * Prologue. 120 120 */ 121 RTR3Init ();121 RTR3InitExeNoArguments(0); 122 122 RTPrintf("tstNoCrt-1: TESTING...\n"); 123 123 -
trunk/src/VBox/Runtime/testcase/tstOnce.cpp
r28800 r38636 105 105 int main() 106 106 { 107 RTR3Init ();107 RTR3InitExeNoArguments(0); 108 108 109 109 /* -
trunk/src/VBox/Runtime/testcase/tstPrfRT.cpp
r29250 r38636 101 101 unsigned i; 102 102 103 RTR3Init ();103 RTR3InitExeNoArguments(0); 104 104 RTPrintf("tstPrfRT: TESTING...\n"); 105 105 -
trunk/src/VBox/Runtime/testcase/tstRTDigest.cpp
r33806 r38636 63 63 int main(int argc, char **argv) 64 64 { 65 RTR3Init ();65 RTR3InitExe(argc, &argv, 0); 66 66 67 67 enum -
trunk/src/VBox/Runtime/testcase/tstRTFsQueries.cpp
r30365 r38636 36 36 int main(int argc, char **argv) 37 37 { 38 RTR3Init ();38 RTR3InitExe(argc, &argv, 0); 39 39 40 40 /* -
trunk/src/VBox/Runtime/testcase/tstRTMemEf.cpp
r36580 r38636 60 60 int main() 61 61 { 62 RTR3Init ();62 RTR3InitExeNoArguments(0); 63 63 RTPrintf("tstRTMemEf: TESTING...\n"); 64 64 -
trunk/src/VBox/Runtime/testcase/tstRTPipe.cpp
r33806 r38636 51 51 static RTEXITCODE tstRTPipe5Child(const char *pszPipe) 52 52 { 53 int rc = RTR3Init ();53 int rc = RTR3InitExeNoArguments(0); 54 54 if (RT_FAILURE(rc)) 55 55 return RTMsgInitFailure(rc); … … 128 128 static RTEXITCODE tstRTPipe4Child(const char *pszPipe) 129 129 { 130 int rc = RTR3Init ();130 int rc = RTR3InitExeNoArguments(0); 131 131 if (RT_FAILURE(rc)) 132 132 return RTMsgInitFailure(rc); -
trunk/src/VBox/Runtime/testcase/tstRTProcCreateEx.cpp
r33806 r38636 74 74 static int tstRTCreateProcEx5Child(int argc, char **argv) 75 75 { 76 int rc = RTR3Init ();76 int rc = RTR3InitExeNoArguments(0); 77 77 if (rc) 78 78 return RTMsgInitFailure(rc); … … 173 173 static int tstRTCreateProcEx4Child(int argc, char **argv) 174 174 { 175 int rc = RTR3Init ();175 int rc = RTR3InitExeNoArguments(0); 176 176 if (rc) 177 177 return RTMsgInitFailure(rc); … … 208 208 static int tstRTCreateProcEx3Child(void) 209 209 { 210 int rc = RTR3Init ();210 int rc = RTR3InitExeNoArguments(0); 211 211 if (rc) 212 212 return RTMsgInitFailure(rc); … … 278 278 static int tstRTCreateProcEx2Child(void) 279 279 { 280 int rc = RTR3Init ();280 int rc = RTR3InitExeNoArguments(0); 281 281 if (rc) 282 282 return RTMsgInitFailure(rc); … … 345 345 static int tstRTCreateProcEx1Child(void) 346 346 { 347 int rc = RTR3Init ();347 int rc = RTR3InitExeNoArguments(0); 348 348 if (rc) 349 349 return RTMsgInitFailure(rc); -
trunk/src/VBox/Runtime/testcase/tstRTProcIsRunningByName.cpp
r33806 r38636 42 42 int cErrors = 0; 43 43 44 RTR3Init ();44 RTR3InitExe(argc, &argv, 0); 45 45 RTPrintf("tstRTPRocIsRunningByName: TESTING...\n"); 46 46 -
trunk/src/VBox/Runtime/testcase/tstRTProcWait.cpp
r28800 r38636 59 59 int main(int argc, char **argv) 60 60 { 61 RTR3Init ();61 RTR3InitExe(argc, &argv, 0); 62 62 if (argc == 2 && !strcmp(argv[1], "child")) 63 63 return 42; -
trunk/src/VBox/Runtime/testcase/tstRand.cpp
r28800 r38636 354 354 int main() 355 355 { 356 RTR3Init ();356 RTR3InitExeNoArguments(0); 357 357 RTPrintf("tstRand: TESTING...\n"); 358 358 -
trunk/src/VBox/Runtime/testcase/tstSemMutex.cpp
r28800 r38636 204 204 int main(int argc, char **argv) 205 205 { 206 int rc = RTR3Init ();207 if (RT_FAILURE(rc)) 208 { 209 RTPrintf("tstSemMutex: RTR3Init failed (rc=%Rrc)\n", rc);206 int rc = RTR3InitExe(argc, &argv, 0); 207 if (RT_FAILURE(rc)) 208 { 209 RTPrintf("tstSemMutex: RTR3InitExe failed (rc=%Rrc)\n", rc); 210 210 return 1; 211 211 } -
trunk/src/VBox/Runtime/testcase/tstSemPingPong.cpp
r28800 r38636 86 86 int main() 87 87 { 88 RTR3Init ();88 RTR3InitExeNoArguments(0); 89 89 90 90 /* -
trunk/src/VBox/Runtime/testcase/tstStrToNum.cpp
r28800 r38636 92 92 int main() 93 93 { 94 RTR3Init ();94 RTR3InitExeNoArguments(0); 95 95 96 96 int cErrors = 0; -
trunk/src/VBox/Runtime/testcase/tstTSC.cpp
r33540 r38636 406 406 int main(int argc, char **argv) 407 407 { 408 RTR3Init ();408 RTR3InitExe(argc, &argv, 0); 409 409 410 410 /* -
trunk/src/VBox/Runtime/testcase/tstThread-1.cpp
r28800 r38636 48 48 49 49 50 int main(int argc, c onst char * const*argv)50 int main(int argc, char **argv) 51 51 { 52 RTR3Init ();52 RTR3InitExe(argc, &argv, 0); 53 53 54 54 /* -
trunk/src/VBox/Runtime/testcase/tstTime-2.cpp
r29279 r38636 40 40 unsigned cErrors = 0; 41 41 int i; 42 RTR3Init AndSUPLib();42 RTR3InitExeNoArguments(RTR3INIT_FLAGS_SUPLIB); 43 43 RTPrintf("tstTime-2: TESTING...\n"); 44 44 -
trunk/src/VBox/Runtime/testcase/tstTime-3.cpp
r28800 r38636 69 69 int main(int argc, char **argv) 70 70 { 71 RTR3Init AndSUPLib();71 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB); 72 72 73 73 if (argc <= 1) -
trunk/src/VBox/Runtime/testcase/tstTime-4.cpp
r28800 r38636 40 40 unsigned cErrors = 0; 41 41 42 RTR3Init AndSUPLib();42 RTR3InitExeNoArguments(RTR3INIT_FLAGS_SUPLIB); 43 43 RTPrintf("tstTime-4: TESTING...\n"); 44 44 -
trunk/src/VBox/Runtime/testcase/tstTime.cpp
r29279 r38636 39 39 unsigned cErrors = 0; 40 40 int i; 41 RTR3InitAndSUPLib(); 41 42 RTR3InitExeNoArguments(RTR3INIT_FLAGS_SUPLIB); 42 43 RTPrintf("tstTime: TESTING...\n"); 43 44 -
trunk/src/VBox/Runtime/testcase/tstTimer.cpp
r32431 r38636 32 32 #include <iprt/thread.h> 33 33 #include <iprt/initterm.h> 34 #include <iprt/message.h> 34 35 #include <iprt/stream.h> 35 36 #include <iprt/err.h> … … 76 77 */ 77 78 unsigned cErrors = 0; 78 int rc = RTR3Init ();79 int rc = RTR3InitExeNoArguments(0); 79 80 if (RT_FAILURE(rc)) 80 { 81 RTPrintf("tstTimer: RTR3Init() -> %d\n", rc); 82 return 1; 83 } 81 return RTMsgInitFailure(rc); 84 82 85 83 /* -
trunk/src/VBox/Runtime/testcase/tstTimerLR.cpp
r28800 r38636 32 32 #include <iprt/thread.h> 33 33 #include <iprt/initterm.h> 34 #include <iprt/message.h> 34 35 #include <iprt/stream.h> 35 36 #include <iprt/err.h> … … 68 69 */ 69 70 unsigned cErrors = 0; 70 int rc = RTR3Init ();71 int rc = RTR3InitExeNoArguments(0); 71 72 if (RT_FAILURE(rc)) 72 { 73 RTPrintf("tstTimer: RTR3Init() -> %d\n", rc); 74 return 1; 75 } 73 return RTMsgInitFailure(rc); 76 74 77 75 /* -
trunk/src/VBox/Runtime/tools/RTGzip.cpp
r34464 r38636 208 208 int main(int argc, char **argv) 209 209 { 210 int rc = RTR3Init ();210 int rc = RTR3InitExe(argc, &argv, 0); 211 211 if (RT_FAILURE(rc)) 212 212 return RTMsgInitFailure(rc); -
trunk/src/VBox/Runtime/tools/RTLdrFlt.cpp
r38619 r38636 117 117 int main(int argc, char **argv) 118 118 { 119 int rc = RTR3Init ();119 int rc = RTR3InitExe(argc, &argv, 0); 120 120 if (RT_FAILURE(rc)) 121 121 return RTMsgInitFailure(rc); -
trunk/src/VBox/Runtime/tools/RTManifest.cpp
r34466 r38636 277 277 int main(int argc, char **argv) 278 278 { 279 int rc = RTR3Init ();279 int rc = RTR3InitExe(argc, &argv, 0); 280 280 if (RT_FAILURE(rc)) 281 281 return RTMsgInitFailure(rc); -
trunk/src/VBox/Runtime/tools/RTTar.cpp
r34464 r38636 37 37 int main(int argc, char **argv) 38 38 { 39 int rc = RTR3Init ();39 int rc = RTR3InitExe(argc, &argv, 0); 40 40 if (RT_FAILURE(rc)) 41 41 return RTMsgInitFailure(rc); -
trunk/src/VBox/Storage/testcase/tstVD-2.cpp
r38469 r38636 230 230 int rc; 231 231 232 RTR3Init ();232 RTR3InitExe(argc, &argv, 0); 233 233 RTPrintf("tstVD-2: TESTING...\n"); 234 234 -
trunk/src/VBox/Storage/testcase/tstVD.cpp
r38469 r38636 843 843 int main(int argc, char *argv[]) 844 844 { 845 RTR3Init ();845 RTR3InitExe(argc, &argv, 0); 846 846 int rc; 847 847 -
trunk/src/VBox/Storage/testcase/tstVDCopy.cpp
r38469 r38636 51 51 int rc; 52 52 53 RTR3Init ();53 RTR3InitExe(argc, &argv, 0); 54 54 55 55 if (argc != 3) -
trunk/src/VBox/Storage/testcase/tstVDIo.cpp
r38621 r38636 3197 3197 int main(int argc, char *argv[]) 3198 3198 { 3199 RTR3Init ();3199 RTR3InitExe(argc, &argv, 0); 3200 3200 int rc; 3201 3201 RTGETOPTUNION ValueUnion; -
trunk/src/VBox/Storage/testcase/tstVDShareable.cpp
r38469 r38636 119 119 int main(int argc, char *argv[]) 120 120 { 121 RTR3Init ();121 RTR3InitExe(argc, &argv, 0); 122 122 int rc; 123 123 -
trunk/src/VBox/Storage/testcase/tstVDSnap.cpp
r38469 r38636 378 378 int main(int argc, char *argv[]) 379 379 { 380 RTR3Init ();380 RTR3InitExe(argc, &argv, 0); 381 381 int rc; 382 382 VDSNAPTEST Test; -
trunk/src/VBox/Storage/testcase/vbox-img.cpp
r38469 r38636 1026 1026 int main(int argc, char *argv[]) 1027 1027 { 1028 RTR3Init();1029 int rc;1030 1028 int exitcode = 0; 1029 1030 int rc = RTR3InitExe(argc, &argv, 0); 1031 if (RT_FAILURE(rc)) 1032 return RTMsgInitFailure(rc); 1031 1033 1032 1034 g_pszProgName = RTPathFilename(argv[0]); -
trunk/src/VBox/Storage/testcase/vditool.cpp
r38352 r38636 379 379 putenv((char*)"VBOX_LOG_FLAGS="); 380 380 381 RTR3Init ();381 RTR3InitExe(argc, &argv, 0); 382 382 RTPrintf("vditool -- for internal use only!\n" 383 383 "Copyright (c) 2009 Oracle Corporation\n\n"); -
trunk/src/VBox/VMM/testcase/tstAnimate.cpp
r38324 r38636 615 615 int rcRet = 1; 616 616 int rc; 617 RTR3Init AndSUPLib();617 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB); 618 618 619 619 /* -
trunk/src/VBox/VMM/testcase/tstCFGM.cpp
r35346 r38636 39 39 * Init runtime. 40 40 */ 41 RTR3Init AndSUPLib();41 RTR3InitExeNoArguments(RTR3INIT_FLAGS_SUPLIB); 42 42 43 43 /* -
trunk/src/VBox/VMM/testcase/tstCompiler.cpp
r37955 r38636 225 225 int main() 226 226 { 227 int rc = RTR3Init ();227 int rc = RTR3InitExeNoArguments(0); 228 228 if (RT_FAILURE(rc)) 229 229 return RTMsgInitFailure(rc); -
trunk/src/VBox/VMM/testcase/tstCompressionBenchmark.cpp
r33550 r38636 233 233 int main(int argc, char **argv) 234 234 { 235 RTR3Init ();235 RTR3InitExe(argc, &argv, 0); 236 236 237 237 /* -
trunk/src/VBox/VMM/testcase/tstGlobalConfig.cpp
r35346 r38636 41 41 int main(int argc, char **argv) 42 42 { 43 RTR3Init ();43 RTR3InitExe(argc, &argv, 0); 44 44 45 45 /* -
trunk/src/VBox/VMM/testcase/tstInstrEmul.cpp
r35346 r38636 36 36 int rcRet = 0; /* error count. */ 37 37 38 RTR3Init ();38 RTR3InitExe(argc, &argv, 0); 39 39 RTPrintf("tstInstrEmul: TESTING...\n"); 40 40 -
trunk/src/VBox/VMM/testcase/tstMMHyperHeap.cpp
r35346 r38636 44 44 * Init runtime. 45 45 */ 46 RTR3Init ();46 RTR3InitExe(argc, &argv, 0); 47 47 48 48 /* -
trunk/src/VBox/VMM/testcase/tstMicro.cpp
r35346 r38636 339 339 int rcRet = 0; /* error count. */ 340 340 341 RTR3Init AndSUPLib();341 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB); 342 342 343 343 /* -
trunk/src/VBox/VMM/testcase/tstPDMAsyncCompletion.cpp
r35346 r38636 75 75 { 76 76 int rcRet = 0; /* error count */ 77 int rc = VINF_SUCCESS;78 77 PPDMASYNCCOMPLETIONENDPOINT pEndpointSrc, pEndpointDst; 79 78 80 RTR3Init AndSUPLib();79 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB); 81 80 82 81 if (argc != 3) … … 87 86 88 87 PVM pVM; 89 rc = VMR3Create(1, NULL, NULL, NULL, NULL, NULL, &pVM);88 int rc = VMR3Create(1, NULL, NULL, NULL, NULL, NULL, &pVM); 90 89 if (RT_SUCCESS(rc)) 91 90 { -
trunk/src/VBox/VMM/testcase/tstPDMAsyncCompletionStress.cpp
r35346 r38636 570 570 { 571 571 int rcRet = 0; /* error count */ 572 int rc = VINF_SUCCESS; 573 574 RTR3InitAndSUPLib(); 572 573 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB); 575 574 576 575 PVM pVM; 577 rc = VMR3Create(1, NULL, NULL, NULL, NULL, NULL, &pVM);576 int rc = VMR3Create(1, NULL, NULL, NULL, NULL, NULL, &pVM); 578 577 if (RT_SUCCESS(rc)) 579 578 { -
trunk/src/VBox/VMM/testcase/tstSSM.cpp
r35346 r38636 680 680 * Init runtime and static data. 681 681 */ 682 RTR3Init AndSUPLib();682 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB); 683 683 RTPrintf("tstSSM: TESTING...\n"); 684 684 initBigMem(); -
trunk/src/VBox/VMM/testcase/tstVMM-HwAccm.cpp
r35346 r38636 65 65 int rcRet = 0; /* error count. */ 66 66 67 RTR3Init AndSUPLib();67 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB); 68 68 69 69 /* -
trunk/src/VBox/VMM/testcase/tstVMM.cpp
r35346 r38636 31 31 #include <iprt/getopt.h> 32 32 #include <iprt/initterm.h> 33 #include <iprt/message.h> 33 34 #include <iprt/semaphore.h> 34 35 #include <iprt/stream.h> … … 180 181 * Init runtime and the test environment. 181 182 */ 182 int rc = RTR3Init AndSUPLib();183 int rc = RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB); 183 184 if (RT_FAILURE(rc)) 184 { 185 RTPrintf("tstVMM: RTR3InitAndSUPLib failed: %Rrc\n", rc); 186 return 1; 187 } 185 return RTMsgInitFailure(rc); 188 186 RTTEST hTest; 189 187 rc = RTTestCreate("tstVMM", &hTest); -
trunk/src/VBox/VMM/testcase/tstVMMFork.cpp
r35346 r38636 49 49 * Initialize the runtime. 50 50 */ 51 RTR3Init AndSUPLib();51 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB); 52 52 53 53 #ifndef AUTO_TEST_ARGS -
trunk/src/VBox/VMM/testcase/tstVMMR0CallHost-1.cpp
r35346 r38636 145 145 RTTEST hTest; 146 146 int rc; 147 if ( RT_FAILURE(rc = RTR3Init ())147 if ( RT_FAILURE(rc = RTR3InitExeNoArguments(0)) 148 148 || RT_FAILURE(rc = RTTestCreate("tstVMMR0CallHost-1", &hTest))) 149 149 { -
trunk/src/VBox/VMM/testcase/tstVMREQ.cpp
r35346 r38636 208 208 int main(int argc, char **argv) 209 209 { 210 RTR3Init AndSUPLib();210 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB); 211 211 RTPrintf(TESTCASE ": TESTING...\n"); 212 212 -
trunk/src/bldprogs/scm.cpp
r35404 r38636 3973 3973 int main(int argc, char **argv) 3974 3974 { 3975 int rc = RTR3Init ();3975 int rc = RTR3InitExe(argc, &argv, 0); 3976 3976 if (RT_FAILURE(rc)) 3977 3977 return 1; -
trunk/src/libs/xpcom18a4/ipc/ipcd/daemon/src/ipcdUnix.cpp
r33044 r38636 474 474 #ifdef VBOX 475 475 /* Set up the runtime without loading the support driver. */ 476 RTR3Init ();476 RTR3InitExe(argc, &argv, 0); 477 477 #endif 478 478 -
trunk/src/libs/xpcom18a4/ipc/ipcd/shared/src/ipcLog.cpp
r11822 r38636 52 52 #undef PAGE_SIZE 53 53 #endif 54 #include <iprt/initterm.h> // for RTR3Init 54 #include <iprt/initterm.h> // for RTR3InitDll 55 55 #else // !VBOX 56 56 PRBool ipcLogEnabled = PR_FALSE; … … 122 122 #ifdef VBOX 123 123 // initialize VBox Runtime 124 RTR3Init ();124 RTR3InitDll(0); 125 125 126 126 PL_strncpyz(ipcLogPrefix, prefix, sizeof(ipcLogPrefix)); -
trunk/src/libs/xpcom18a4/java/src/nsJavaInterfaces.cpp
r31598 r38636 147 147 { 148 148 #if defined(VBOX_PATH_APP_PRIVATE_ARCH) && defined(VBOX_PATH_SHARED_LIBS) 149 rv = RTR3Init ();150 #else 151 const char * home = nsnull;149 rv = RTR3InitDll(0); 150 #else 151 const char *pszHome = nsnull; 152 152 const char *jhome = nsnull; 153 153 jstring path = nsnull; … … 164 164 { 165 165 path = (jstring)env->CallObjectMethod(aVBoxBinDirectory, getPathMID); 166 home = jhome = env->GetStringUTFChars(path, nsnull);167 } 168 169 if ( home == nsnull)170 home = getenv("VBOX_PROGRAM_PATH");171 172 if ( home) {173 size_t len = strlen(home);174 char * exepath = (char *)alloca(len+ 32);175 memcpy( exepath, home, len);176 memcpy( exepath + len, "/javafake", sizeof("/javafake"));177 rv = RTR3Init WithProgramPath(exepath);166 pszHome = jhome = env->GetStringUTFChars(path, nsnull); 167 } 168 169 if (pszHome == nsnull) 170 pszHome = getenv("VBOX_PROGRAM_PATH"); 171 172 if (pszHome) { 173 size_t cchHome = strlen(pszHome); 174 char *pszExePath = (char *)alloca(cchHome + 32); 175 memcpy(pszExePath, pszHome, cchHome); 176 memcpy(pszExePath + cchHome, "/javafake", sizeof("/javafake")); 177 rv = RTR3InitEx(RTR3INIT_VER_CUR, RTR3INIT_FLAGS_DLL, 0, NULL, pszExePath); 178 178 } else { 179 rv = RTR3Init ();179 rv = RTR3InitDll(0); 180 180 } 181 181 -
trunk/src/libs/xpcom18a4/java/tools/genifaces/GenerateJavaInterfaces.cpp
r29179 r38636 874 874 #ifdef VBOX 875 875 #if defined(VBOX_PATH_APP_PRIVATE_ARCH) && defined(VBOX_PATH_SHARED_LIBS) 876 rv = RTR3Init();876 rv = RTR3InitExe(argc, &argv, 0); 877 877 #else 878 const char *home = getenv("VBOX_PROGRAM_PATH");879 if (home) {880 size_t len = strlen(home);881 char *exepath = (char *)alloca(len+ 32);882 memcpy(exepath, home, len);883 memcpy(exepath + len, "/pythonfake", sizeof("/pythonfake"));884 rv = RTR3InitWithProgramPath(exepath);885 886 rv = RTR3Init();887 878 const char *pszHome = getenv("VBOX_PROGRAM_PATH"); 879 if (pszHome) { 880 size_t cchHome = strlen(pszHome); 881 char *pszExePath = (char *)alloca(cchHome + 32); 882 memcpy(pszExePath, pszHome, cchHome); 883 memcpy(pszExePath + cchHome, "/pythonfake", sizeof("/pythonfake")); 884 rc = RTR3InitEx(RTR3INIT_VER_CUR, 0, argc, &argv, pszExePath); 885 } else { 886 rv = RTR3InitExe(argc, &argv, 0); 887 } 888 888 #endif 889 889 #endif -
trunk/src/libs/xpcom18a4/nsprpub/pr/src/io/prlog.c
r31259 r38636 51 51 52 52 #if defined(VBOX) && defined(DEBUG) 53 # include <iprt/initterm.h> /* for RTR3Init */53 # include <iprt/initterm.h> /* for RTR3InitDll */ 54 54 # include <iprt/log.h> 55 55 #endif … … 424 424 if (strcmp(file, "IPRT") == 0) { 425 425 /* initialize VBox Runtime */ 426 RTR3Init ();426 RTR3InitDll(0); 427 427 newLogFile = IPRT_DEBUG_FILE; 428 428 } … … 465 465 if (strcmp(file, "IPRT") == 0) { 466 466 /* initialize VBox Runtime */ 467 RTR3Init ();467 RTR3InitDll(0); 468 468 logFile = IPRT_DEBUG_FILE; 469 469 return PR_TRUE; -
trunk/src/libs/xpcom18a4/nsprpub/pr/src/misc/prinit.c
r32971 r38636 177 177 _pr_initialized = PR_TRUE; 178 178 #ifdef VBOX_USE_IPRT_IN_NSPR 179 RTR3Init ();179 RTR3InitDll(0); 180 180 #endif 181 181 #ifdef _PR_ZONE_ALLOCATOR -
trunk/src/libs/xpcom18a4/python/src/module/_xpcom.cpp
r31604 r38636 781 781 782 782 #if defined(VBOX_PATH_APP_PRIVATE_ARCH) && defined(VBOX_PATH_SHARED_LIBS) 783 rc = RTR3Init ();783 rc = RTR3InitDll(0); 784 784 #else 785 785 const char *home = getenv("VBOX_PROGRAM_PATH"); … … 789 789 memcpy(exepath, home, len); 790 790 memcpy(exepath + len, "/pythonfake", sizeof("/pythonfake")); 791 rc = RTR3Init WithProgramPath(exepath);791 rc = RTR3InitEx(RTR3INIT_VER_CUR, RTR3INIT_FLAGS_DLL, 0, NULL, exepath); 792 792 } else { 793 rc = RTR3Init ();793 rc = RTR3InitDll(0); 794 794 } 795 795 #endif -
trunk/src/testcase/tstRunTestcases.cpp
r33540 r38636 284 284 int main(int argc, char **argv) 285 285 { 286 RTR3Init ();286 RTR3InitExe(argc, &argv, 0); 287 287 288 288 if (argc == 1)
Note:
See TracChangeset
for help on using the changeset viewer.