#ifndef _NT_IPC_H_
#define _NT_IPC_H_
#include "nt_abi.h"
#include "nt_object.h"
/* friendly ipc guids */
#define NT_IPC_GUID_SEMCTL {0xe47c05df,0x5f5c,0x4762,{0xa2,0x79,0xd2,0x82,0xf5,0x39,0xea,0xdf}}
#define NT_IPC_GUID_SEMKEY {0xc6e442c3,0x2ac5,0x4d1d,{0x92,0xf3,0x6e,0x10,0xc6,0x1f,0x53,0x79}}
#define NT_IPC_GUID_SEMPID {0x571ac9bb,0x22eb,0x43f2,{0x8d,0xd6,0x64,0x39,0x49,0xa6,0xe9,0x1f}}
/* friendly ipc object directory prefixes */
#define NT_IPC_OBJDIR_PREFIX_SEMCTL {'s','e','m','c','t','l'}
#define NT_IPC_OBJDIR_PREFIX_SEMKEY {'s','e','m','k','e','y'}
#define NT_IPC_OBJDIR_PREFIX_SEMPID {'s','e','m','p','i','d'}
/* ipc commands */
#define NT_IPC_CMD_RMID (0)
#define NT_IPC_CMD_SET (1)
#define NT_IPC_CMD_STAT (2)
#define NT_IPC_CMD_INFO (3)
/* ipc special keys */
#define NT_IPC_KEY_PRIVATE (0)
/* ipc extension interfaces */
typedef int32_t __stdcall ntapi_ipc_create_pipe(
__out void ** hpipe_read,
__out void ** hpipe_write,
__in uint32_t advisory_buffer_size);
typedef int32_t __stdcall ntapi_ipc_connect_by_attr(
__out void ** hport,
__in nt_port_attr * attr);
typedef int32_t __stdcall ntapi_ipc_connect_by_name(
__out void ** hport,
__in nt_port_name * name);
typedef int32_t __stdcall ntapi_ipc_connect_by_symlink(
__out void ** hport,
__in void * hsymlink);
typedef int32_t __stdcall ntapi_ipc_connect_by_port(
__in void * hconn,
__in nt_port_attr * attr);
typedef int32_t __stdcall ntapi_ipc_connect_section_by_attr(
__out void ** hport,
__in nt_port_attr * attr,
__out void ** hsection,
__out void ** section_addr,
__out size_t * section_size);
typedef int32_t __stdcall ntapi_ipc_connect_section_by_name(
__out void ** hport,
__in nt_port_name * name,
__out void ** hsection,
__out void ** section_addr,
__out size_t * section_size);
typedef int32_t __stdcall ntapi_ipc_connect_section_by_symlink(
__out void ** hport,
__in void * hsymlink,
__out void ** hsection,
__out void ** section_addr,
__out size_t * section_size);
typedef int32_t __stdcall ntapi_ipc_connect_section_by_port(
__in void * hconn,
__in nt_port_attr * attr,
__out void ** hsection,
__out void ** section_addr,
__out size_t * section_size);
typedef int32_t __stdcall ntapi_ipc_get_port_by_attr(
__out void ** hport,
__in nt_port_attr * attr);
typedef int32_t __stdcall ntapi_ipc_get_port_section_by_attr(
__out void ** hport,
__in nt_port_attr * attr,
__out void ** hsection,
__out void ** section_addr,
__out size_t * section_size);
typedef int32_t __stdcall ntapi_ipc_init_section_by_port(
__in void * hconn,
__out void ** hsection,
__out void ** section_addr,
__out size_t * section_size);
typedef int32_t __stdcall ntapi_ipc_disconnect_unmap_section_by_port(
__in void * hconn);
#endif