From 7bbba4f9ce6281851e760fd5ebd2c579dd8dd26a Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Sat, 26 Aug 2000 21:18:36 +0000 Subject: [PATCH] Removed calls to ConvertToGlobalHandle and MakeCriticalSectionGlobal. --- debugger/winedbg.c | 1 + dlls/dinput/dinput_main.c | 1 - dlls/dplayx/dplobby.c | 13 ++++--------- loader/task.c | 5 +---- win32/except.c | 7 ++++++- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/debugger/winedbg.c b/debugger/winedbg.c index b8c9d0a2406..c5fb9ce5283 100644 --- a/debugger/winedbg.c +++ b/debugger/winedbg.c @@ -816,6 +816,7 @@ int DEBUG_main(int argc, char** argv) BOOL ret = DEBUG_Attach(pid, TRUE); SetEvent(hEvent); + CloseHandle(hEvent); if (!ret) { DEBUG_Printf(DBG_CHN_ERR, "Can't attach process %ld: %ld\n", DEBUG_CurrPid, GetLastError()); diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c index 85cbdfac201..282c85a021e 100644 --- a/dlls/dinput/dinput_main.c +++ b/dlls/dinput/dinput_main.c @@ -611,7 +611,6 @@ static HRESULT WINAPI IDirectInputAImpl_CreateDevice( newDevice->ref = 1; ICOM_VTBL(newDevice) = &SysMouseAvt; InitializeCriticalSection(&(newDevice->crit)); - MakeCriticalSectionGlobal(&(newDevice->crit)); memcpy(&(newDevice->guid),rguid,sizeof(*rguid)); *pdev=(IDirectInputDeviceA*)newDevice; diff --git a/dlls/dplayx/dplobby.c b/dlls/dplayx/dplobby.c index 3a451fefe41..238757d2e10 100644 --- a/dlls/dplayx/dplobby.c +++ b/dlls/dplayx/dplobby.c @@ -1137,7 +1137,7 @@ BOOL DPL_CreateAndSetLobbyHandles( DWORD dwDestProcessId, HANDLE hDestProcess, LPHANDLE lphRead ) { /* These are the handles for the created process */ - HANDLE hAppStart, hAppDeath, hAppRead, hTemp; + HANDLE hAppStart, hAppDeath, hAppRead; SECURITY_ATTRIBUTES s_attrib; s_attrib.nLength = sizeof( s_attrib ); @@ -1145,14 +1145,9 @@ 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 ); - *lphStart = ConvertToGlobalHandle( hTemp ); - - hTemp = CreateEventA( &s_attrib, TRUE, FALSE, NULL ); - *lphDeath = ConvertToGlobalHandle( hTemp ); - - hTemp = CreateEventA( &s_attrib, TRUE, FALSE, NULL ); - *lphRead = ConvertToGlobalHandle( hTemp ); + *lphStart = CreateEventA( &s_attrib, TRUE, FALSE, NULL ); + *lphDeath = CreateEventA( &s_attrib, TRUE, FALSE, NULL ); + *lphRead = CreateEventA( &s_attrib, TRUE, FALSE, NULL ); if( ( !DuplicateHandle( GetCurrentProcess(), *lphStart, hDestProcess, &hAppStart, diff --git a/loader/task.c b/loader/task.c index 2bcfa7697b2..adcee6a05b4 100644 --- a/loader/task.c +++ b/loader/task.c @@ -328,13 +328,10 @@ BOOL TASK_Create( NE_MODULE *pModule, UINT16 cmdShow, TEB *teb, LPCSTR cmdline, /* Create scheduler event for 16-bit tasks */ if ( !(pTask->flags & TDBF_WIN32) ) - { pTask->hEvent = CreateEventA( NULL, TRUE, FALSE, NULL ); - pTask->hEvent = ConvertToGlobalHandle( pTask->hEvent ); - } /* Enter task handle into thread and process */ - + teb->htask16 = hTask; if (!initial_task) initial_task = hTask; diff --git a/win32/except.c b/win32/except.c index 22cf918a9aa..df12c222652 100644 --- a/win32/except.c +++ b/win32/except.c @@ -137,9 +137,14 @@ DWORD WINAPI UnhandledExceptionFilter(PEXCEPTION_POINTERS epointers) HANDLE hEvent; PROCESS_INFORMATION info; STARTUPINFOA startup; + SECURITY_ATTRIBUTES attr; + + attr.nLength = sizeof(attr); + attr.lpSecurityDescriptor = NULL; + attr.bInheritHandle = TRUE; TRACE("Starting debugger (fmt=%s)\n", format); - hEvent = ConvertToGlobalHandle(CreateEventA(NULL, FALSE, FALSE, NULL)); + hEvent = CreateEventA(&attr, FALSE, FALSE, NULL); sprintf(buffer, format, GetCurrentProcessId(), hEvent); memset(&startup, 0, sizeof(startup)); startup.cb = sizeof(startup);