2 #include <msvcrt/stdlib.h>
3 #include <msvcrt/string.h>
6 #include <msvcrt/msvcrtdbg.h>
9 extern int BlockEnvToEnviron(); // defined in misc/dllmain.c
14 int _wputenv(const wchar_t* val)
20 DPRINT("_wputenv('%S')\n", val);
21 epos = wcsrchr(val, L'=');
24 buffer = (wchar_t*)malloc((epos - val + 1) * sizeof(wchar_t));
27 wcsncpy(buffer, val, epos - val);
28 buffer[epos - val] = 0;
29 res = SetEnvironmentVariableW(buffer, epos+1);
31 if (BlockEnvToEnviron())