Changeset 92598 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Nov 25, 2021 2:32:22 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlSession.cpp
r86414 r92598 2403 2403 * Flags. 2404 2404 */ 2405 uint32_t constfProcCreate = RTPROC_FLAGS_PROFILE2405 uint32_t fProcCreate = RTPROC_FLAGS_PROFILE 2406 2406 #ifdef RT_OS_WINDOWS 2407 2408 2407 | RTPROC_FLAGS_SERVICE 2408 | RTPROC_FLAGS_HIDDEN 2409 2409 #endif 2410 2410 ; 2411 2411 2412 2412 /* … … 2448 2448 #endif 2449 2449 { 2450 RTENV hEnv = RTENV_DEFAULT; 2451 2452 /* If we start a guest session with RTPROC_FLAGS_PROFILE (the default), make sure 2453 * that we clone the initial session's environment and apply it as a change record to 2454 * the new session process. 2455 * 2456 * This is needed in order to make different locales on POSIX OSes work. See @bugref{10153}. */ 2457 if (fProcCreate & RTPROC_FLAGS_PROFILE) 2458 { 2459 int rc2 = RTEnvClone(&hEnv, RTENV_DEFAULT); 2460 if (RT_SUCCESS(rc2)) 2461 fProcCreate |= RTPROC_FLAGS_ENV_CHANGE_RECORD; 2462 else 2463 VGSvcError("Cloning environment block failed with %Rrc\n", rc2); 2464 /* Consider this as not being fatal. Just stay witht the default environment and hope for the best. */ 2465 } 2466 2450 2467 /* 2451 2468 * Finally, create the process. 2452 2469 */ 2453 rc = RTProcCreateEx(pszExeName, apszArgs, RTENV_DEFAULT, fProcCreate,2470 rc = RTProcCreateEx(pszExeName, apszArgs, hEnv, fProcCreate, 2454 2471 &hStdIn, &hStdOutAndErr, &hStdOutAndErr, 2455 2472 !fAnonymous ? pszUser : NULL, … … 2457 2474 NULL /*pvExtraData*/, 2458 2475 &pSessionThread->hProcess); 2476 2477 if (hEnv != RTENV_DEFAULT) 2478 { 2479 RTEnvDestroy(hEnv); 2480 hEnv = NIL_RTENV; 2481 } 2459 2482 } 2460 2483 #ifdef RT_OS_WINDOWS
Note:
See TracChangeset
for help on using the changeset viewer.