From 9faf9a067cfeaa786ac1784fb8bf4eece49922e9 Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 30 Jul 2017 21:21:21 +0000 Subject: subsystem interfaces: integrated sysv semaphore client-side interfaces. --- include/ntapi/nt_process.h | 10 +++++++ include/ntapi/nt_sem.h | 74 ++++++++++++++++++++++++++++++++++++++++++++++ include/ntapi/ntapi.h | 11 +++++++ 3 files changed, 95 insertions(+) (limited to 'include') diff --git a/include/ntapi/nt_process.h b/include/ntapi/nt_process.h index 1336d31..96bc727 100644 --- a/include/ntapi/nt_process.h +++ b/include/ntapi/nt_process.h @@ -460,6 +460,12 @@ typedef struct _nt_runtime_data { void * hloader; void * hcwd; void * hdrive; + void * hsemctl; + void * hsempid; + void * hsemctldir; + void * hsemkeydir; + void * hsempiddir; + void * hreserved; nt_guid abi; nt_cid cid_self; nt_cid cid_parent; @@ -499,6 +505,10 @@ typedef struct _nt_runtime_data { int32_t ppid_type; int32_t ppid_subtype; uint32_t ppid_keys[6]; + nt_guid semctl_guid; + int32_t semctl_type; + int32_t semctl_subtype; + uint32_t semctl_keys[6]; int32_t stdin_type; int32_t stdout_type; int32_t stderr_type; diff --git a/include/ntapi/nt_sem.h b/include/ntapi/nt_sem.h index 768007d..4b6c79b 100644 --- a/include/ntapi/nt_sem.h +++ b/include/ntapi/nt_sem.h @@ -63,4 +63,78 @@ typedef struct _nt_sem_op { int16_t semflag; } nt_sem_op; + +/* semaphore client interfaces */ +typedef int32_t __stdcall ntapi_sem_create( + __in void * hport, + __out nt_sem_info * sem, + __in uint32_t access, + __in nt_object_attributes * oa, + __out nt_iosb * iosb, + __in uint32_t share, + __in uint32_t nslots); + + +typedef int32_t __stdcall ntapi_sem_open( + __in void * hport, + __out nt_sem_info * sem, + __in uint32_t access, + __in nt_object_attributes * oa, + __out nt_iosb * iosb, + __in uint32_t share, + __in uint32_t nslots); + + +typedef int32_t __stdcall ntapi_sem_fcntl( + __in nt_sem_info * sem, + __in void * hevent __optional, + __in nt_io_apc_routine * apc_routine __optional, + __in void * apc_context __optional, + __out nt_iosb * iosb, + __in uint32_t tty_control_code, + __in void * input_buffer __optional, + __in uint32_t input_buffer_length, + __out void * output_buffer __optional, + __in uint32_t output_buffer_length); + + +typedef int32_t __stdcall ntapi_sem_ioctl( + __in nt_sem_info * sem, + __in void * hevent __optional, + __in nt_io_apc_routine * apc_routine __optional, + __in void * apc_context __optional, + __out nt_iosb * iosb, + __in uint32_t ipc_control_code, + __in void * input_buffer __optional, + __in uint32_t input_buffer_length, + __out void * output_buffer __optional, + __in uint32_t output_buffer_length); + + +typedef int32_t __stdcall ntapi_sem_query( + __in nt_sem_info * sem, + __out nt_io_status_block * iosb, + __out void * sem_info, + __in uint32_t sem_info_length, + __in int32_t sem_ipc_cmd); + + +typedef int32_t __stdcall ntapi_sem_set( + __in nt_sem_info * sem, + __out nt_io_status_block * iosb, + __in void * sem_info, + __in uint32_t sem_info_length, + __in int32_t sem_ipc_cmd); + + +typedef int32_t __stdcall ntapi_sem_cancel( + __in nt_sem_info * sem, + __out nt_iosb * iosb); + + +typedef int32_t __stdcall ntapi_sem_free( + __in nt_sem_info * sem, + __out nt_iosb * iosb); + + #endif diff --git a/include/ntapi/ntapi.h b/include/ntapi/ntapi.h index 7e8208c..23a99aa 100644 --- a/include/ntapi/ntapi.h +++ b/include/ntapi/ntapi.h @@ -41,6 +41,7 @@ #include "nt_stat.h" #include "nt_statfs.h" #include "nt_daemon.h" +#include "nt_sem.h" #include "nt_vfd.h" #include "nt_tty.h" #include "nt_hash.h" @@ -400,6 +401,16 @@ typedef struct _ntapi_vtbl { ntapi_ipc_disconnect_unmap_section_by_port * ipc_disconnect_unmap_section_by_port; ntapi_ipc_create_pipe * ipc_create_pipe; + /* nt_sem.h */ + ntapi_sem_create * sem_create; + ntapi_sem_open * sem_open; + ntapi_sem_fcntl * sem_fcntl; + ntapi_sem_ioctl * sem_ioctl; + ntapi_sem_query * sem_query; + ntapi_sem_set * sem_set; + ntapi_sem_cancel * sem_cancel; + ntapi_sem_free * sem_free; + /* nt_ldr.h */ ntapi_ldr_load_system_dll * ldr_load_system_dll; ntapi_ldr_create_state_snapshot * ldr_create_state_snapshot; -- cgit v1.2.3