Changeset 57800 in vbox for trunk/src/VBox/Additions/common/VBoxService
- Timestamp:
- Sep 17, 2015 9:04:31 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlSession.cpp
r57759 r57800 1956 1956 #ifdef RT_OS_WINDOWS 1957 1957 /* Make sure to also load the profile data on a Windows guest. */ 1958 | RTPROC_FLAGS_PROFILE /** @todo Not implemented for non-Windows yet. */ 1958 | RTPROC_FLAGS_PROFILE /** @todo Not implemented for non-Windows yet. */ 1959 | RTPROC_FLAGS_OVERWRITE_WITH_PROFILE 1959 1960 #endif 1960 1961 | RTPROC_FLAGS_HIDDEN; /** @todo More flags from startup info? */ 1962 /* 1963 * Create the session process' environment block. 1964 */ 1965 RTENV hEnv = NIL_RTENV; 1966 if (RT_SUCCESS(rc)) 1967 { 1968 /** @todo At the moment a session process does not have the ability to use the 1969 * per-session environment variables itself, only the session's guest 1970 * processes do so. Implement that later, also needs tweaking of 1971 * VbglR3GuestCtrlSessionGetOpen(). */ 1972 rc = RTEnvClone(&hEnv, RTENV_DEFAULT); 1973 1974 if (g_cVerbosity > 3) 1975 { 1976 VBoxServiceVerbose(4, "Environment variables:\n"); 1977 1978 uint32_t cVars = RTEnvCountEx(hEnv); 1979 for (uint32_t iVar = 0; iVar < cVars; iVar++) 1980 { 1981 char szVar[_1K]; 1982 char szValue[_16K]; 1983 rc2 = RTEnvGetByIndexEx(hEnv, iVar, szVar, sizeof(szVar), szValue, sizeof(szValue)); 1984 if (RT_SUCCESS(rc2)) 1985 VBoxServiceVerbose(4, "\t%s=%s\n", szVar, szValue); 1986 else if (rc2 == VERR_BUFFER_OVERFLOW) 1987 VBoxServiceVerbose(4, "\t%s=%s [VERR_BUFFER_OVERFLOW]\n", szVar, szValue); 1988 else 1989 { 1990 VBoxServiceVerbose(4, "\tUnable to enumerate environment variable #%RU32: %Rrc\n", iVar, rc2); 1991 /* Keep going. */ 1992 } 1993 } 1994 } 1995 } 1961 1996 1962 1997 #if 0 /* Pipe handling not needed (yet). */ … … 2021 2056 hStdOutAndErr.enmType = RTHANDLETYPE_FILE; 2022 2057 2023 rc = RTProcCreateEx(pszExeName, papszArgs, RTENV_DEFAULT, uProcFlags,2058 rc = RTProcCreateEx(pszExeName, papszArgs, hEnv, uProcFlags, 2024 2059 &hStdIn, &hStdOutAndErr, &hStdOutAndErr, 2025 2060 !fAnonymous ? pSessionThread->StartupInfo.szUser : NULL, … … 2033 2068 } 2034 2069 #endif 2070 if (hEnv != NIL_RTENV) 2071 RTEnvDestroy(hEnv); 2035 2072 } 2036 2073 else
Note:
See TracChangeset
for help on using the changeset viewer.