summaryrefslogtreecommitdiffhomepage
path: root/src/sync/ntapi_tt_wait_for_dummy_event.c
blob: 436d028a67be8afb823e512ddf9ebf87cb7a1b8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/********************************************************/
/*  ntapi: Native API core library                      */
/*  Copyright (C) 2013--2017  Z. Gilboa                 */
/*  Released under GPLv2 and GPLv3; see COPYING.NTAPI.  */
/********************************************************/

#include <psxtypes/psxtypes.h>
#include <ntapi/nt_object.h>
#include <ntapi/nt_sync.h>
#include <ntapi/ntapi.h>
#include "ntapi_impl.h"

int32_t __stdcall __ntapi_tt_wait_for_dummy_event(void)
{
	/* wait forever without setting a break point and without spinning */

	int32_t		status;
	void * 		hevent;

	if ((status = __ntapi->tt_create_private_event(
			&hevent,
			NT_NOTIFICATION_EVENT,
			NT_EVENT_NOT_SIGNALED)))
		return status;

	status = __ntapi->zw_wait_for_single_object(hevent,0,0);

	__ntapi->zw_close(hevent);
	return status;
}