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