Commit 2f0af79e authored by Zebediah Figura's avatar Zebediah Figura Committed by Vitaly Lipatov

ntdll: Implement NtPulseEvent().

parent 73b36a1f
...@@ -600,6 +600,31 @@ NTSTATUS esync_reset_event( HANDLE handle ) ...@@ -600,6 +600,31 @@ NTSTATUS esync_reset_event( HANDLE handle )
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
NTSTATUS esync_pulse_event( HANDLE handle )
{
uint64_t value = 1;
struct esync *obj;
NTSTATUS ret;
TRACE("%p.\n", handle);
if ((ret = get_object( handle, &obj ))) return ret;
/* This isn't really correct; an application could miss the write.
* Unfortunately we can't really do much better. Fortunately this is rarely
* used (and publicly deprecated). */
if (write( obj->fd, &value, sizeof(value) ) == -1)
return errno_to_status( errno );
/* Try to give other threads a chance to wake up. Hopefully erring on this
* side is the better thing to do... */
NtYieldExecution();
read( obj->fd, &value, sizeof(value) );
return STATUS_SUCCESS;
}
NTSTATUS esync_query_event( HANDLE handle, void *info, ULONG *ret_len ) NTSTATUS esync_query_event( HANDLE handle, void *info, ULONG *ret_len )
{ {
struct esync *obj; struct esync *obj;
......
...@@ -33,6 +33,7 @@ extern NTSTATUS esync_create_event( HANDLE *handle, ACCESS_MASK access, ...@@ -33,6 +33,7 @@ extern NTSTATUS esync_create_event( HANDLE *handle, ACCESS_MASK access,
const OBJECT_ATTRIBUTES *attr, EVENT_TYPE type, BOOLEAN initial ) DECLSPEC_HIDDEN; const OBJECT_ATTRIBUTES *attr, EVENT_TYPE type, BOOLEAN initial ) DECLSPEC_HIDDEN;
extern NTSTATUS esync_open_event( HANDLE *handle, ACCESS_MASK access, extern NTSTATUS esync_open_event( HANDLE *handle, ACCESS_MASK access,
const OBJECT_ATTRIBUTES *attr ) DECLSPEC_HIDDEN; const OBJECT_ATTRIBUTES *attr ) DECLSPEC_HIDDEN;
extern NTSTATUS esync_pulse_event( HANDLE handle ) DECLSPEC_HIDDEN;
extern NTSTATUS esync_query_event( HANDLE handle, void *info, ULONG *ret_len ) DECLSPEC_HIDDEN; extern NTSTATUS esync_query_event( HANDLE handle, void *info, ULONG *ret_len ) DECLSPEC_HIDDEN;
extern NTSTATUS esync_reset_event( HANDLE handle ) DECLSPEC_HIDDEN; extern NTSTATUS esync_reset_event( HANDLE handle ) DECLSPEC_HIDDEN;
extern NTSTATUS esync_set_event( HANDLE handle ) DECLSPEC_HIDDEN; extern NTSTATUS esync_set_event( HANDLE handle ) DECLSPEC_HIDDEN;
......
...@@ -508,6 +508,9 @@ NTSTATUS WINAPI NtPulseEvent( HANDLE handle, LONG *prev_state ) ...@@ -508,6 +508,9 @@ NTSTATUS WINAPI NtPulseEvent( HANDLE handle, LONG *prev_state )
{ {
NTSTATUS ret; NTSTATUS ret;
if (do_esync())
return esync_pulse_event( handle );
SERVER_START_REQ( event_op ) SERVER_START_REQ( event_op )
{ {
req->handle = wine_server_obj_handle( handle ); req->handle = wine_server_obj_handle( handle );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment