From 4a0f99985985d5130ea0ffe4a3e2df1f6f9da604 Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Fri, 7 Jan 2005 15:40:09 +0000 Subject: [PATCH] Use CreateEventW in preference to CreateEventA for unnamed events. --- dlls/advapi32/registry.c | 2 +- dlls/ddraw/dsurface/user.c | 4 ++-- dlls/dplayx/dplay.c | 4 ++-- dlls/dplayx/dplayx_messages.c | 2 +- dlls/dplayx/dplobby.c | 6 +++--- dlls/kernel/comm.c | 2 +- dlls/kernel/sync.c | 6 +++--- dlls/rpcrt4/rpc_binding.c | 8 ++++---- dlls/rpcrt4/rpc_server.c | 4 ++-- dlls/shlwapi/thread.c | 2 +- dlls/user/comm16.c | 2 +- dlls/winedos/dosvm.c | 2 +- dlls/winedos/module.c | 2 +- dlls/wininet/internet.c | 4 ++-- dlls/winmm/mciavi/mciavi.c | 2 +- dlls/winmm/mciavi/mmoutput.c | 2 +- dlls/winmm/mciwave/mciwave.c | 4 ++-- dlls/winsock/socket.c | 2 +- dlls/winsock/tests/sock.c | 4 ++-- 19 files changed, 32 insertions(+), 32 deletions(-) diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c index 4544a37434c..ffb823ce9d4 100644 --- a/dlls/advapi32/registry.c +++ b/dlls/advapi32/registry.c @@ -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 ) { diff --git a/dlls/ddraw/dsurface/user.c b/dlls/ddraw/dsurface/user.c index aa1bffed262..04d7cdc4b40 100644 --- a/dlls/ddraw/dsurface/user.c +++ b/dlls/ddraw/dsurface/user.c @@ -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) { diff --git a/dlls/dplayx/dplay.c b/dlls/dplayx/dplay.c index d532344cb72..c5afb2f715d 100644 --- a/dlls/dplayx/dplay.c +++ b/dlls/dplayx/dplay.c @@ -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 ) diff --git a/dlls/dplayx/dplayx_messages.c b/dlls/dplayx/dplayx_messages.c index 0ebcddd69a7..2b248aff24d 100644 --- a/dlls/dplayx/dplayx_messages.c +++ b/dlls/dplayx/dplayx_messages.c @@ -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; diff --git a/dlls/dplayx/dplobby.c b/dlls/dplayx/dplobby.c index 24ea197df65..5e33d0b50f7 100644 --- a/dlls/dplayx/dplobby.c +++ b/dlls/dplayx/dplobby.c @@ -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, diff --git a/dlls/kernel/comm.c b/dlls/kernel/comm.c index a5c8b28f831..2e6f8f7d4aa 100644 --- a/dlls/kernel/comm.c +++ b/dlls/kernel/comm.c @@ -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); diff --git a/dlls/kernel/sync.c b/dlls/kernel/sync.c index 82812e6b41d..ffabde29875 100644 --- a/dlls/kernel/sync.c +++ b/dlls/kernel/sync.c @@ -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; diff --git a/dlls/rpcrt4/rpc_binding.c b/dlls/rpcrt4/rpc_binding.c index 954c17e3626..dee6004032d 100644 --- a/dlls/rpcrt4/rpc_binding.c +++ b/dlls/rpcrt4/rpc_binding.c @@ -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); diff --git a/dlls/rpcrt4/rpc_server.c b/dlls/rpcrt4/rpc_server.c index e14fa39bb52..8f902e1dd9f 100644 --- a/dlls/rpcrt4/rpc_server.c +++ b/dlls/rpcrt4/rpc_server.c @@ -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); diff --git a/dlls/shlwapi/thread.c b/dlls/shlwapi/thread.c index 5fae0c01b30..ae482df3572 100644 --- a/dlls/shlwapi/thread.c +++ b/dlls/shlwapi/thread.c @@ -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) diff --git a/dlls/user/comm16.c b/dlls/user/comm16.c index 1ed2bf292b6..09e197cfdd2 100644 --- a/dlls/user/comm16.c +++ b/dlls/user/comm16.c @@ -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; diff --git a/dlls/winedos/dosvm.c b/dlls/winedos/dosvm.c index 13388a7c233..b4046b25088 100644 --- a/dlls/winedos/dosvm.c +++ b/dlls/winedos/dosvm.c @@ -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"); } diff --git a/dlls/winedos/module.c b/dlls/winedos/module.c index 63dac076490..70c0cc4f4e9 100644 --- a/dlls/winedos/module.c +++ b/dlls/winedos/module.c @@ -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); diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index c3de762358f..49c7779b333 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -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(); diff --git a/dlls/winmm/mciavi/mciavi.c b/dlls/winmm/mciavi/mciavi.c index 3f69fa50b08..88d477884b3 100644 --- a/dlls/winmm/mciavi/mciavi.c +++ b/dlls/winmm/mciavi/mciavi.c @@ -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; diff --git a/dlls/winmm/mciavi/mmoutput.c b/dlls/winmm/mciavi/mmoutput.c index 0f12c4c4595..ee9b84ce89c 100644 --- a/dlls/winmm/mciavi/mmoutput.c +++ b/dlls/winmm/mciavi/mmoutput.c @@ -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: diff --git a/dlls/winmm/mciwave/mciwave.c b/dlls/winmm/mciwave/mciwave.c index 4fab14c59d4..b89f4c1b446 100644 --- a/dlls/winmm/mciwave/mciwave.c +++ b/dlls/winmm/mciwave/mciwave.c @@ -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); diff --git a/dlls/winsock/socket.c b/dlls/winsock/socket.c index b3095cc0f97..ab0093de1cc 100644 --- a/dlls/winsock/socket.c +++ b/dlls/winsock/socket.c @@ -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); } /*********************************************************************** diff --git a/dlls/winsock/tests/sock.c b/dlls/winsock/tests/sock.c index 2c73e25603d..730a1fee090 100644 --- a/dlls/winsock/tests/sock.c +++ b/dlls/winsock/tests/sock.c @@ -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 );