Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
7b7d8374
Commit
7b7d8374
authored
Sep 01, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 01, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: NtWaitForMultipleObjects()'s third arguments means 'wait_any', not 'wait_all'.
parent
60de4977
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
7 deletions
+29
-7
sync.c
dlls/kernel32/sync.c
+1
-1
sync.c
dlls/kernel32/tests/sync.c
+25
-3
sync.c
dlls/ntdll/sync.c
+2
-2
threadpool.c
dlls/ntdll/threadpool.c
+1
-1
No files found.
dlls/kernel32/sync.c
View file @
7b7d8374
...
...
@@ -185,7 +185,7 @@ DWORD WINAPI WaitForMultipleObjectsEx( DWORD count, const HANDLE *handles,
}
}
status
=
NtWaitForMultipleObjects
(
count
,
hloc
,
wait_all
,
alertable
,
status
=
NtWaitForMultipleObjects
(
count
,
hloc
,
!
wait_all
,
alertable
,
get_nt_timeout
(
&
time
,
timeout
)
);
if
(
HIWORD
(
status
))
/* is it an error code? */
...
...
dlls/kernel32/tests/sync.c
View file @
7b7d8374
...
...
@@ -24,6 +24,7 @@
#include <stdio.h>
#include <windef.h>
#include <winbase.h>
#include <winternl.h>
#include "wine/test.h"
...
...
@@ -55,6 +56,7 @@ static VOID (WINAPI *pReleaseSRWLockExclusive)(PSRWLOCK);
static
VOID
(
WINAPI
*
pReleaseSRWLockShared
)(
PSRWLOCK
);
static
BOOLEAN
(
WINAPI
*
pTryAcquireSRWLockExclusive
)(
PSRWLOCK
);
static
BOOLEAN
(
WINAPI
*
pTryAcquireSRWLockShared
)(
PSRWLOCK
);
static
NTSTATUS
(
WINAPI
*
pNtWaitForMultipleObjects
)(
ULONG
,
const
HANDLE
*
,
BOOLEAN
,
BOOLEAN
,
const
LARGE_INTEGER
*
);
static
void
test_signalandwait
(
void
)
{
...
...
@@ -1153,15 +1155,32 @@ static void test_WaitForMultipleObjects(void)
}
/* a manual-reset event remains signaled, an auto-reset event is cleared */
r
=
WaitForMultipleObjects
(
MAXIMUM_WAIT_OBJECTS
,
maxevents
,
0
,
0
);
r
=
WaitForMultipleObjects
(
MAXIMUM_WAIT_OBJECTS
,
maxevents
,
FALSE
,
0
);
ok
(
r
==
WAIT_OBJECT_0
,
"should signal lowest handle first, got %d
\n
"
,
r
);
r
=
WaitForMultipleObjects
(
MAXIMUM_WAIT_OBJECTS
,
maxevents
,
0
,
0
);
r
=
WaitForMultipleObjects
(
MAXIMUM_WAIT_OBJECTS
,
maxevents
,
FALSE
,
0
);
ok
(
r
==
WAIT_OBJECT_0
,
"should signal handle #0 first, got %d
\n
"
,
r
);
ok
(
ResetEvent
(
maxevents
[
0
]),
"ResetEvent
\n
"
);
for
(
i
=
1
;
i
<
MAXIMUM_WAIT_OBJECTS
;
i
++
)
{
/* the lowest index is checked first and remaining events are untouched */
r
=
WaitForMultipleObjects
(
MAXIMUM_WAIT_OBJECTS
,
maxevents
,
0
,
0
);
r
=
WaitForMultipleObjects
(
MAXIMUM_WAIT_OBJECTS
,
maxevents
,
FALSE
,
0
);
ok
(
r
==
WAIT_OBJECT_0
+
i
,
"should signal handle #%d first, got %d
\n
"
,
i
,
r
);
}
/* run same test with Nt* call */
for
(
i
=
0
;
i
<
MAXIMUM_WAIT_OBJECTS
;
i
++
)
SetEvent
(
maxevents
[
i
]);
/* a manual-reset event remains signaled, an auto-reset event is cleared */
r
=
pNtWaitForMultipleObjects
(
MAXIMUM_WAIT_OBJECTS
,
maxevents
,
TRUE
,
FALSE
,
NULL
);
ok
(
r
==
WAIT_OBJECT_0
,
"should signal lowest handle first, got %d
\n
"
,
r
);
r
=
pNtWaitForMultipleObjects
(
MAXIMUM_WAIT_OBJECTS
,
maxevents
,
TRUE
,
FALSE
,
NULL
);
ok
(
r
==
WAIT_OBJECT_0
,
"should signal handle #0 first, got %d
\n
"
,
r
);
ok
(
ResetEvent
(
maxevents
[
0
]),
"ResetEvent
\n
"
);
for
(
i
=
1
;
i
<
MAXIMUM_WAIT_OBJECTS
;
i
++
)
{
/* the lowest index is checked first and remaining events are untouched */
r
=
pNtWaitForMultipleObjects
(
MAXIMUM_WAIT_OBJECTS
,
maxevents
,
TRUE
,
FALSE
,
NULL
);
ok
(
r
==
WAIT_OBJECT_0
+
i
,
"should signal handle #%d first, got %d
\n
"
,
i
,
r
);
}
...
...
@@ -2287,6 +2306,8 @@ static void test_srwlock_example(void)
START_TEST
(
sync
)
{
HMODULE
hdll
=
GetModuleHandleA
(
"kernel32.dll"
);
HMODULE
hntdll
=
GetModuleHandleA
(
"ntdll.dll"
);
pChangeTimerQueueTimer
=
(
void
*
)
GetProcAddress
(
hdll
,
"ChangeTimerQueueTimer"
);
pCreateTimerQueue
=
(
void
*
)
GetProcAddress
(
hdll
,
"CreateTimerQueue"
);
pCreateTimerQueueTimer
=
(
void
*
)
GetProcAddress
(
hdll
,
"CreateTimerQueueTimer"
);
...
...
@@ -2312,6 +2333,7 @@ START_TEST(sync)
pReleaseSRWLockShared
=
(
void
*
)
GetProcAddress
(
hdll
,
"ReleaseSRWLockShared"
);
pTryAcquireSRWLockExclusive
=
(
void
*
)
GetProcAddress
(
hdll
,
"TryAcquireSRWLockExclusive"
);
pTryAcquireSRWLockShared
=
(
void
*
)
GetProcAddress
(
hdll
,
"TryAcquireSRWLockShared"
);
pNtWaitForMultipleObjects
=
(
void
*
)
GetProcAddress
(
hntdll
,
"NtWaitForMultipleObjects"
);
test_signalandwait
();
test_mutex
();
...
...
dlls/ntdll/sync.c
View file @
7b7d8374
...
...
@@ -849,7 +849,7 @@ NTSTATUS WINAPI NtSetTimerResolution(IN ULONG resolution,
* NtWaitForMultipleObjects (NTDLL.@)
*/
NTSTATUS
WINAPI
NtWaitForMultipleObjects
(
DWORD
count
,
const
HANDLE
*
handles
,
BOOLEAN
wait_a
ll
,
BOOLEAN
alertable
,
BOOLEAN
wait_a
ny
,
BOOLEAN
alertable
,
const
LARGE_INTEGER
*
timeout
)
{
select_op_t
select_op
;
...
...
@@ -858,7 +858,7 @@ NTSTATUS WINAPI NtWaitForMultipleObjects( DWORD count, const HANDLE *handles,
if
(
!
count
||
count
>
MAXIMUM_WAIT_OBJECTS
)
return
STATUS_INVALID_PARAMETER_1
;
if
(
alertable
)
flags
|=
SELECT_ALERTABLE
;
select_op
.
wait
.
op
=
wait_a
ll
?
SELECT_WAIT_ALL
:
SELECT_WAIT
;
select_op
.
wait
.
op
=
wait_a
ny
?
SELECT_WAIT
:
SELECT_WAIT_ALL
;
for
(
i
=
0
;
i
<
count
;
i
++
)
select_op
.
wait
.
handles
[
i
]
=
wine_server_obj_handle
(
handles
[
i
]
);
return
server_select
(
&
select_op
,
offsetof
(
select_op_t
,
wait
.
handles
[
count
]
),
flags
,
timeout
);
}
...
...
dlls/ntdll/threadpool.c
View file @
7b7d8374
...
...
@@ -322,7 +322,7 @@ static DWORD CALLBACK wait_thread_proc(LPVOID Arg)
while
(
TRUE
)
{
status
=
NtWaitForMultipleObjects
(
2
,
handles
,
FALS
E
,
alertable
,
status
=
NtWaitForMultipleObjects
(
2
,
handles
,
TRU
E
,
alertable
,
get_nt_timeout
(
&
timeout
,
wait_work_item
->
Milliseconds
)
);
if
(
status
==
STATUS_WAIT_0
||
status
==
STATUS_TIMEOUT
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment