summaryrefslogtreecommitdiffhomepage
path: root/src/internal/ptycon_init_impl.h
blob: 0660038dc33149b06e00d87be8aa75c8acc02a74 (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
#ifndef PTYCON_INIT_IMPL_H
#define PTYCON_INIT_IMPL_H

#include <ntapi/ntapi.h>
#include <ntapi/nt_atomic.h>

extern const ntapi_vtbl * ptyc_ntapi;

static inline int ptyc_init(void)
{
	int32_t		status;
	ntapi_vtbl * 	pvtbl;

	if ((status = ntapi_init(&pvtbl)))
		return status;

	at_locked_cas(
		(intptr_t *)&ptyc_ntapi,
		0,(intptr_t)pvtbl);

	return 0;
}

#endif