Blame src/sync/ntapi_tt_wait_for_dummy_event.c

dd89bb
/********************************************************/
dd89bb
/*  ntapi: Native API core library                      */
4256e2
/*  Copyright (C) 2013--2016  Z. Gilboa                 */
dd89bb
/*  Released under GPLv2 and GPLv3; see COPYING.NTAPI.  */
dd89bb
/********************************************************/
dd89bb
dd89bb
#include <psxtypes/psxtypes.h>
dd89bb
#include <ntapi/nt_object.h>
dd89bb
#include <ntapi/nt_sync.h>
dd89bb
#include <ntapi/ntapi.h>
dd89bb
#include "ntapi_impl.h"
dd89bb
dd89bb
int32_t __stdcall __ntapi_tt_wait_for_dummy_event(void)
dd89bb
{
dd89bb
	/* wait forever without setting a break point and without spinning */
dd89bb
dd89bb
	int32_t		status;
dd89bb
	void * 		hevent;
dd89bb
8d87a0
	if ((status = __ntapi->tt_create_private_event(
dd89bb
			&hevent,
dd89bb
			NT_NOTIFICATION_EVENT,
8d87a0
			NT_EVENT_NOT_SIGNALED)))
dd89bb
		return status;
dd89bb
8d87a0
	status = __ntapi->zw_wait_for_single_object(hevent,0,0);
dd89bb
8d87a0
	__ntapi->zw_close(hevent);
dd89bb
	return status;
dd89bb
}