diff options
Diffstat (limited to 'sal/osl/w32/process.cxx')
-rw-r--r-- | sal/osl/w32/process.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sal/osl/w32/process.cxx b/sal/osl/w32/process.cxx index 96187be7e203..521ac6f76ad4 100644 --- a/sal/osl/w32/process.cxx +++ b/sal/osl/w32/process.cxx @@ -413,6 +413,25 @@ oslProcessError SAL_CALL osl_getEnvironment(rtl_uString *ustrVar, rtl_uString ** return osl_Process_E_Unknown; } +oslProcessError SAL_CALL osl_setEnvironment(rtl_uString *ustrVar, rtl_uString *ustrValue) +{ + LPCWSTR lpName = reinterpret_cast<LPCWSTR>(ustrVar->buffer); + LPCWSTR lpValue = reinterpret_cast<LPCWSTR>(ustrValue->buffer); + if (SetEnvironmentVariableW(lpName, lpValue)) + return osl_Process_E_None; + return osl_Process_E_Unknown; +} + +oslProcessError SAL_CALL osl_clearEnvironment(rtl_uString *ustrVar) +{ + //If the second parameter is NULL, the variable is deleted from the current + //process's environment. + LPCWSTR lpName = reinterpret_cast<LPCWSTR>(ustrVar->buffer); + if (SetEnvironmentVariableW(lpName, NULL)) + return osl_Process_E_None; + return osl_Process_E_Unknown; +} + /*************************************************************************** * Current Working Directory. ***************************************************************************/ |