#include <9pm/windows.h>
#include <9pm/u.h>
#include <9pm/libc.h>

BOOL WINAPI
SetEnvironmentVariable(LPCWSTR lpName, LPCWSTR lpValue)
{
	BOOL b;
	char *name, *val;

	if(win_useunicode)
		return SetEnvironmentVariableW(lpName, lpValue);

	name = win_wstr2utf(lpName);
	val = win_wstr2utf(lpValue);
	b = SetEnvironmentVariableA(name, val);
	win_free(name);
	win_free(val);

	return b;
}
