kernel32: Move the 16-bit synchronization functions to kernel16.c.
This commit is contained in:
parent
fe2c157fe9
commit
c57fd07d27
|
@ -214,6 +214,109 @@ INT16 WINAPI UnicodeToAnsi16( LPCWSTR src, LPSTR dst, INT16 codepage )
|
|||
return WideCharToMultiByte( codepage, 0, src, -1, dst, 0x7fffffff, NULL, NULL );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* 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)
|
||||
|
|
|
@ -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"
|
||||
|
@ -201,47 +200,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.@)
|
||||
*/
|
||||
|
@ -541,15 +499,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.@)
|
||||
*/
|
||||
|
@ -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 )
|
||||
|
@ -643,53 +590,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.@)
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue