ntdll: Use helper function for NtWaitForMultipleObjects and NtWaitForSingleObject.

Sebastian Lackner sebastian at fds-team.de
Mon Aug 24 01:17:54 CDT 2015


From: Michael Müller <michael at fds-team.de>

For https://bugs.winehq.org/show_bug.cgi?id=39127
---
 dlls/ntdll/sync.c |   22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/dlls/ntdll/sync.c b/dlls/ntdll/sync.c
index b0329ab..9773382 100644
--- a/dlls/ntdll/sync.c
+++ b/dlls/ntdll/sync.c
@@ -990,12 +990,9 @@ NTSTATUS WINAPI NtSetTimerResolution(IN ULONG resolution,
 
 /* wait operations */
 
-/******************************************************************
- *		NtWaitForMultipleObjects (NTDLL.@)
- */
-NTSTATUS WINAPI NtWaitForMultipleObjects( DWORD count, const HANDLE *handles,
-                                          BOOLEAN wait_any, BOOLEAN alertable,
-                                          const LARGE_INTEGER *timeout )
+static inline NTSTATUS wait_objects( DWORD count, const HANDLE *handles,
+                                     BOOLEAN wait_any, BOOLEAN alertable,
+                                     const LARGE_INTEGER *timeout )
 {
     select_op_t select_op;
     UINT i, flags = SELECT_INTERRUPTIBLE;
@@ -1010,11 +1007,22 @@ NTSTATUS WINAPI NtWaitForMultipleObjects( DWORD count, const HANDLE *handles,
 
 
 /******************************************************************
+ *		NtWaitForMultipleObjects (NTDLL.@)
+ */
+NTSTATUS WINAPI NtWaitForMultipleObjects( DWORD count, const HANDLE *handles,
+                                          BOOLEAN wait_any, BOOLEAN alertable,
+                                          const LARGE_INTEGER *timeout )
+{
+    return wait_objects( count, handles, wait_any, alertable, timeout );
+}
+
+
+/******************************************************************
  *		NtWaitForSingleObject (NTDLL.@)
  */
 NTSTATUS WINAPI NtWaitForSingleObject(HANDLE handle, BOOLEAN alertable, const LARGE_INTEGER *timeout )
 {
-    return NtWaitForMultipleObjects( 1, &handle, FALSE, alertable, timeout );
+    return wait_objects( 1, &handle, FALSE, alertable, timeout );
 }
 
 
-- 
2.5.0



More information about the wine-patches mailing list