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


HICON WINAPI
LoadIcon(HINSTANCE hInstance, LPCWSTR lpIconName)
{
	char *name;
	HICON h;

	if(win_useunicode)
		return LoadIconW(hInstance, lpIconName);

	if((int)lpIconName < (1<<16)) {
		/* probably not a string */
		return LoadIconA(hInstance, (char*)lpIconName);
	}

	name = win_wstr2utf(lpIconName);
	h = LoadIconA(hInstance, name);
	win_free(name);
	return h;
}
