Commit 4a0f9998 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Use CreateEventW in preference to CreateEventA for unnamed events.

parent 1e0aaaf2
......@@ -2073,7 +2073,7 @@ LONG WINAPI RegNotifyChangeKeyValue( HKEY hkey, BOOL fWatchSubTree,
hEvent,fAsync);
if( !fAsync )
hEvent = CreateEventA(NULL, 0, 0, NULL);
hEvent = CreateEventW(NULL, 0, 0, NULL);
SERVER_START_REQ( set_registry_notification )
{
......
......@@ -96,8 +96,8 @@ User_DirectDrawSurface_Construct(IDirectDrawSurfaceImpl* This,
#endif
#ifndef SYNC_UPDATE
InitializeCriticalSection(&priv->user.crit);
priv->user.refresh_event = CreateEventA(NULL, TRUE, FALSE, NULL);
priv->user.update_event = CreateEventA(NULL, FALSE, FALSE, NULL);
priv->user.refresh_event = CreateEventW(NULL, TRUE, FALSE, NULL);
priv->user.update_event = CreateEventW(NULL, FALSE, FALSE, NULL);
priv->user.update_thread = CreateThread(NULL, 0, User_update_thread, This, 0, NULL);
#ifdef OWN_WINDOW
if (This->ddraw_owner->cooperative_level & DDSCL_FULLSCREEN) {
......
......@@ -2309,7 +2309,7 @@ static HRESULT WINAPI DP_IF_EnumSessions
lpData->dwTimeout = dwTimeout;
This->dp2->hKillEnumSessionThreadEvent =
CreateEventA( NULL, TRUE, FALSE, NULL );
CreateEventW( NULL, TRUE, FALSE, NULL );
if( !DuplicateHandle( GetCurrentProcess(),
This->dp2->hKillEnumSessionThreadEvent,
......@@ -4582,7 +4582,7 @@ static HRESULT WINAPI DP_SendEx
{
DWORD dwWaitReturn;
This->dp2->hReplyEvent = CreateEventA( NULL, FALSE, FALSE, NULL );
This->dp2->hReplyEvent = CreateEventW( NULL, FALSE, FALSE, NULL );
dwWaitReturn = WaitForSingleObject( hReplyEvent, dwTimeout );
if( dwWaitReturn != WAIT_OBJECT_0 )
......
......@@ -166,7 +166,7 @@ static
HANDLE DP_MSG_BuildAndLinkReplyStruct( IDirectPlay2Impl* This,
LPDP_MSG_REPLY_STRUCT_LIST lpReplyStructList, WORD wReplyCommandId )
{
lpReplyStructList->replyExpected.hReceipt = CreateEventA( NULL, FALSE, FALSE, NULL );
lpReplyStructList->replyExpected.hReceipt = CreateEventW( NULL, FALSE, FALSE, NULL );
lpReplyStructList->replyExpected.wExpectedReply = wReplyCommandId;
lpReplyStructList->replyExpected.lpReplyMsg = NULL;
lpReplyStructList->replyExpected.dwMsgBodySize = 0;
......
......@@ -1164,13 +1164,13 @@ BOOL DPL_CreateAndSetLobbyHandles( DWORD dwDestProcessId, HANDLE hDestProcess,
s_attrib.bInheritHandle = TRUE;
/* FIXME: Is there a handle leak here? */
hTemp = CreateEventA( &s_attrib, TRUE, FALSE, NULL );
hTemp = CreateEventW( &s_attrib, TRUE, FALSE, NULL );
*lphStart = ConvertToGlobalHandle( hTemp );
hTemp = CreateEventA( &s_attrib, TRUE, FALSE, NULL );
hTemp = CreateEventW( &s_attrib, TRUE, FALSE, NULL );
*lphDeath = ConvertToGlobalHandle( hTemp );
hTemp = CreateEventA( &s_attrib, TRUE, FALSE, NULL );
hTemp = CreateEventW( &s_attrib, TRUE, FALSE, NULL );
*lphRead = ConvertToGlobalHandle( hTemp );
if( ( !DuplicateHandle( GetCurrentProcess(), *lphStart,
......
......@@ -2025,7 +2025,7 @@ BOOL WINAPI WaitCommEvent(
return COMM_WaitCommEvent(hFile, lpdwEvents, lpOverlapped);
/* if there is no overlapped structure, create our own */
ov.hEvent = CreateEventA(NULL,FALSE,FALSE,NULL);
ov.hEvent = CreateEventW(NULL,FALSE,FALSE,NULL);
COMM_WaitCommEvent(hFile, lpdwEvents, &ov);
......
......@@ -440,7 +440,7 @@ HANDLE WINAPI CreateEventW( SECURITY_ATTRIBUTES *sa, BOOL manual_reset,
*/
HANDLE WINAPI WIN16_CreateEvent( BOOL manual_reset, BOOL initial_state )
{
return CreateEventA( NULL, manual_reset, initial_state, NULL );
return CreateEventW( NULL, manual_reset, initial_state, NULL );
}
......@@ -548,7 +548,7 @@ BOOL WINAPI ResetEvent( HANDLE handle )
*/
HANDLE WINAPI VWin32_EventCreate(VOID)
{
HANDLE hEvent = CreateEventA( NULL, FALSE, 0, NULL );
HANDLE hEvent = CreateEventW( NULL, FALSE, 0, NULL );
return ConvertToGlobalHandle( hEvent );
}
......@@ -1301,7 +1301,7 @@ BOOL WINAPI ConnectNamedPipe(HANDLE hPipe, LPOVERLAPPED overlapped)
}
memset(&ov,0,sizeof(ov));
ov.hEvent = CreateEventA(NULL,0,0,NULL);
ov.hEvent = CreateEventW(NULL,0,0,NULL);
if (!ov.hEvent)
return FALSE;
......
......@@ -147,7 +147,7 @@ RPC_STATUS RPCRT4_OpenConnection(RpcConnection* Connection)
RPC_MAX_PACKET_SIZE, RPC_MAX_PACKET_SIZE, 5000, NULL);
HeapFree(GetProcessHeap(), 0, pname);
memset(&Connection->ovl, 0, sizeof(Connection->ovl));
Connection->ovl.hEvent = CreateEventA(NULL, TRUE, FALSE, NULL);
Connection->ovl.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
if (!ConnectNamedPipe(Connection->conn, &Connection->ovl)) {
WARN("Couldn't ConnectNamedPipe (error was %ld)\n", GetLastError());
if (GetLastError() == ERROR_PIPE_CONNECTED) {
......@@ -171,7 +171,7 @@ RPC_STATUS RPCRT4_OpenConnection(RpcConnection* Connection)
RPC_MAX_PACKET_SIZE, RPC_MAX_PACKET_SIZE, 5000, NULL);
HeapFree(GetProcessHeap(), 0, pname);
memset(&Connection->ovl, 0, sizeof(Connection->ovl));
Connection->ovl.hEvent = CreateEventA(NULL, TRUE, FALSE, NULL);
Connection->ovl.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
if (!ConnectNamedPipe(Connection->conn, &Connection->ovl)) {
WARN("Couldn't ConnectNamedPipe (error was %ld)\n", GetLastError());
if (GetLastError() == ERROR_PIPE_CONNECTED) {
......@@ -223,7 +223,7 @@ RPC_STATUS RPCRT4_OpenConnection(RpcConnection* Connection)
/* pipe is connected; change to message-read mode. */
dwMode = PIPE_READMODE_MESSAGE;
SetNamedPipeHandleState(conn, &dwMode, NULL, NULL);
Connection->ovl.hEvent = CreateEventA(NULL, TRUE, FALSE, NULL);
Connection->ovl.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
Connection->conn = conn;
}
/* protseq=ncacn_np: named pipes */
......@@ -257,7 +257,7 @@ RPC_STATUS RPCRT4_OpenConnection(RpcConnection* Connection)
/* pipe is connected; change to message-read mode. */
dwMode = PIPE_READMODE_MESSAGE;
SetNamedPipeHandleState(conn, &dwMode, NULL, NULL);
Connection->ovl.hEvent = CreateEventA(NULL, TRUE, FALSE, NULL);
Connection->ovl.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
Connection->conn = conn;
} else {
ERR("protseq %s not supported\n", Connection->Protseq);
......
......@@ -542,8 +542,8 @@ static void RPCRT4_start_listen(void)
EnterCriticalSection(&listen_cs);
if (! ++listen_count) {
if (!mgr_event) mgr_event = CreateEventA(NULL, TRUE, FALSE, NULL);
if (!server_sem) server_sem = CreateSemaphoreA(NULL, 0, MAX_THREADS, NULL);
if (!mgr_event) mgr_event = CreateEventW(NULL, TRUE, FALSE, NULL);
if (!server_sem) server_sem = CreateSemaphoreW(NULL, 0, MAX_THREADS, NULL);
if (!worker_tls) worker_tls = TlsAlloc();
std_listen = TRUE;
server_thread = CreateThread(NULL, 0, RPCRT4_server_thread, NULL, 0, NULL);
......
......@@ -288,7 +288,7 @@ BOOL WINAPI SHCreateThread(LPTHREAD_START_ROUTINE pfnThreadProc, VOID *pData,
ti.pfnCallback = pfnCallback;
ti.pData = pData;
ti.bInitCom = dwFlags & CTF_COINIT ? TRUE : FALSE;
ti.hEvent = CreateEventA(NULL,FALSE,FALSE,NULL);
ti.hEvent = CreateEventW(NULL,FALSE,FALSE,NULL);
/* Hold references to the current thread and IE process, if desired */
if(dwFlags & CTF_THREAD_REF)
......
......@@ -249,7 +249,7 @@ static INT COMM16_WriteFile(HANDLE hComm, LPCVOID buffer, DWORD len)
DWORD count= -1;
ZeroMemory(&ov,sizeof(ov));
ov.hEvent = CreateEventA(NULL,0,0,NULL);
ov.hEvent = CreateEventW(NULL,0,0,NULL);
if(ov.hEvent==INVALID_HANDLE_VALUE)
return -1;
......
......@@ -725,7 +725,7 @@ BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
DisableThreadLibraryCalls(hinstDLL);
DOSVM_InitSegments();
event_notifier = CreateEventA(NULL, FALSE, FALSE, NULL);
event_notifier = CreateEventW(NULL, FALSE, FALSE, NULL);
if(!event_notifier)
ERR("Failed to create event object!\n");
}
......
......@@ -590,7 +590,7 @@ void WINAPI MZ_RunInThread( PAPCFUNC proc, ULONG_PTR arg )
spc.proc = proc;
spc.arg = arg;
event = CreateEventA(NULL, TRUE, FALSE, NULL);
event = CreateEventW(NULL, TRUE, FALSE, NULL);
PostThreadMessageA(loop_tid, WM_USER, (WPARAM)event, (LPARAM)&spc);
WaitForSingleObject(event, INFINITE);
CloseHandle(event);
......
......@@ -273,8 +273,8 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
if (g_dwTlsErrIndex == TLS_OUT_OF_INDEXES)
return FALSE;
hQuitEvent = CreateEventA(0, TRUE, FALSE, NULL);
hWorkEvent = CreateEventA(0, FALSE, FALSE, NULL);
hQuitEvent = CreateEventW(0, TRUE, FALSE, NULL);
hWorkEvent = CreateEventW(0, FALSE, FALSE, NULL);
InitializeCriticalSection(&csQueue);
URLCacheContainers_CreateDefaults();
......
......@@ -152,7 +152,7 @@ static DWORD MCIAVI_drvOpen(LPSTR str, LPMCI_OPEN_DRIVER_PARMSA modp)
return 0;
InitializeCriticalSection(&wma->cs);
wma->hStopEvent = CreateEventA(NULL, FALSE, FALSE, NULL);
wma->hStopEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
wma->wDevID = modp->wDeviceID;
wma->wCommandTable = mciLoadCommandResource(MCIAVI_hInstance, mciAviWStr, 0);
modp->wCustomCommandTable = wma->wCommandTable;
......
......@@ -561,7 +561,7 @@ DWORD MCIAVI_OpenAudio(WINE_MCIAVI* wma, unsigned* nHdr, LPWAVEHDR* pWaveHdr)
}
wma->dwCurrAudioBlock = 0;
wma->hEvent = CreateEventA(NULL, FALSE, FALSE, NULL);
wma->hEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
wma->dwEventCount = *nHdr - 1;
*pWaveHdr = waveHdr;
cleanUp:
......
......@@ -809,7 +809,7 @@ static DWORD WAVE_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
whidx = 0;
left = min(wmw->ckWaveData.cksize, end - wmw->dwPosition);
wmw->hEvent = CreateEventA(NULL, FALSE, FALSE, NULL);
wmw->hEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
wmw->dwEventCount = 1L; /* for first buffer */
TRACE("Playing (normalized) from byte=%lu for %lu bytes\n", wmw->dwPosition, left);
......@@ -1048,7 +1048,7 @@ static DWORD WAVE_mciRecord(UINT wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpPar
goto cleanUp;
}
wmw->hEvent = CreateEventA(NULL, FALSE, FALSE, NULL);
wmw->hEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
wmw->dwEventCount = 1L; /* for first buffer */
TRACE("Recording (normalized) from byte=%lu for %lu bytes\n", wmw->dwPosition, end - wmw->dwPosition);
......
......@@ -2997,7 +2997,7 @@ WSAEVENT WINAPI WSACreateEvent(void)
/* Create a manual-reset event, with initial state: unsignaled */
TRACE("\n");
return CreateEventA(NULL, TRUE, FALSE, NULL);
return CreateEventW(NULL, TRUE, FALSE, NULL);
}
/***********************************************************************
......
......@@ -599,9 +599,9 @@ static void do_test( test_setup *test )
DWORD i, n = min (test->general.n_clients, MAX_CLIENTS);
DWORD wait;
server_ready = CreateEventA ( NULL, TRUE, FALSE, NULL );
server_ready = CreateEventW ( NULL, TRUE, FALSE, NULL );
for (i = 0; i <= n; i++)
client_ready[i] = CreateEventA ( NULL, TRUE, FALSE, NULL );
client_ready[i] = CreateEventW ( NULL, TRUE, FALSE, NULL );
StartServer ( test->srv, &test->general, &test->srv_params );
StartClients ( test->clt, &test->general, &test->clt_params );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment