Commit f7072c8b authored by Zebediah Figura's avatar Zebediah Figura Committed by Vitaly Lipatov

ntdll: Implement NtQueryEvent().

parent 595bc6dd
......@@ -489,6 +489,26 @@ NTSTATUS esync_reset_event( HANDLE handle )
return STATUS_SUCCESS;
}
NTSTATUS esync_query_event( HANDLE handle, void *info, ULONG *ret_len )
{
struct esync *obj;
EVENT_BASIC_INFORMATION *out = info;
struct pollfd fd;
NTSTATUS ret;
TRACE("handle %p, info %p, ret_len %p.\n", handle, info, ret_len);
if ((ret = get_object( handle, &obj ))) return ret;
fd.fd = obj->fd;
fd.events = POLLIN;
out->EventState = poll( &fd, 1, 0 );
out->EventType = (obj->type == ESYNC_AUTO_EVENT ? SynchronizationEvent : NotificationEvent);
if (ret_len) *ret_len = sizeof(*out);
return STATUS_SUCCESS;
}
NTSTATUS esync_create_mutex( HANDLE *handle, ACCESS_MASK access,
const OBJECT_ATTRIBUTES *attr, BOOLEAN initial )
{
......
......@@ -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;
extern NTSTATUS esync_open_event( HANDLE *handle, ACCESS_MASK access,
const OBJECT_ATTRIBUTES *attr ) 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_set_event( HANDLE handle ) DECLSPEC_HIDDEN;
......
......@@ -540,6 +540,9 @@ NTSTATUS WINAPI NtQueryEvent( HANDLE handle, EVENT_INFORMATION_CLASS class,
if (len != sizeof(EVENT_BASIC_INFORMATION)) return STATUS_INFO_LENGTH_MISMATCH;
if (do_esync())
return esync_query_event( handle, info, ret_len );
SERVER_START_REQ( query_event )
{
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