- Timestamp:
- Sep 18, 2015 10:30:06 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/win/process-win.cpp
r57820 r57824 670 670 return; 671 671 672 if (fFlags & RTPROC_MODIFY_DEFAULT_ENV) 673 { 674 RTEnvDestroy(*phEnv); 675 RTMemFree(phEnv); 676 } 672 RTEnvDestroy(*phEnv); 673 RTMemFree(phEnv); 677 674 } 678 675 … … 991 988 static int rtProcWinCreateEnvFromToken(HANDLE hToken, RTENV hEnv, uint32_t fFlags, PRTENV *pphEnv) 992 989 { 990 PRTENV phEnv = (PRTENV)RTMemAlloc(sizeof(RTENV)); 991 if (!phEnv) 992 return VERR_NO_MEMORY; 993 993 994 int rc = VINF_SUCCESS; 994 995 PRTENV phEnv;996 995 if (fFlags & RTPROC_MODIFY_DEFAULT_ENV) 997 996 { 998 phEnv = (PRTENV)RTMemAlloc(sizeof(RTENV)); 999 if (!phEnv) 1000 rc = VERR_NO_MEMORY; 1001 1002 if (RT_SUCCESS(rc)) 1003 { 1004 if (fFlags & RTPROC_FLAGS_PROFILE) 1005 { 1006 rc = RTEnvCreate(phEnv); 1007 if (RT_SUCCESS(rc)) 1008 rc = rtProcWinRetrieveEnvFromToken(hToken, *phEnv); 1009 } 1010 else 1011 rc = RTEnvClone(phEnv, RTENV_DEFAULT); 1012 } 997 if (fFlags & RTPROC_FLAGS_PROFILE) 998 { 999 rc = RTEnvCreate(phEnv); 1000 if (RT_SUCCESS(rc)) 1001 rc = rtProcWinRetrieveEnvFromToken(hToken, *phEnv); 1002 } 1003 else 1004 rc = RTEnvClone(phEnv, RTENV_DEFAULT); 1013 1005 1014 1006 if ( RT_SUCCESS(rc) … … 1021 1013 } 1022 1014 else /* Only use the environment block handed-in. */ 1023 phEnv = &hEnv;1015 rc = RTEnvClone(phEnv, hEnv); 1024 1016 1025 1017 if (RT_SUCCESS(rc))
Note:
See TracChangeset
for help on using the changeset viewer.