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

Alexandre Julliard julliard at winehq.org
Thu Oct 8 08:57:11 CDT 2009


Module: wine
Branch: master
Commit: c57fd07d27fc7bbafc84928a638d3a7242c96b81
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c57fd07d27fc7bbafc84928a638d3a7242c96b81

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Oct  7 17:19:21 2009 +0200

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

---

 dlls/kernel32/kernel16.c       |  103 ++++++++++++++++++++++++++++++++++++++++
 dlls/kernel32/krnl386.exe.spec |    6 +-
 dlls/kernel32/sync.c           |  100 --------------------------------------
 3 files changed, 106 insertions(+), 103 deletions(-)

diff --git a/dlls/kernel32/kernel16.c b/dlls/kernel32/kernel16.c
index 795baab..70e87ea 100644
--- a/dlls/kernel32/kernel16.c
+++ b/dlls/kernel32/kernel16.c
@@ -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)
diff --git a/dlls/kernel32/krnl386.exe.spec b/dlls/kernel32/krnl386.exe.spec
index 09d42f1..446c830 100644
--- a/dlls/kernel32/krnl386.exe.spec
+++ b/dlls/kernel32/krnl386.exe.spec
@@ -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
diff --git a/dlls/kernel32/sync.c b/dlls/kernel32/sync.c
index e45f1bc..be73c98 100644
--- a/dlls/kernel32/sync.c
+++ b/dlls/kernel32/sync.c
@@ -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 )




More information about the wine-cvs mailing list