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

HANDLE WINAPI
CreateMutex(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bInitialOwner,
	LPCWSTR lpName)
{
	char *name;
	HANDLE h;

	if(win_useunicode)
		return CreateMutexW(lpEventAttributes, bInitialOwner, lpName);

	name = 0;
	if(lpName)
		name = win_wstr2utf(lpName);
	h = CreateMutexA(lpEventAttributes, bInitialOwner, name);
	win_free(name);
	return h;
}


syntax highlighted by Code2HTML, v. 0.9.1