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


LONG APIENTRY
RegOpenKey(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
{
	char *subkey;
	LONG l;

	if(win_useunicode)
		return RegOpenKeyW(hKey, lpSubKey, phkResult);

	subkey = win_wstr2utf(lpSubKey);
	l = RegOpenKeyA(hKey, subkey, phkResult);
	win_free(subkey);
	return l;
}
