Commit c57fd07d authored by Alexandre Julliard's avatar Alexandre Julliard

kernel32: Move the 16-bit synchronization functions to kernel16.c.

parent fe2c157f
......@@ -215,6 +215,109 @@ INT16 WINAPI UnicodeToAnsi16( LPCWSTR src, LPSTR dst, INT16 codepage )
}
/***********************************************************************
* VWin32_EventCreate (KERNEL.442)
*/
HANDLE WINAPI VWin32_EventCreate(VOID)
{
HANDLE hEvent = CreateEventW( NULL, FALSE, 0, NULL );
return ConvertToGlobalHandle( hEvent );
}
/***********************************************************************
* VWin32_EventDestroy (KERNEL.443)
*/
VOID WINAPI VWin32_EventDestroy(HANDLE event)
{
CloseHandle( event );
}
/***********************************************************************
* VWin32_EventWait (KERNEL.450)
*/
VOID WINAPI VWin32_EventWait(HANDLE event)
{
DWORD mutex_count;
ReleaseThunkLock( &mutex_count );
WaitForSingleObject( event, INFINITE );
RestoreThunkLock( mutex_count );
}
/***********************************************************************
* VWin32_EventSet (KERNEL.451)
* KERNEL_479 (KERNEL.479)
*/
VOID WINAPI VWin32_EventSet(HANDLE event)
{
SetEvent( event );
}
/***********************************************************************
* CreateW32Event (KERNEL.457)
*/
HANDLE WINAPI CreateW32Event( BOOL manual_reset, BOOL initial_state )
{
return CreateEventW( NULL, manual_reset, initial_state, NULL );
}
/***********************************************************************
* SetW32Event (KERNEL.458)
*/
BOOL WINAPI SetW32Event( HANDLE handle )
{
return SetEvent( handle );
}
/***********************************************************************
* ResetW32Event (KERNEL.459)
*/
BOOL WINAPI ResetW32Event( HANDLE handle )
{
return ResetEvent( handle );
}
/***********************************************************************
* WaitForSingleObject (KERNEL.460)
*/
DWORD WINAPI WaitForSingleObject16( HANDLE handle, DWORD timeout )
{
DWORD retval, mutex_count;
ReleaseThunkLock( &mutex_count );
retval = WaitForSingleObject( handle, timeout );
RestoreThunkLock( mutex_count );
return retval;
}
/***********************************************************************
* WaitForMultipleObjects (KERNEL.461)
*/
DWORD WINAPI WaitForMultipleObjects16( DWORD count, const HANDLE *handles,
BOOL wait_all, DWORD timeout )
{
DWORD retval, mutex_count;
ReleaseThunkLock( &mutex_count );
retval = WaitForMultipleObjectsEx( count, handles, wait_all, timeout, FALSE );
RestoreThunkLock( mutex_count );
return retval;
}
/***********************************************************************
* WaitForMultipleObjectsEx (KERNEL.495)
*/
DWORD WINAPI WaitForMultipleObjectsEx16( DWORD count, const HANDLE *handles,
BOOL wait_all, DWORD timeout, BOOL alertable )
{
DWORD retval, mutex_count;
ReleaseThunkLock( &mutex_count );
retval = WaitForMultipleObjectsEx( count, handles, wait_all, timeout, alertable );
RestoreThunkLock( mutex_count );
return retval;
}
/***********************************************************************
* EnableDos (KERNEL.41)
* DisableDos (KERNEL.42)
* GetLastDiskChange (KERNEL.98)
......
......@@ -359,9 +359,9 @@
454 equate __FLATCS 0 # initialized by BUILTIN_Init()
455 equate __FLATDS 0 # initialized by BUILTIN_Init()
456 pascal DefResourceHandler(word word word) NE_DefResourceHandler
457 pascal CreateW32Event(long long) WIN16_CreateEvent
458 pascal SetW32Event(long) SetEvent
459 pascal ResetW32Event(long) ResetEvent
457 pascal CreateW32Event(long long) CreateW32Event
458 pascal SetW32Event(long) SetW32Event
459 pascal ResetW32Event(long) ResetW32Event
460 pascal WaitForSingleObject(long long) WaitForSingleObject16
461 pascal WaitForMultipleObjects(long ptr long long) WaitForMultipleObjects16
462 pascal GetCurrentThreadId() GetCurrentThreadId
......
......@@ -43,7 +43,6 @@
#include "ddk/wdm.h"
#include "wine/unicode.h"
#include "wine/winbase16.h"
#include "kernel_private.h"
#include "wine/debug.h"
......@@ -202,47 +201,6 @@ DWORD WINAPI WaitForMultipleObjectsEx( DWORD count, const HANDLE *handles,
/***********************************************************************
* WaitForSingleObject (KERNEL.460)
*/
DWORD WINAPI WaitForSingleObject16( HANDLE handle, DWORD timeout )
{
DWORD retval, mutex_count;
ReleaseThunkLock( &mutex_count );
retval = WaitForSingleObject( handle, timeout );
RestoreThunkLock( mutex_count );
return retval;
}
/***********************************************************************
* WaitForMultipleObjects (KERNEL.461)
*/
DWORD WINAPI WaitForMultipleObjects16( DWORD count, const HANDLE *handles,
BOOL wait_all, DWORD timeout )
{
DWORD retval, mutex_count;
ReleaseThunkLock( &mutex_count );
retval = WaitForMultipleObjectsEx( count, handles, wait_all, timeout, FALSE );
RestoreThunkLock( mutex_count );
return retval;
}
/***********************************************************************
* WaitForMultipleObjectsEx (KERNEL.495)
*/
DWORD WINAPI WaitForMultipleObjectsEx16( DWORD count, const HANDLE *handles,
BOOL wait_all, DWORD timeout, BOOL alertable )
{
DWORD retval, mutex_count;
ReleaseThunkLock( &mutex_count );
retval = WaitForMultipleObjectsEx( count, handles, wait_all, timeout, alertable );
RestoreThunkLock( mutex_count );
return retval;
}
/***********************************************************************
* RegisterWaitForSingleObject (KERNEL32.@)
*/
BOOL WINAPI RegisterWaitForSingleObject(PHANDLE phNewWaitObject, HANDLE hObject,
......@@ -542,15 +500,6 @@ HANDLE WINAPI CreateEventExW( SECURITY_ATTRIBUTES *sa, LPCWSTR name, DWORD flags
/***********************************************************************
* CreateW32Event (KERNEL.457)
*/
HANDLE WINAPI WIN16_CreateEvent( BOOL manual_reset, BOOL initial_state )
{
return CreateEventW( NULL, manual_reset, initial_state, NULL );
}
/***********************************************************************
* OpenEventA (KERNEL32.@)
*/
HANDLE WINAPI OpenEventA( DWORD access, BOOL inherit, LPCSTR name )
......@@ -616,7 +565,6 @@ BOOL WINAPI PulseEvent( HANDLE handle )
/***********************************************************************
* SetW32Event (KERNEL.458)
* SetEvent (KERNEL32.@)
*/
BOOL WINAPI SetEvent( HANDLE handle )
......@@ -630,7 +578,6 @@ BOOL WINAPI SetEvent( HANDLE handle )
/***********************************************************************
* ResetW32Event (KERNEL.459)
* ResetEvent (KERNEL32.@)
*/
BOOL WINAPI ResetEvent( HANDLE handle )
......@@ -644,53 +591,6 @@ BOOL WINAPI ResetEvent( HANDLE handle )
/***********************************************************************
* NOTE: The Win95 VWin32_Event routines given below are really low-level
* routines implemented directly by VWin32. The user-mode libraries
* implement Win32 synchronisation routines on top of these low-level
* primitives. We do it the other way around here :-)
*/
/***********************************************************************
* VWin32_EventCreate (KERNEL.442)
*/
HANDLE WINAPI VWin32_EventCreate(VOID)
{
HANDLE hEvent = CreateEventW( NULL, FALSE, 0, NULL );
return ConvertToGlobalHandle( hEvent );
}
/***********************************************************************
* VWin32_EventDestroy (KERNEL.443)
*/
VOID WINAPI VWin32_EventDestroy(HANDLE event)
{
CloseHandle( event );
}
/***********************************************************************
* VWin32_EventWait (KERNEL.450)
*/
VOID WINAPI VWin32_EventWait(HANDLE event)
{
DWORD mutex_count;
ReleaseThunkLock( &mutex_count );
WaitForSingleObject( event, INFINITE );
RestoreThunkLock( mutex_count );
}
/***********************************************************************
* VWin32_EventSet (KERNEL.451)
* KERNEL_479 (KERNEL.479)
*/
VOID WINAPI VWin32_EventSet(HANDLE event)
{
SetEvent( event );
}
/***********************************************************************
* CreateMutexA (KERNEL32.@)
*/
HANDLE WINAPI CreateMutexA( SECURITY_ATTRIBUTES *sa, BOOL owner, LPCSTR name )
......
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