Changeset 92613 in vbox
- Timestamp:
- Nov 26, 2021 9:53:47 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 35 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/sup.h
r92556 r92613 653 653 654 654 /** @internal */ 655 SUPDECL(PSUPGIPCPU) SUPGetGipCpuPtrForAsyncMode(PSUPGLOBALINFOPAGE pGip); 655 656 SUPDECL(uint64_t) SUPGetCpuHzFromGipForAsyncMode(PSUPGLOBALINFOPAGE pGip); 656 657 SUPDECL(bool) SUPIsTscFreqCompatible(uint64_t uCpuHz, uint64_t *puGipCpuHz, bool fRelax); 657 658 SUPDECL(bool) SUPIsTscFreqCompatibleEx(uint64_t uBaseCpuHz, uint64_t uCpuHz, bool fRelax); 658 659 660 661 /** 662 * Gets CPU entry of the calling CPU. 663 * 664 * @returns Pointer to the CPU entry on success, NULL on failure. 665 * @param pGip The GIP pointer. 666 */ 667 DECLINLINE(PSUPGIPCPU) SUPGetGipCpuPtr(PSUPGLOBALINFOPAGE pGip) 668 { 669 if (RT_LIKELY( pGip 670 && pGip->u32Magic == SUPGLOBALINFOPAGE_MAGIC)) 671 { 672 switch (pGip->u32Mode) 673 { 674 case SUPGIPMODE_INVARIANT_TSC: 675 case SUPGIPMODE_SYNC_TSC: 676 return &pGip->aCPUs[0]; 677 case SUPGIPMODE_ASYNC_TSC: 678 return SUPGetGipCpuPtrForAsyncMode(pGip); 679 default: break; /* shut up gcc */ 680 } 681 } 682 AssertFailed(); 683 return NULL; 684 } 659 685 660 686 /** … … 1202 1228 * @param pszProgName The program name. This will be used to figure out which 1203 1229 * DLL/SO/DYLIB to load and execute. 1204 * @param fFlags Flags.1230 * @param fFlags SUPSECMAIN_FLAGS_XXX. 1205 1231 * @param argc The argument count. 1206 1232 * @param argv The argument vector. … … 1209 1235 DECLHIDDEN(int) SUPR3HardenedMain(const char *pszProgName, uint32_t fFlags, int argc, char **argv, char **envp); 1210 1236 1211 /** @name SUP R3HardenedMain flags.1237 /** @name SUPSECMAIN_FLAGS_XXX - SUPR3HardenedMain flags. 1212 1238 * @{ */ 1213 1239 /** Don't open the device. (Intended for VirtualBox without -startvm.) */ 1214 #define SUPSECMAIN_FLAGS_DONT_OPEN_DEV RT_BIT_32(0)1240 #define SUPSECMAIN_FLAGS_DONT_OPEN_DEV RT_BIT_32(0) 1215 1241 /** The hardened DLL has a "TrustedError" function (see FNSUPTRUSTEDERROR). */ 1216 #define SUPSECMAIN_FLAGS_TRUSTED_ERROR RT_BIT_32(1)1242 #define SUPSECMAIN_FLAGS_TRUSTED_ERROR RT_BIT_32(1) 1217 1243 /** Hack for making VirtualBoxVM use VirtualBox.dylib on Mac OS X. 1218 1244 * @note Not used since 6.0 */ 1219 #define SUPSECMAIN_FLAGS_OSX_VM_APP RT_BIT_32(2) 1245 #define SUPSECMAIN_FLAGS_OSX_VM_APP RT_BIT_32(2) 1246 /** The first process. 1247 * @internal */ 1248 #define SUPSECMAIN_FLAGS_FIRST_PROCESS RT_BIT_32(3) 1220 1249 /** Program binary location mask. */ 1221 #define SUPSECMAIN_FLAGS_LOC_MASK UINT32_C(0x00000030)1250 #define SUPSECMAIN_FLAGS_LOC_MASK UINT32_C(0x00000030) 1222 1251 /** Default binary location is the application binary directory. Does 1223 1252 * not need to be given explicitly (it's 0). */ 1224 #define SUPSECMAIN_FLAGS_LOC_APP_BIN UINT32_C(0x00000000)1253 #define SUPSECMAIN_FLAGS_LOC_APP_BIN UINT32_C(0x00000000) 1225 1254 /** The binary is located in the testcase directory instead of the 1226 1255 * default application binary directory. */ 1227 #define SUPSECMAIN_FLAGS_LOC_TESTCASE UINT32_C(0x00000010)1256 #define SUPSECMAIN_FLAGS_LOC_TESTCASE UINT32_C(0x00000010) 1228 1257 /** The binary is located in a nested application bundle under Resources/ in the 1229 1258 * main Mac OS X application (think Resources/VirtualBoxVM.app). */ 1230 #define SUPSECMAIN_FLAGS_LOC_OSX_HLP_APP UINT32_C(0x00000020) 1231 /** The first process. 1232 * @internal */ 1233 #define SUPSECMAIN_FLAGS_FIRST_PROCESS UINT32_C(0x00000100) 1259 #define SUPSECMAIN_FLAGS_LOC_OSX_HLP_APP UINT32_C(0x00000020) 1260 /** Driverless IEM-only mode is allowed, so don't fail fatally just because 1261 * the VBox support driver is unavailable. */ 1262 #define SUPSECMAIN_FLAGS_DRIVERLESS_IEM_ALLOWED RT_BIT_32(8) 1263 #ifdef VBOX_WITH_DRIVERLESS_NEM_FALLBACK 1264 /** Driverless NEM is a fallback posibility, so don't fail fatally just 1265 * because the VBox support driver is unavailable. 1266 * This may imply checking NEM requirements, depending on the host. 1267 * @note Not supported on Windows. */ 1268 # define SUPSECMAIN_FLAGS_DRIVERLESS_NEM_FALLBACK RT_BIT_32(9) 1269 #endif 1270 1234 1271 /** @} */ 1235 1272 … … 1252 1289 * 1253 1290 * @returns VBox status code. 1254 * @param f Unrestricted The desired access.1291 * @param fFlags SUPR3INIT_F_XXX 1255 1292 * @param ppSession Where to store the session handle. Defaults to NULL. 1256 1293 */ 1257 SUPR3DECL(int) SUPR3InitEx(bool fUnrestricted, PSUPDRVSESSION *ppSession); 1294 SUPR3DECL(int) SUPR3InitEx(uint32_t fFlags, PSUPDRVSESSION *ppSession); 1295 /** @name SUPR3INIT_F_XXX - Flags for SUPR3InitEx 1296 * @{ */ 1297 /** Unrestricted access. */ 1298 #define SUPR3INIT_F_UNRESTRICTED RT_BIT_32(0) 1299 /** Limited access (for Main). */ 1300 #define SUPR3INIT_F_LIMITED RT_BIT_32(1) 1301 /** Allow driverless IEM mode if the VBox support driver is unavailable. 1302 * @see SUPSECMAIN_FLAGS_DRIVERLESS_IEM_ALLOWED */ 1303 #define SUPR3INIT_F_DRIVERLESS_IEM_ALLOWED RT_BIT_32(2) 1304 #ifdef VBOX_WITH_DRIVERLESS_NEM_FALLBACK 1305 /** Allow driverless NEM mode as fallback if the VBox support driver is unavailable. 1306 * @see SUPSECMAIN_FLAGS_DRIVERLESS_NEM_FALLBACK */ 1307 # define SUPR3INIT_F_DRIVERLESS_NEM_FALLBACK RT_BIT_32(3) 1308 #endif 1309 /** @} */ 1258 1310 1259 1311 /** -
trunk/include/iprt/initterm.h
r92562 r92613 51 51 #ifdef IN_RING3 52 52 53 /** @name RTR3Init flags (RTR3INIT_XXX). 53 /** @name RTR3INIT_FLAGS_XXX - RTR3Init* flags. 54 * @see RTR3InitExeNoArguments, RTR3InitExe, RTR3InitDll, RTR3InitEx 54 55 * @{ */ 55 /** Try initialize SUPLib. */56 # define RTR3INIT_FLAGS_SUPLIB RT_BIT(0)57 56 /** Initializing IPRT from a DLL. */ 58 # define RTR3INIT_FLAGS_DLL RT_BIT(1) 59 /** We are sharing a process space, so we need to behave. */ 60 # define RTR3INIT_FLAGS_UNOBTRUSIVE RT_BIT(2) 57 # define RTR3INIT_FLAGS_DLL RT_BIT(0) 61 58 /** The caller ensures that the argument vector is UTF-8. */ 62 # define RTR3INIT_FLAGS_UTF8_ARGV RT_BIT(3)59 # define RTR3INIT_FLAGS_UTF8_ARGV RT_BIT(1) 63 60 /** Indicates that this is a standalone application without any additional 64 61 * shared libraries in the application directory. Mainly windows loader mess. */ 65 # define RTR3INIT_FLAGS_STANDALONE_APP RT_BIT(4) 62 # define RTR3INIT_FLAGS_STANDALONE_APP RT_BIT(2) 63 /** We are sharing a process space, so we need to behave. */ 64 # define RTR3INIT_FLAGS_UNOBTRUSIVE RT_BIT(3) 65 66 /** Initialize SUPLib (must not fail). */ 67 # define RTR3INIT_FLAGS_SUPLIB RT_BIT(16) 68 /** Try initialize SUPLib and ignore failures. */ 69 # define RTR3INIT_FLAGS_TRY_SUPLIB RT_BIT(17) 70 /** Shift count for passing thru SUPR3INIT_F_XXX flags. */ 71 # define RTR3INIT_FLAGS_SUPLIB_SHIFT 18 72 /** The mask covering the passthru SUPR3INIT_F_XXX flags. */ 73 # define RTR3INIT_FLAGS_SUPLIB_MASK UINT32_C(0xfffc0000) 74 75 /** Valid flag mask. */ 76 # define RTR3INIT_FLAGS_VALID_MASK UINT32_C(0xffff000f) 66 77 /** @} */ 67 78 … … 69 80 * @{ */ 70 81 /** Version 1. */ 71 # define RTR3INIT_VER_1 UINT32_C(1) 82 # define RTR3INIT_VER_1 UINT32_C(1) 83 /** Version 2 - new flags, rearranged a bit. */ 84 # define RTR3INIT_VER_2 UINT32_C(2) 72 85 /** The current version. */ 73 # define RTR3INIT_VER_CUR RTR3INIT_VER_186 # define RTR3INIT_VER_CUR RTR3INIT_VER_2 74 87 /** @} */ 75 88 … … 78 91 * 79 92 * @returns iprt status code. 80 * @param fFlags Flags, see RTR3INIT_ XXX.93 * @param fFlags Flags, see RTR3INIT_FLAGS_XXX. 81 94 */ 82 95 RTR3DECL(int) RTR3InitExeNoArguments(uint32_t fFlags); … … 88 101 * @param cArgs Pointer to the argument count. 89 102 * @param ppapszArgs Pointer to the argument vector pointer. 90 * @param fFlags Flags, see RTR3INIT_ XXX.103 * @param fFlags Flags, see RTR3INIT_FLAGS_XXX. 91 104 */ 92 105 RTR3DECL(int) RTR3InitExe(int cArgs, char ***ppapszArgs, uint32_t fFlags); … … 96 109 * 97 110 * @returns iprt status code. 98 * @param fFlags Flags, see RTR3INIT_ XXX.111 * @param fFlags Flags, see RTR3INIT_FLAGS_XXX. 99 112 */ 100 113 RTR3DECL(int) RTR3InitDll(uint32_t fFlags); … … 107 120 * @returns IPRT status code. 108 121 * @param iVersion The interface version. Must be 0 atm. 109 * @param fFlags Flags, see RTR3INIT_ XXX.122 * @param fFlags Flags, see RTR3INIT_FLAGS_XXX. 110 123 * @param cArgs Pointer to the argument count. 111 124 * @param ppapszArgs Pointer to the argument vector pointer. NULL -
trunk/src/VBox/Debugger/testcase/tstVBoxDbg.cpp
r90520 r92613 39 39 int cErrors = 0; /* error count. */ 40 40 41 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_ SUPLIB);41 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_TRY_SUPLIB); 42 42 RTPrintf(TESTCASE ": TESTING...\n"); 43 43 -
trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
r92067 r92613 1582 1582 int main(int argc, char **argv, char **envp) 1583 1583 { 1584 // initialize VBox Runtime 1585 int rc = RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB); 1586 if (RT_FAILURE(rc)) 1587 { 1588 RTPrintf("VBoxHeadless: Runtime Error:\n" 1589 " %Rrc -- %Rrf\n", rc, rc); 1590 switch (rc) 1591 { 1592 case VERR_VM_DRIVER_NOT_INSTALLED: 1593 RTPrintf("Cannot access the kernel driver. Make sure the kernel module has been \n" 1594 "loaded successfully. Aborting ...\n"); 1595 break; 1596 default: 1597 break; 1598 } 1599 return 1; 1600 } 1601 1602 return TrustedMain(argc, argv, envp); 1584 int rc = RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_TRY_SUPLIB); 1585 if (RT_SUCCESS(rc)) 1586 return TrustedMain(argc, argv, envp); 1587 RTPrintf("VBoxHeadless: Runtime initialization failed: %Rrc - %Rrf\n", rc, rc); 1588 return RTEXITCODE_FAILURE; 1603 1589 } 1604 1590 #endif /* !VBOX_WITH_HARDENING */ -
trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadlessHardened.cpp
r82968 r92613 21 21 int main(int argc, char **argv, char **envp) 22 22 { 23 #ifdef VBOX_WITH_DRIVERLESS_NEM_FALLBACK 24 return SUPR3HardenedMain("VBoxHeadless", SUPSECMAIN_FLAGS_DRIVERLESS_NEM_FALLBACK, argc, argv, envp); 25 #else 23 26 return SUPR3HardenedMain("VBoxHeadless", 0, argc, argv, envp); 27 #endif 24 28 } 25 29 -
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r91363 r92613 3220 3220 * Before we do *anything*, we initialize the runtime. 3221 3221 */ 3222 int rc = RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_ SUPLIB);3222 int rc = RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_TRY_SUPLIB); 3223 3223 if (RT_FAILURE(rc)) 3224 3224 return RTMsgInitFailure(rc); -
trunk/src/VBox/Frontends/VirtualBox/src/hardenedmain.cpp
r83033 r92613 42 42 int main(int argc, char **argv, char **envp) 43 43 { 44 /* First check whether we're about to start a VM: */ 45 bool fStartVM = false; 46 /* In separate process: */ 47 bool fSeparateProcess = false; 48 for (int i = 1; i < argc && !(fStartVM && fSeparateProcess); ++i) 44 /* 45 * Do partial option parsing to see if we're starting a VM and how we're 46 * going about that. 47 * 48 * Note! This must must match the corresponding parsing in main.cpp and 49 * UICommon.cpp exactly, otherwise there will be weird error messages. 50 * 51 * Note! ASSUMES that argv is in an ASCII compatible codeset. 52 */ 53 unsigned cOptionsLeft = 3; 54 bool fStartVM = false; 55 bool fSeparateProcess = false; 56 bool fExecuteAllInIem = false; 57 for (int i = 1; i < argc && cOptionsLeft > 0; ++i) 49 58 { 50 /* NOTE: the check here must match the corresponding check for the51 * options to start a VM in main.cpp and UICommon.cpp exactly,52 * otherwise there will be weird error messages. */53 59 if ( !MyStrCmp(argv[i], "--startvm") 54 60 || !MyStrCmp(argv[i], "-startvm")) 55 61 { 62 cOptionsLeft -= fStartVM == false; 56 63 fStartVM = true; 64 i++; 57 65 } 58 66 else if ( !MyStrCmp(argv[i], "--separate") 59 67 || !MyStrCmp(argv[i], "-separate")) 60 68 { 69 cOptionsLeft -= fSeparateProcess == false; 61 70 fSeparateProcess = true; 71 } 72 else if (!MyStrCmp(argv[i], "--execute-all-in-iem")) 73 { 74 cOptionsLeft -= fExecuteAllInIem == false; 75 fExecuteAllInIem = true; 62 76 } 63 77 } 64 78 65 uint32_t fFlags = (fStartVM && !fSeparateProcess) ? 0 : SUPSECMAIN_FLAGS_DONT_OPEN_DEV; 79 /* 80 * Convert the command line options to SUPSECMAIN_FLAGS_XXX flags 81 * and call the hardened main code. 82 */ 83 uint32_t fFlags = SUPSECMAIN_FLAGS_TRUSTED_ERROR; 66 84 #ifdef RT_OS_DARWIN 67 85 fFlags |= SUPSECMAIN_FLAGS_LOC_OSX_HLP_APP; 68 86 #endif 87 if (!fStartVM || fSeparateProcess) 88 fFlags |= SUPSECMAIN_FLAGS_DONT_OPEN_DEV; 89 else 90 { 91 if (fExecuteAllInIem) 92 fFlags |= SUPSECMAIN_FLAGS_DRIVERLESS_IEM_ALLOWED; 93 #ifdef VBOX_WITH_DRIVERLESS_NEM_FALLBACK 94 else 95 fFlags |= SUPSECMAIN_FLAGS_DRIVERLESS_NEM_FALLBACK; 96 #endif 97 } 69 98 70 return SUPR3HardenedMain("VirtualBoxVM", 71 fFlags | SUPSECMAIN_FLAGS_TRUSTED_ERROR, 72 argc, argv, envp); 99 return SUPR3HardenedMain("VirtualBoxVM", fFlags, argc, argv, envp); 73 100 } 74 101 -
trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
r90520 r92613 39 39 #include <VBox/err.h> 40 40 #include <VBox/version.h> 41 #ifdef VBOX_WITH_HARDENING 42 # include <VBox/sup.h> 43 #endif 41 #include <VBox/sup.h> 44 42 #if !defined(VBOX_WITH_HARDENING) || !defined(VBOX_RUNTIME_UI) 45 43 # include <iprt/initterm.h> … … 651 649 # endif /* VBOX_WS_X11 */ 652 650 651 /* 652 * Determin the IPRT/SUPLib initialization flags if runtime UI process. 653 * Only initialize SUPLib if about to start a VM in this process. 654 * 655 * Note! This must must match the corresponding parsing in hardenedmain.cpp 656 * and UICommon.cpp exactly, otherwise there will be weird error messages. 657 */ 658 /** @todo r=bird: We should consider just postponing this stuff till VM 659 * creation, it shouldn't make too much of a difference GIP-wise. */ 660 uint32_t fFlags = 0; 661 # ifdef VBOX_RUNTIME_UI 662 unsigned cOptionsLeft = 3; 663 bool fStartVM = false; 664 bool fSeparateProcess = false; 665 bool fExecuteAllInIem = false; 666 for (int i = 1; i < argc && cOptionsLeft > 0; ++i) 667 { 668 if ( !strcmp(argv[i], "--startvm") 669 || !strcmp(argv[i], "-startvm")) 670 { 671 cOptionsLeft -= fStartVM == false; 672 fStartVM = true; 673 i++; 674 } 675 else if ( !strcmp(argv[i], "--separate") 676 || !strcmp(argv[i], "-separate")) 677 { 678 cOptionsLeft -= fSeparateProcess == false; 679 fSeparateProcess = true; 680 } 681 else if (!strcmp(argv[i], "--execute-all-in-iem")) 682 { 683 cOptionsLeft -= fExecuteAllInIem == false; 684 fExecuteAllInIem = true; 685 } 686 } 687 if (fStartVM && !fSeparateProcess) 688 { 689 fFlags |= RTR3INIT_FLAGS_TRY_SUPLIB; 690 if (fExecuteAllInIem) 691 fFlags |= SUPR3INIT_F_DRIVERLESS_IEM_ALLOWED << RTR3INIT_FLAGS_SUPLIB_SHIFT; 692 } 693 # endif 694 653 695 /* Initialize VBox Runtime: */ 654 # ifdef VBOX_RUNTIME_UI 655 /* Initialize the SUPLib as well only if we are really about to start a VM. 656 * Don't do this if we are only starting the selector window or a separate VM process. */ 657 bool fStartVM = false; 658 bool fSeparateProcess = false; 659 for (int i = 1; i < argc && !(fStartVM && fSeparateProcess); ++i) 660 { 661 /* NOTE: the check here must match the corresponding check for the 662 * options to start a VM in hardenedmain.cpp and UICommon.cpp exactly, 663 * otherwise there will be weird error messages. */ 664 if ( !::strcmp(argv[i], "--startvm") 665 || !::strcmp(argv[i], "-startvm")) 666 fStartVM = true; 667 else if ( !::strcmp(argv[i], "--separate") 668 || !::strcmp(argv[i], "-separate")) 669 fSeparateProcess = true; 670 } 671 672 uint32_t fFlags = fStartVM && !fSeparateProcess ? RTR3INIT_FLAGS_SUPLIB : 0; 673 # ifdef RT_OS_DARWIN 696 # if defined(RT_OS_DARWIN) && defined(VBOX_RUNTIME_UI) 674 697 int rc = initIprtForDarwinHelperApp(argc, &argv, fFlags); 675 698 # else 676 699 int rc = RTR3InitExe(argc, &argv, fFlags); 677 700 # endif 678 # else679 int rc = RTR3InitExe(argc, &argv, 0 /*fFlags*/);680 # endif681 682 /* Initialization failed: */683 701 if (RT_FAILURE(rc)) 684 702 { 703 /* Initialization failed: */ 704 685 705 /* We have to create QApplication anyway 686 706 * just to show the only one error-message: */ -
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r92556 r92613 210 210 211 211 212 SUPR3DECL(int) SUPR3InitEx( bool fUnrestricted, PSUPDRVSESSION *ppSession)212 SUPR3DECL(int) SUPR3InitEx(uint32_t fFlags, PSUPDRVSESSION *ppSession) 213 213 { 214 214 /* … … 230 230 if (g_cInits++ > 0) 231 231 { 232 if ( fUnrestricted&& !g_supLibData.fUnrestricted)232 if ((fFlags & SUPR3INIT_F_UNRESTRICTED) && !g_supLibData.fUnrestricted) 233 233 { 234 234 g_cInits--; … … 262 262 */ 263 263 SUPINITOP enmWhat = kSupInitOp_Driver; 264 int rc = suplibOsInit(&g_supLibData, g_fPreInited, f Unrestricted, &enmWhat, NULL);264 int rc = suplibOsInit(&g_supLibData, g_fPreInited, fFlags, &enmWhat, NULL); 265 265 if (RT_SUCCESS(rc)) 266 266 { … … 398 398 SUPR3DECL(int) SUPR3Init(PSUPDRVSESSION *ppSession) 399 399 { 400 return SUPR3InitEx( true, ppSession);400 return SUPR3InitEx(SUPR3INIT_F_UNRESTRICTED, ppSession); 401 401 } 402 402 -
trunk/src/VBox/HostDrivers/Support/SUPLibAll.cpp
r87702 r92613 328 328 329 329 /** 330 * SLow path in SUPGetGipCpuPtr, don't call directly. 331 * 332 * @returns Pointer to the CPU entry for the caller, NULL on failure. 333 * @param pGip The GIP. 334 */ 335 SUPDECL(PSUPGIPCPU) SUPGetGipCpuPtrForAsyncMode(PSUPGLOBALINFOPAGE pGip) 336 { 337 uint16_t iGipCpu = supGetGipCpuIndex(pGip); 338 if (RT_LIKELY(iGipCpu < pGip->cCpus)) 339 return &pGip->aCPUs[iGipCpu]; 340 AssertFailed(); 341 return NULL; 342 } 343 344 345 /** 330 346 * Slow path in SUPGetCpuHzFromGip, don't call directly. 331 347 * -
trunk/src/VBox/HostDrivers/Support/SUPLibInternal.h
r92556 r92613 360 360 DECLHIDDEN(int) suplibOsInstall(void); 361 361 DECLHIDDEN(int) suplibOsUninstall(void); 362 DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo);362 DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, uint32_t fFlags, SUPINITOP *penmWhat, PRTERRINFO pErrInfo); 363 363 DECLHIDDEN(int) suplibOsTerm(PSUPLIBDATA pThis); 364 364 DECLHIDDEN(int) suplibOsHardenedVerifyInit(void); -
trunk/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp
r87593 r92613 550 550 /** The program name. */ 551 551 static const char *g_pszSupLibHardenedProgName; 552 /** The flags passed to SUPR3HardenedMain . */552 /** The flags passed to SUPR3HardenedMain - SUPSECMAIN_FLAGS_XXX. */ 553 553 static uint32_t g_fSupHardenedMain; 554 554 … … 1864 1864 RTERRINFOSTATIC ErrInfo; 1865 1865 SUPINITOP enmWhat = kSupInitOp_Driver; 1866 int rc = suplibOsInit(&g_SupPreInitData.Data, false /*fPreInit*/, true /*fUnrestricted*/, 1867 &enmWhat, RTErrInfoInitStatic(&ErrInfo)); 1866 uint32_t fFlags = SUPR3INIT_F_UNRESTRICTED; 1867 if (g_fSupHardenedMain & SUPSECMAIN_FLAGS_DRIVERLESS_IEM_ALLOWED) 1868 fFlags |= SUPR3INIT_F_DRIVERLESS_IEM_ALLOWED; 1869 #ifdef VBOX_WITH_DRIVERLESS_NEM_FALLBACK 1870 if (g_fSupHardenedMain & SUPSECMAIN_FLAGS_DRIVERLESS_NEM_FALLBACK) 1871 fFlags |= SUPR3INIT_F_DRIVERLESS_NEM_FALLBACK; 1872 #endif 1873 int rc = suplibOsInit(&g_SupPreInitData.Data, false /*fPreInit*/, fFlags, &enmWhat, RTErrInfoInitStatic(&ErrInfo)); 1868 1874 if (RT_SUCCESS(rc)) 1869 1875 return; … … 2334 2340 supR3HardenedFatalMsg("supR3HardenedMainInitRuntime", kSupInitOp_IPRT, rc, 2335 2341 "supR3PreInit failed with rc=%d", rc); 2342 2343 /* Get the executable path for the IPRT init on linux if /proc/self/exe isn't accessible. */ 2336 2344 const char *pszExePath = NULL; 2337 2345 #ifdef RT_OS_LINUX … … 2339 2347 pszExePath = g_szSupLibHardenedExePath; 2340 2348 #endif 2341 rc = pfnRTInitEx(RTR3INIT_VER_1, 2342 fFlags & SUPSECMAIN_FLAGS_DONT_OPEN_DEV ? 0 : RTR3INIT_FLAGS_SUPLIB, 2349 2350 /* Assemble the IPRT init flags. We could probably just pass RTR3INIT_FLAGS_TRY_SUPLIB 2351 here and be done with it, but it's not too much hazzle to convert fFlags 1:1. */ 2352 uint32_t fRtInit = 0; 2353 if (!(fFlags & SUPSECMAIN_FLAGS_DONT_OPEN_DEV)) 2354 { 2355 if (fFlags & SUPSECMAIN_FLAGS_DRIVERLESS_IEM_ALLOWED) 2356 fRtInit |= (SUPR3INIT_F_DRIVERLESS_IEM_ALLOWED << RTR3INIT_FLAGS_SUPLIB_SHIFT) | RTR3INIT_FLAGS_TRY_SUPLIB; 2357 #ifdef VBOX_WITH_DRIVERLESS_NEM_FALLBACK 2358 if (fFlags & SUPSECMAIN_FLAGS_DRIVERLESS_NEM_FALLBACK) 2359 fRtInit |= (SUPR3INIT_F_DRIVERLESS_NEM_FALLBACK << RTR3INIT_FLAGS_SUPLIB_SHIFT) | RTR3INIT_FLAGS_TRY_SUPLIB; 2360 #endif 2361 if (!(fRtInit & RTR3INIT_FLAGS_TRY_SUPLIB)) 2362 fRtInit |= RTR3INIT_FLAGS_SUPLIB; 2363 } 2364 2365 /* Now do the IPRT init. */ 2366 rc = pfnRTInitEx(RTR3INIT_VER_CUR, fFlags & SUPSECMAIN_FLAGS_DONT_OPEN_DEV ? 0 : RTR3INIT_FLAGS_SUPLIB, 2343 2367 0 /*cArgs*/, NULL /*papszArgs*/, pszExePath); 2344 2368 if (RT_FAILURE(rc)) 2345 2369 supR3HardenedFatalMsg("supR3HardenedMainInitRuntime", kSupInitOp_IPRT, rc, 2346 "RTR3InitEx failed with rc=%d ", rc);2370 "RTR3InitEx failed with rc=%d (fRtFlags=%#x)", rc, fRtInit); 2347 2371 2348 2372 #if defined(RT_OS_WINDOWS) -
trunk/src/VBox/HostDrivers/Support/darwin/SUPLib-darwin.cpp
r92556 r92613 187 187 188 188 189 DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo)189 DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, uint32_t fFlags, SUPINITOP *penmWhat, PRTERRINFO pErrInfo) 190 190 { 191 191 RT_NOREF(penmWhat, pErrInfo); … … 204 204 if (RT_SUCCESS(rc)) 205 205 { 206 rc = suplibDarwinOpenDevice(pThis, fUnrestricted);206 rc = suplibDarwinOpenDevice(pThis, RT_BOOL(fFlags & SUPR3INIT_F_UNRESTRICTED)); 207 207 if (RT_FAILURE(rc)) 208 208 { -
trunk/src/VBox/HostDrivers/Support/freebsd/SUPLib-freebsd.cpp
r92556 r92613 68 68 69 69 70 DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo)70 DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, uint32_t fFlags, SUPINITOP *penmWhat, PRTERRINFO pErrInfo) 71 71 { 72 72 /* … … 79 79 * Try open the BSD device. 80 80 */ 81 int hDevice = open(fUnrestricted ? DEVICE_NAME_SYS : DEVICE_NAME_USR, O_RDWR, 0); 81 const char * const *pszDeviceNm = fFlags & SUPR3INIT_F_UNRESTRICTED ? DEVICE_NAME_SYS : DEVICE_NAME_USR; 82 int hDevice = open(pszDeviceNm, O_RDWR, 0); 82 83 if (hDevice < 0) 83 84 { … … 91 92 default: rc = VERR_VM_DRIVER_OPEN_ERROR; break; 92 93 } 93 LogRel(("Failed to open \"%s\", errno=%d, rc=%Rrc\n", fUnrestricted ? DEVICE_NAME_SYS : DEVICE_NAME_USR, errno, rc));94 LogRel(("Failed to open \"%s\", errno=%d, rc=%Rrc\n", pszDeviceNm, errno, rc)); 94 95 return rc; 95 96 } … … 115 116 */ 116 117 pThis->hDevice = hDevice; 117 pThis->fUnrestricted = fUnrestricted;118 pThis->fUnrestricted = RT_BOOL(fFlags & SUPR3INIT_F_UNRESTRICTED); 118 119 return VINF_SUCCESS; 119 120 } -
trunk/src/VBox/HostDrivers/Support/linux/SUPLib-linux.cpp
r92557 r92613 76 76 77 77 78 DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo)78 DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, uint32_t fFlags, SUPINITOP *penmWhat, PRTERRINFO pErrInfo) 79 79 { 80 80 RT_NOREF2(penmWhat, pErrInfo); … … 99 99 * Try open the device. 100 100 */ 101 const char *pszDeviceNm = f Unrestricted? DEVICE_NAME_SYS : DEVICE_NAME_USR;101 const char *pszDeviceNm = fFlags & SUPR3INIT_F_UNRESTRICTED ? DEVICE_NAME_SYS : DEVICE_NAME_USR; 102 102 int hDevice = open(pszDeviceNm, O_RDWR, 0); 103 103 if (hDevice < 0) … … 141 141 */ 142 142 pThis->hDevice = hDevice; 143 pThis->fUnrestricted = fUnrestricted;143 pThis->fUnrestricted = RT_BOOL(fFlags & SUPR3INIT_F_UNRESTRICTED); 144 144 return VINF_SUCCESS; 145 145 } -
trunk/src/VBox/HostDrivers/Support/os2/SUPLib-os2.cpp
r92556 r92613 65 65 66 66 67 DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo)67 DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, uint32_t fFlags, SUPINITOP *penmWhat, PRTERRINFO pErrInfo) 68 68 { 69 69 /* … … 101 101 pThis->hDevice = hDevice; 102 102 pThis->fUnrestricted = true; 103 RT_NOREF(fFlags); 103 104 return VINF_SUCCESS; 104 105 } -
trunk/src/VBox/HostDrivers/Support/solaris/SUPLib-solaris.cpp
r92556 r92613 79 79 80 80 81 DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo)81 DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, uint32_t fFlags, SUPINITOP *penmWhat, PRTERRINFO pErrInfo) 82 82 { 83 83 /* … … 113 113 const char *pszDeviceNm; 114 114 if (getzoneid() == GLOBAL_ZONEID) 115 pszDeviceNm = f Unrestricted? DEVICE_NAME_SYS : DEVICE_NAME_USR;115 pszDeviceNm = fFlags & SUPR3INIT_F_UNRESTRICTED ? DEVICE_NAME_SYS : DEVICE_NAME_USR; 116 116 else 117 pszDeviceNm = f Unrestricted? DEVICE_NAME_SYS_ZONE : DEVICE_NAME_USR_ZONE;117 pszDeviceNm = fFlags & SUPR3INIT_F_UNRESTRICTED ? DEVICE_NAME_SYS_ZONE : DEVICE_NAME_USR_ZONE; 118 118 int hDevice = open(pszDeviceNm, O_RDWR, 0); 119 119 if (hDevice < 0) … … 149 149 150 150 pThis->hDevice = hDevice; 151 pThis->fUnrestricted = fUnrestricted;151 pThis->fUnrestricted = RT_BOOL(fFlags & SUPR3INIT_F_UNRESTRICTED); 152 152 return VINF_SUCCESS; 153 153 } -
trunk/src/VBox/HostDrivers/Support/testcase/SUPLoggerCtl.cpp
r82968 r92613 59 59 int main(int argc, char **argv) 60 60 { 61 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_ SUPLIB);61 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_TRY_SUPLIB); 62 62 63 63 /* … … 151 151 152 152 /* 153 * Do the requested job.153 * Make sure the support library is initialized. 154 154 */ 155 int rc ;156 switch (enmWhat)155 int rc = SUPR3Init(NULL /*ppSession*/); 156 if (RT_SUCCESS(rc)) 157 157 { 158 case kSupLoggerCtl_Set: 159 rc = SUPR3LoggerSettings(enmWhich, pszFlags, pszGroups, pszDest); 160 break; 161 case kSupLoggerCtl_Create: 162 rc = SUPR3LoggerCreate(enmWhich, pszFlags, pszGroups, pszDest); 163 break; 164 case kSupLoggerCtl_Destroy: 165 rc = SUPR3LoggerDestroy(enmWhich); 166 break; 167 default: 168 rc = VERR_INTERNAL_ERROR; 169 break; 158 /* 159 * Do the requested job. 160 */ 161 switch (enmWhat) 162 { 163 case kSupLoggerCtl_Set: 164 rc = SUPR3LoggerSettings(enmWhich, pszFlags, pszGroups, pszDest); 165 break; 166 case kSupLoggerCtl_Create: 167 rc = SUPR3LoggerCreate(enmWhich, pszFlags, pszGroups, pszDest); 168 break; 169 case kSupLoggerCtl_Destroy: 170 rc = SUPR3LoggerDestroy(enmWhich); 171 break; 172 default: 173 rc = VERR_INTERNAL_ERROR; 174 break; 175 } 176 if (RT_SUCCESS(rc)) 177 RTPrintf("SUPLoggerCtl: Success\n"); 178 else 179 RTStrmPrintf(g_pStdErr, "SUPLoggerCtl: error: rc=%Rrc\n", rc); 170 180 } 171 if (RT_SUCCESS(rc))172 RTPrintf("SUPLoggerCtl: Success\n");173 181 else 174 RTStrmPrintf(g_pStdErr, "SUP LoggerCtl: error: rc=%Rrc\n", rc);182 RTStrmPrintf(g_pStdErr, "SUPR3Init: error: rc=%Rrc\n", rc); 175 183 176 184 return RT_SUCCESS(rc) ? 0 : 1; -
trunk/src/VBox/HostDrivers/Support/testcase/tstPage.cpp
r92556 r92613 40 40 int cErrors = 0; 41 41 42 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_ SUPLIB);42 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_TRY_SUPLIB); 43 43 int rc = SUPR3Init(NULL); 44 44 cErrors += rc != 0; -
trunk/src/VBox/HostDrivers/Support/testcase/tstPin.cpp
r92556 r92613 46 46 RTHCPHYS HCPhys; 47 47 48 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_ SUPLIB);48 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_TRY_SUPLIB); 49 49 rc = SUPR3Init(NULL); 50 50 RTPrintf("SUPR3Init -> rc=%d\n", rc); -
trunk/src/VBox/HostDrivers/Support/testcase/tstSupSem-Zombie.cpp
r86397 r92613 95 95 * Init. 96 96 */ 97 int rc = RTR3InitExeNoArguments(RTR3INIT_FLAGS_ SUPLIB);97 int rc = RTR3InitExeNoArguments(RTR3INIT_FLAGS_TRY_SUPLIB); 98 98 if (RT_FAILURE(rc)) 99 99 { -
trunk/src/VBox/HostDrivers/Support/testcase/tstSupSem.cpp
r82968 r92613 80 80 * Init. 81 81 */ 82 int rc = RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_ SUPLIB);82 int rc = RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_TRY_SUPLIB); 83 83 if (RT_FAILURE(rc)) 84 84 return RTMsgInitFailure(rc); -
trunk/src/VBox/HostDrivers/Support/win/SUPLib-win.cpp
r92556 r92613 117 117 118 118 119 DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo)119 DECLHIDDEN(int) suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, uint32_t fFlags, SUPINITOP *penmWhat, PRTERRINFO pErrInfo) 120 120 { 121 121 /* … … 156 156 UNICODE_STRING NtName; 157 157 NtName.Buffer = (PWSTR)s_wszName; 158 NtName.Length = sizeof(s_wszName) - sizeof(WCHAR) * (f Unrestricted? 2 : 1);158 NtName.Length = sizeof(s_wszName) - sizeof(WCHAR) * (fFlags & SUPR3INIT_F_UNRESTRICTED ? 2 : 1); 159 159 NtName.MaximumLength = NtName.Length; 160 160 … … 183 183 */ 184 184 pThis->hDevice = hDevice; 185 pThis->fUnrestricted = fUnrestricted;185 pThis->fUnrestricted = RT_BOOL(fFlags & SUPR3INIT_F_UNRESTRICTED); 186 186 return VINF_SUCCESS; 187 187 } -
trunk/src/VBox/Main/src-server/HostImpl.cpp
r91503 r92613 1181 1181 { 1182 1182 /* Perhaps the driver is available now... */ 1183 int rc = SUPR3InitEx( false /*fUnrestricted*/, NULL);1183 int rc = SUPR3InitEx(SUPR3INIT_F_LIMITED, NULL); 1184 1184 if (RT_SUCCESS(rc)) 1185 1185 { -
trunk/src/VBox/NetworkServices/Dhcpd/VBoxNetDhcpd.cpp
r87745 r92613 776 776 VBoxNetDhcpd Dhcpd; 777 777 int rc = Dhcpd.main(argc, argv); 778 779 778 return RT_SUCCESS(rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 780 779 } … … 786 785 { 787 786 int rc = RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB); 788 if (RT_FAILURE(rc)) 789 return RTMsgInitFailure(rc); 790 791 return TrustedMain(argc, argv); 787 if (RT_SUCCESS(rc)) 788 return TrustedMain(argc, argv); 789 return RTMsgInitFailure(rc); 792 790 } 793 791 -
trunk/src/VBox/NetworkServices/NAT/VBoxNetLwipNAT.cpp
r91916 r92613 2199 2199 extern "C" DECLEXPORT(int) TrustedMain(int argc, char **argv, char **envp) 2200 2200 { 2201 int rc;2202 2203 2201 LogFlowFuncEnter(); 2204 2205 2202 NOREF(envp); 2206 2203 2207 2204 #ifdef RT_OS_WINDOWS 2208 WSADATA wsaData; 2209 int err; 2210 2211 err = WSAStartup(MAKEWORD(2,2), &wsaData); 2205 WSADATA WsaData = {0}; 2206 int err = WSAStartup(MAKEWORD(2,2), &WsaData); 2212 2207 if (err) 2213 2208 { … … 2226 2221 } 2227 2222 2228 rc = NAT.init();2223 int rc = NAT.init(); 2229 2224 if (RT_FAILURE(rc)) 2230 2225 return RTEXITCODE_INIT; … … 2242 2237 { 2243 2238 int rc = RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB); 2244 if (RT_FAILURE(rc)) 2245 return RTMsgInitFailure(rc); 2246 2247 return TrustedMain(argc, argv, envp); 2239 if (RT_SUCCESS(rc)) 2240 return TrustedMain(argc, argv, envp); 2241 return RTMsgInitFailure(rc); 2248 2242 } 2249 2243 -
trunk/src/VBox/Runtime/r3/init.cpp
r85124 r92613 437 437 * (improves accuracy for the first client). 438 438 */ 439 if (fFlags & RTR3INIT_FLAGS_SUPLIB) 440 { 441 rc = SUPR3Init(NULL); 442 AssertMsgRCReturn(rc, ("Failed to initialize the support library, rc=%Rrc!\n", rc), rc); 439 if (fFlags & (RTR3INIT_FLAGS_SUPLIB | RTR3INIT_FLAGS_TRY_SUPLIB)) 440 { 441 rc = SUPR3InitEx( fFlags >> RTR3INIT_FLAGS_SUPLIB_SHIFT 442 ? fFlags >> RTR3INIT_FLAGS_SUPLIB_SHIFT : SUPR3INIT_F_UNRESTRICTED, NULL /*ppSession*/); 443 AssertMsgReturn(RT_SUCCESS(rc) || (fFlags & RTR3INIT_FLAGS_TRY_SUPLIB), 444 ("Failed to initialize the support library, rc=%Rrc!\n", rc), rc); 443 445 } 444 446 #endif … … 452 454 #if !defined(IN_GUEST) && !defined(RT_NO_GIP) 453 455 /* 454 * The threading is initialized we can safely sleep a bit if GIP 455 * needs some time to update itself updating. 456 */ 457 if ((fFlags & RTR3INIT_FLAGS_SUPLIB) && g_pSUPGlobalInfoPage) 458 { 459 RTThreadSleep(20); 460 RTTimeNanoTS(); 456 * The threading is initialized, so we can safely sleep a bit if GIP 457 * needs some time to start updating itself. Currently limited to 458 * the first mapping of GIP (u32TransactionId <= 4), quite possible we 459 * could just ditch this now. 460 */ 461 /** @todo consider dropping this... */ 462 PSUPGLOBALINFOPAGE pGip; 463 if ( (fFlags & (RTR3INIT_FLAGS_SUPLIB | RTR3INIT_FLAGS_TRY_SUPLIB)) 464 && (pGip = g_pSUPGlobalInfoPage) != NULL 465 && pGip->u32Magic == SUPGLOBALINFOPAGE_MAGIC) 466 { 467 PSUPGIPCPU pGipCpu = SUPGetGipCpuPtr(pGip); 468 if ( pGipCpu 469 && pGipCpu->u32TransactionId <= 4) 470 { 471 RTThreadSleep(pGip->u32UpdateIntervalNS / RT_NS_1MS + 2); 472 RTTimeNanoTS(); 473 } 461 474 } 462 475 #endif … … 550 563 { 551 564 /* no entry log flow, because prefixes and thread may freak out. */ 552 Assert(!(fFlags & ~( RTR3INIT_FLAGS_DLL 553 | RTR3INIT_FLAGS_SUPLIB 554 | RTR3INIT_FLAGS_UNOBTRUSIVE 555 | RTR3INIT_FLAGS_UTF8_ARGV 556 | RTR3INIT_FLAGS_STANDALONE_APP))); 565 Assert(!(fFlags & ~RTR3INIT_FLAGS_VALID_MASK)); 557 566 Assert(!(fFlags & RTR3INIT_FLAGS_DLL) || cArgs == 0); 558 567 … … 568 577 AssertMsg(cUsers > 1, ("%d\n", cUsers)); 569 578 Assert(!g_fInitializing); 579 570 580 #if !defined(IN_GUEST) && !defined(RT_NO_GIP) 571 if (fFlags & RTR3INIT_FLAGS_SUPLIB) 581 /* Initialize the support library if requested. We've always ignored the 582 status code here for some reason, making the two flags same. */ 583 if (fFlags & (RTR3INIT_FLAGS_SUPLIB | RTR3INIT_FLAGS_TRY_SUPLIB)) 572 584 { 573 SUPR3Init(NULL); 574 g_fInitFlags |= RTR3INIT_FLAGS_SUPLIB; 585 SUPR3InitEx( fFlags >> RTR3INIT_FLAGS_SUPLIB_SHIFT 586 ? fFlags >> RTR3INIT_FLAGS_SUPLIB_SHIFT : SUPR3INIT_F_UNRESTRICTED, NULL /*ppSession*/); 587 g_fInitFlags |= fFlags & (RTR3INIT_FLAGS_SUPLIB | RTR3INIT_FLAGS_TRY_SUPLIB | RTR3INIT_FLAGS_SUPLIB_MASK); 575 588 } 576 589 #endif … … 595 608 return rc; 596 609 } 610 611 /* 612 * Do the initialization. 613 */ 597 614 ASMAtomicWriteBool(&g_fInitializing, true); 598 599 /*600 * Do the initialization.601 */602 615 int rc = rtR3InitBody(fFlags, cArgs, ppapszArgs, pszProgramPath); 616 ASMAtomicWriteBool(&g_fInitializing, false); 603 617 if (RT_FAILURE(rc)) 604 618 { 605 619 /* failure */ 606 ASMAtomicWriteBool(&g_fInitializing, false);607 620 ASMAtomicDecS32(&g_cUsers); 608 621 return rc; … … 611 624 /* success */ 612 625 LogFlow(("rtR3Init: returns VINF_SUCCESS\n")); 613 ASMAtomicWriteBool(&g_fInitializing, false);614 626 return VINF_SUCCESS; 615 627 } -
trunk/src/VBox/VMM/testcase/tstAnimate.cpp
r85121 r92613 621 621 int rcRet = 1; 622 622 int rc; 623 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_ SUPLIB);623 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_TRY_SUPLIB); 624 624 625 625 /* -
trunk/src/VBox/VMM/testcase/tstCFGM.cpp
r92556 r92613 153 153 */ 154 154 RTTEST hTest; 155 RTR3InitExeNoArguments(RTR3INIT_FLAGS_ SUPLIB);155 RTR3InitExeNoArguments(RTR3INIT_FLAGS_TRY_SUPLIB); 156 156 RTEXITCODE rcExit = RTTestInitAndCreate("tstCFGM", &hTest); 157 157 if (rcExit != RTEXITCODE_SUCCESS) -
trunk/src/VBox/VMM/testcase/tstPDMAsyncCompletion.cpp
r82968 r92613 83 83 PPDMASYNCCOMPLETIONENDPOINT pEndpointSrc, pEndpointDst; 84 84 85 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_ SUPLIB);85 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_TRY_SUPLIB); 86 86 87 87 if (argc != 3) -
trunk/src/VBox/VMM/testcase/tstPDMAsyncCompletionStress.cpp
r82968 r92613 578 578 int rcRet = 0; /* error count */ 579 579 580 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_ SUPLIB);580 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_TRY_SUPLIB); 581 581 582 582 PVM pVM; -
trunk/src/VBox/VMM/testcase/tstVMM-HM.cpp
r82968 r92613 67 67 int main(int argc, char **argv) 68 68 { 69 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_ SUPLIB);69 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_TRY_SUPLIB); 70 70 71 71 /* -
trunk/src/VBox/VMM/testcase/tstVMMFork.cpp
r82968 r92613 49 49 * Initialize the runtime. 50 50 */ 51 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_ SUPLIB);51 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_TRY_SUPLIB); 52 52 53 53 #ifndef AUTO_TEST_ARGS -
trunk/src/VBox/VMM/testcase/tstVMREQ.cpp
r82968 r92613 222 222 { 223 223 RT_NOREF1(envp); 224 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_ SUPLIB);224 RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_TRY_SUPLIB); 225 225 RTPrintf(TESTCASE ": TESTING...\n"); 226 226 RTStrmFlush(g_pStdOut); -
trunk/src/VBox/VMM/tools/VBoxVMMPreload.cpp
r82968 r92613 217 217 { 218 218 int rc = RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB); 219 if (RT_ FAILURE(rc))220 return RTMsgInitFailure(rc);221 return TrustedMain(argc, argv, envp);219 if (RT_SUCCESS(rc)) 220 return TrustedMain(argc, argv, envp); 221 return RTMsgInitFailure(rc); 222 222 } 223 223 #endif /* !VBOX_WITH_HARDENING */
Note:
See TracChangeset
for help on using the changeset viewer.