Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
7ba361b4
Commit
7ba361b4
authored
Mar 11, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add support for returning previous state argument in event functions.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d3660e59
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
17 additions
and
14 deletions
+17
-14
sync.c
dlls/ntdll/sync.c
+3
-7
om.c
dlls/ntdll/tests/om.c
+0
-5
server_protocol.h
include/wine/server_protocol.h
+3
-1
event.c
server/event.c
+1
-0
protocol.def
server/protocol.def
+2
-0
request.h
server/request.h
+2
-0
trace.c
server/trace.c
+6
-1
No files found.
dlls/ntdll/sync.c
View file @
7ba361b4
...
...
@@ -405,14 +405,12 @@ NTSTATUS WINAPI NtOpenEvent( HANDLE *handle, ACCESS_MASK access, const OBJECT_AT
NTSTATUS
WINAPI
NtSetEvent
(
HANDLE
handle
,
LONG
*
prev_state
)
{
NTSTATUS
ret
;
/* FIXME: set NumberOfThreadsReleased */
SERVER_START_REQ
(
event_op
)
{
req
->
handle
=
wine_server_obj_handle
(
handle
);
req
->
op
=
SET_EVENT
;
ret
=
wine_server_call
(
req
);
if
(
!
ret
&&
prev_state
)
*
prev_state
=
reply
->
state
;
}
SERVER_END_REQ
;
return
ret
;
...
...
@@ -424,15 +422,12 @@ NTSTATUS WINAPI NtSetEvent( HANDLE handle, LONG *prev_state )
NTSTATUS
WINAPI
NtResetEvent
(
HANDLE
handle
,
LONG
*
prev_state
)
{
NTSTATUS
ret
;
/* resetting an event can't release any thread... */
if
(
prev_state
)
*
prev_state
=
0
;
SERVER_START_REQ
(
event_op
)
{
req
->
handle
=
wine_server_obj_handle
(
handle
);
req
->
op
=
RESET_EVENT
;
ret
=
wine_server_call
(
req
);
if
(
!
ret
&&
prev_state
)
*
prev_state
=
reply
->
state
;
}
SERVER_END_REQ
;
return
ret
;
...
...
@@ -464,6 +459,7 @@ NTSTATUS WINAPI NtPulseEvent( HANDLE handle, LONG *prev_state )
req
->
handle
=
wine_server_obj_handle
(
handle
);
req
->
op
=
PULSE_EVENT
;
ret
=
wine_server_call
(
req
);
if
(
!
ret
&&
prev_state
)
*
prev_state
=
reply
->
state
;
}
SERVER_END_REQ
;
return
ret
;
...
...
dlls/ntdll/tests/om.c
View file @
7ba361b4
...
...
@@ -1622,7 +1622,6 @@ static void test_event(void)
status
=
pNtPulseEvent
(
Event
,
&
prev_state
);
ok
(
status
==
STATUS_SUCCESS
,
"NtPulseEvent failed %08x
\n
"
,
status
);
todo_wine
ok
(
!
prev_state
,
"prev_state = %x
\n
"
,
prev_state
);
status
=
pNtQueryEvent
(
Event
,
EventBasicInformation
,
&
info
,
sizeof
(
info
),
NULL
);
...
...
@@ -1643,17 +1642,14 @@ static void test_event(void)
status
=
pNtSetEvent
(
Event
,
&
prev_state
);
ok
(
status
==
STATUS_SUCCESS
,
"NtSetEvent failed: %08x
\n
"
,
status
);
todo_wine
ok
(
!
prev_state
,
"prev_state = %x
\n
"
,
prev_state
);
status
=
pNtSetEvent
(
Event
,
&
prev_state
);
ok
(
status
==
STATUS_SUCCESS
,
"NtSetEvent failed: %08x
\n
"
,
status
);
todo_wine
ok
(
prev_state
==
1
,
"prev_state = %x
\n
"
,
prev_state
);
status
=
pNtResetEvent
(
Event
,
&
prev_state
);
ok
(
status
==
STATUS_SUCCESS
,
"NtSetEvent failed: %08x
\n
"
,
status
);
todo_wine
ok
(
prev_state
==
1
,
"prev_state = %x
\n
"
,
prev_state
);
status
=
pNtResetEvent
(
Event
,
&
prev_state
);
...
...
@@ -1670,7 +1666,6 @@ static void test_event(void)
status
=
pNtPulseEvent
(
Event
,
&
prev_state
);
ok
(
status
==
STATUS_SUCCESS
,
"NtPulseEvent failed %08x
\n
"
,
status
);
todo_wine
ok
(
prev_state
==
1
,
"prev_state = %x
\n
"
,
prev_state
);
pNtClose
(
Event
);
...
...
include/wine/server_protocol.h
View file @
7ba361b4
...
...
@@ -1247,6 +1247,8 @@ struct event_op_request
struct
event_op_reply
{
struct
reply_header
__header
;
int
state
;
char
__pad_12
[
4
];
};
enum
event_op
{
PULSE_EVENT
,
SET_EVENT
,
RESET_EVENT
};
...
...
@@ -6554,6 +6556,6 @@ union generic_reply
struct
terminate_job_reply
terminate_job_reply
;
};
#define SERVER_PROTOCOL_VERSION 57
2
#define SERVER_PROTOCOL_VERSION 57
3
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
server/event.c
View file @
7ba361b4
...
...
@@ -311,6 +311,7 @@ DECL_HANDLER(event_op)
struct
event
*
event
;
if
(
!
(
event
=
get_event_obj
(
current
->
process
,
req
->
handle
,
EVENT_MODIFY_STATE
)))
return
;
reply
->
state
=
event
->
signaled
;
switch
(
req
->
op
)
{
case
PULSE_EVENT
:
...
...
server/protocol.def
View file @
7ba361b4
...
...
@@ -1080,6 +1080,8 @@ struct rawinput_device
@REQ(event_op)
obj_handle_t handle; /* handle to event */
int op; /* event operation (see below) */
@REPLY
int state; /* previous state */
@END
enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
...
...
server/request.h
View file @
7ba361b4
...
...
@@ -931,6 +931,8 @@ C_ASSERT( sizeof(struct create_event_reply) == 16 );
C_ASSERT
(
FIELD_OFFSET
(
struct
event_op_request
,
handle
)
==
12
);
C_ASSERT
(
FIELD_OFFSET
(
struct
event_op_request
,
op
)
==
16
);
C_ASSERT
(
sizeof
(
struct
event_op_request
)
==
24
);
C_ASSERT
(
FIELD_OFFSET
(
struct
event_op_reply
,
state
)
==
8
);
C_ASSERT
(
sizeof
(
struct
event_op_reply
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
query_event_request
,
handle
)
==
12
);
C_ASSERT
(
sizeof
(
struct
query_event_request
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
query_event_reply
,
manual_reset
)
==
8
);
...
...
server/trace.c
View file @
7ba361b4
...
...
@@ -1594,6 +1594,11 @@ static void dump_event_op_request( const struct event_op_request *req )
fprintf
(
stderr
,
", op=%d"
,
req
->
op
);
}
static
void
dump_event_op_reply
(
const
struct
event_op_reply
*
req
)
{
fprintf
(
stderr
,
" state=%d"
,
req
->
state
);
}
static
void
dump_query_event_request
(
const
struct
query_event_request
*
req
)
{
fprintf
(
stderr
,
" handle=%04x"
,
req
->
handle
);
...
...
@@ -4865,7 +4870,7 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
(
dump_func
)
dump_open_thread_reply
,
(
dump_func
)
dump_select_reply
,
(
dump_func
)
dump_create_event_reply
,
NULL
,
(
dump_func
)
dump_event_op_reply
,
(
dump_func
)
dump_query_event_reply
,
(
dump_func
)
dump_open_event_reply
,
(
dump_func
)
dump_create_keyed_event_reply
,
...
...
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