diff --git a/reactos/lib/msvcrt/stdlib/putenv.c b/reactos/lib/msvcrt/stdlib/putenv.c index bdd97a0c077..de3cab4444a 100644 --- a/reactos/lib/msvcrt/stdlib/putenv.c +++ b/reactos/lib/msvcrt/stdlib/putenv.c @@ -3,10 +3,13 @@ #include +extern int BlockEnvToEnviron(); // defined in misc/dllmain.c + int _putenv(const char *val) { char buffer[1024]; char *epos; + int res; strcpy(buffer,val); epos = strchr(buffer, '='); @@ -15,13 +18,16 @@ int _putenv(const char *val) *epos = 0; - return SetEnvironmentVariableA(buffer,epos+1); + res = SetEnvironmentVariableA(buffer,epos+1); + if (BlockEnvToEnviron() ) return 0; + return res; } int _wputenv(const wchar_t *val) { wchar_t buffer[1024]; wchar_t *epos; + int res; wcscpy(buffer,val); epos = wcschr(buffer, L'='); @@ -30,5 +36,7 @@ int _wputenv(const wchar_t *val) *epos = 0; - return SetEnvironmentVariableW(buffer,epos+1); + res = SetEnvironmentVariableW(buffer,epos+1); + if (BlockEnvToEnviron() ) return 0; + return res; }