2020-06-15 14:18:57 +00:00
|
|
|
#ifndef COSMOPOLITAN_LIBC_NT_IPC_H_
|
|
|
|
#define COSMOPOLITAN_LIBC_NT_IPC_H_
|
|
|
|
#if 0
|
|
|
|
/* ░░░░
|
|
|
|
▒▒▒░░░▒▒▒▒▒▒▒▓▓▓░
|
|
|
|
▒▒▒▒░░░▒▒▒▒▒▒▓▓▓▓▓▓░
|
|
|
|
▒▒▒▒░░░▒▒▒▒▒▒▒▓▓▓▓▓▓ ▒▓░
|
|
|
|
▒▒▒░░░░▒▒▒▒▒▒▓▓▓▓▓▓ ▓▓▓▓▓▓▒ ▒▒▒▓▓█
|
|
|
|
▒▒▒▒░░░▒▒▒▒▒▒▒▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓▓
|
|
|
|
░▒▒▒░░░░▒▒▒▒▒▒▓▓▓▓▓▓ █▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓█
|
|
|
|
▒▒▒▒░░░▒▒▒▒▒▒▒▓▓▓▓▓░ ▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓▓
|
|
|
|
▒▒▒▒░░░▒▒▒▒▒▒▒▓▓▓▓▓▓ ▒▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓▒
|
|
|
|
▒▒▒▒▓▓ ▓▒▒▓▓▓▓ ▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓█
|
|
|
|
▒▓ ▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓
|
|
|
|
░░░░░░░░░░░▒▒▒▒ ▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓█
|
|
|
|
▒▒░░░░░░░░░░▒▒▒▒▒▓▓▓ ▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓▓
|
|
|
|
░▒░░░░░░░░░░░▒▒▒▒▒▓▓ ▓░ ░▓███▓
|
|
|
|
▒▒░░░░░░░░░░▒▒▒▒▒▓▓░ ▒▓▓▓▒▒▒ ░▒▒▒▓ ████████████
|
|
|
|
▒▒░░░░░░░░░░░▒▒▒▒▒▓▓ ▒▓▓▓▓▒▒▒▒▒▒▒▒░░░▒▒▒▒▒░ ░███
|
|
|
|
▒░░░░░░░░░░░▒▒▒▒▒▓▓ ▓▓▓▓▒▒▒▒▒▒▒▒░░░░▒▒▒▒▓ ███
|
|
|
|
▒▒░░░░░░░░░░▒▒▒▒▒▒▓▓ ▒▓▓▓▒▒▒▒▒▒▒▒░░░░▒▒▒▒▒ ▓██
|
|
|
|
▒░░░░░░░░░░░▒▒▒▒▒▓▓ ▓▓▓▓▒▒▒▒▒▒▒▒░░░▒▒▒▒▒▓ ▓██
|
|
|
|
▒▒░░░▒▒▒░░░▒▒░▒▒▒▓▓▒ ▒▓▓▓▒▒▒▒▒▒▒▒░░░░▒▒▒▒▒ ███
|
|
|
|
░▒▓ ░▓▓▓▓▒▒▒▒▒▒▒▒░░░░▒▒▒▒▓ ▓██
|
|
|
|
╔────────────────────────────────────────────────────────────────▀▀▀─────────│─╗
|
|
|
|
│ cosmopolitan § new technology » ipc ─╬─│┼
|
|
|
|
╚────────────────────────────────────────────────────────────────────────────│*/
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* CreateNamedPipe:dwOpenMode */
|
2020-10-11 04:18:53 +00:00
|
|
|
#define kNtPipeAccessInbound 0x00000001
|
2020-06-15 14:18:57 +00:00
|
|
|
#define kNtPipeAccessOutbound 0x00000002
|
2020-10-11 04:18:53 +00:00
|
|
|
#define kNtPipeAccessDuplex 0x00000003
|
2020-06-15 14:18:57 +00:00
|
|
|
|
|
|
|
/* CreateNamedPipe::dwPipeMode */
|
2020-10-11 04:18:53 +00:00
|
|
|
#define kNtPipeWait 0x00000000
|
|
|
|
#define kNtPipeNowait 0x00000001
|
|
|
|
#define kNtPipeReadmodeByte 0x00000000
|
|
|
|
#define kNtPipeReadmodeMessage 0x00000002
|
|
|
|
#define kNtPipeTypeByte 0x00000000
|
|
|
|
#define kNtPipeTypeMessage 0x00000004
|
2020-06-15 14:18:57 +00:00
|
|
|
#define kNtPipeAcceptRemoteClients 0x00000000
|
|
|
|
#define kNtPipeRejectRemoteClients 0x00000008
|
|
|
|
|
|
|
|
/* CreateNamedPipe::nMaxInstances */
|
|
|
|
#define NT_PIPE_UNLIMITED_INSTANCES 255
|
|
|
|
|
|
|
|
/* CreateNamedPipeInfo */
|
|
|
|
#define PIPE_CLIENT_END 0x00000000
|
|
|
|
#define PIPE_SERVER_END 0x00000001
|
|
|
|
|
|
|
|
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
|
|
|
COSMOPOLITAN_C_START_
|
|
|
|
|
|
|
|
struct NtOverlapped;
|
|
|
|
struct NtSecurityAttributes;
|
|
|
|
|
2020-10-11 04:18:53 +00:00
|
|
|
bool32 CreatePipe(int64_t *out_hReadPipe, int64_t *out_hWritePipe,
|
|
|
|
const struct NtSecurityAttributes *opt_lpPipeAttributes,
|
|
|
|
uint32_t nSize) paramsnonnull((1, 2));
|
|
|
|
|
|
|
|
int64_t CreateNamedPipe(
|
2020-06-15 14:18:57 +00:00
|
|
|
const char16_t *lpName, uint32_t dwOpenMode, uint32_t dwPipeMode,
|
|
|
|
uint32_t nMaxInstances, uint32_t nOutBufferSize, uint32_t nInBufferSize,
|
|
|
|
uint32_t nDefaultTimeOut,
|
|
|
|
const struct NtSecurityAttributes *opt_lpSecurityAttributes)
|
|
|
|
paramsnonnull((1));
|
2020-10-11 04:18:53 +00:00
|
|
|
|
2020-06-15 14:18:57 +00:00
|
|
|
bool32 CallNamedPipe(const char16_t *lpNamedPipeName, void *lpInBuffer,
|
|
|
|
uint32_t nInBufferSize, void *lpOutBuffer,
|
|
|
|
uint32_t nOutBufferSize, uint32_t *lpBytesRead,
|
|
|
|
uint32_t nTimeOut);
|
2020-10-11 04:18:53 +00:00
|
|
|
|
|
|
|
bool32 ConnectNamedPipe(int64_t *hNamedPipe, struct NtOverlapped *lpOverlapped);
|
2020-06-15 14:18:57 +00:00
|
|
|
bool32 WaitNamedPipe(const char16_t *lpNamedPipeName, uint32_t nTimeOut);
|
|
|
|
bool32 DisconnectNamedPipe(int64_t *hNamedPipe);
|
2020-10-11 04:18:53 +00:00
|
|
|
|
2020-06-15 14:18:57 +00:00
|
|
|
bool32 SetNamedPipeHandleState(int64_t *hNamedPipe, uint32_t *lpMode,
|
|
|
|
uint32_t *lpMaxCollectionCount,
|
|
|
|
uint32_t *lpCollectDataTimeout);
|
2020-10-11 04:18:53 +00:00
|
|
|
|
2020-06-15 14:18:57 +00:00
|
|
|
bool32 PeekNamedPipe(int64_t *hNamedPipe, void *lpBuffer, uint32_t nBufferSize,
|
|
|
|
uint32_t *lpBytesRead, uint32_t *lpTotalBytesAvail,
|
|
|
|
uint32_t *lpBytesLeftThisMessage);
|
2020-10-11 04:18:53 +00:00
|
|
|
|
2020-06-15 14:18:57 +00:00
|
|
|
bool32 TransactNamedPipe(int64_t *hNamedPipe, void *lpInBuffer,
|
|
|
|
uint32_t nInBufferSize, void *lpOutBuffer,
|
|
|
|
uint32_t nOutBufferSize, uint32_t *lpBytesRead,
|
|
|
|
struct NtOverlapped *lpOverlapped);
|
|
|
|
|
|
|
|
COSMOPOLITAN_C_END_
|
|
|
|
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
|
|
|
#endif /* COSMOPOLITAN_LIBC_NT_IPC_H_ */
|