Commit 7a7440d2 authored by Zebediah Figura's avatar Zebediah Figura Committed by Vitaly Lipatov

ntdll: Implement NtResetEvent().

parent 491bc85e
...@@ -329,6 +329,21 @@ NTSTATUS esync_set_event( HANDLE handle ) ...@@ -329,6 +329,21 @@ NTSTATUS esync_set_event( HANDLE handle )
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
NTSTATUS esync_reset_event( HANDLE handle )
{
uint64_t value;
struct esync *obj;
TRACE("%p.\n", handle);
if (!(obj = get_cached_object( handle ))) return STATUS_INVALID_HANDLE;
if (read( obj->fd, &value, sizeof(value) ) == -1 && errno != EWOULDBLOCK && errno != EAGAIN)
ERR("read: %s\n", strerror(errno));
return STATUS_SUCCESS;
}
#define TICKSPERSEC 10000000 #define TICKSPERSEC 10000000
#define TICKSPERMSEC 10000 #define TICKSPERMSEC 10000
......
...@@ -28,6 +28,7 @@ extern NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ...@@ -28,6 +28,7 @@ extern NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev
extern NTSTATUS esync_create_event( HANDLE *handle, ACCESS_MASK access, 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_reset_event( HANDLE handle ) DECLSPEC_HIDDEN;
extern NTSTATUS esync_set_event( HANDLE handle ) DECLSPEC_HIDDEN; extern NTSTATUS esync_set_event( HANDLE handle ) DECLSPEC_HIDDEN;
extern NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any, extern NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any,
......
...@@ -463,8 +463,12 @@ NTSTATUS WINAPI NtSetEvent( HANDLE handle, LONG *prev_state ) ...@@ -463,8 +463,12 @@ NTSTATUS WINAPI NtSetEvent( HANDLE handle, LONG *prev_state )
*/ */
NTSTATUS WINAPI NtResetEvent( HANDLE handle, LONG *prev_state ) NTSTATUS WINAPI NtResetEvent( HANDLE handle, LONG *prev_state )
{ {
/* This comment is a dummy to make sure this patch applies in the right place. */
NTSTATUS ret; NTSTATUS ret;
if (do_esync())
return esync_reset_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