Impossible OS Docs

Win32 IPC Extensions

What is it?

The Windows inter-process communication surface beyond ALPC: named pipes, mailslots, I/O completion ports, named synchronisation objects, legacy LPC and an asynchronous submission ring. Anonymous pipes, a fixed-size completion port pool and the named event, mutant and semaphore objects exist today; named pipe servers, mailslots, LPC and the submission ring do not.

How does it work?

Anonymous pipes. pipe.c keeps a pool of PIPE_MAX (16) pipes, each with a PIPE_BUF_SIZE (4096 byte) ring buffer, created by pipe_create() and reached from user mode through SYS_PIPE. NtCreateNamedPipeFile is registered, but it creates an anonymous pipe through the same path: there is no \Device\NamedPipe\ namespace and no server endpoint.

I/O completion ports. nt_file.c keeps 16 ports in a static pool; each IO_COMPLETION_PORT is a ring of IOCP_MAX_ENTRIES (64) completion entries guarded by a spinlock (nt_file.h). NtCreateIoCompletion, NtSetIoCompletion and NtRemoveIoCompletion are registered, and ALPC posts message completions to a port with io_completion_post(). Ports are not Object Manager objects and cannot yet be associated with file handles.

Named sync objects. Events, mutants and semaphores are Object Manager objects with names, created through NtCreateEvent, NtCreateMutant and NtCreateSemaphore (see Synchronisation Primitives).

ALPC ships as its own subsystem, documented in ALPC and Message Ports; this roadmap owns only its extensions.

Stubs. NtCreateMailslotFile returns STATUS_INVALID_DEVICE_REQUEST, and all fifteen LPC services in nt_lpc.c return STATUS_NOT_IMPLEMENTED.

flowchart LR
    U[User process] -->|SYS_PIPE / NtCreateNamedPipeFile| P[anonymous pipe pool, 16 x 4 KiB]
    U -->|NtCreateIoCompletion| C[IOCP pool, 16 x 64 entries]
    A[ALPC ports] -->|io_completion_post| C
    U -->|NtRemoveIoCompletion| C

What are its interfaces?

Interface Purpose
pipe_create(), pipe_close(), SYS_PIPE Anonymous pipes (pipe.h)
NtCreateNamedPipeFile Registered; creates an anonymous pipe (nt_syscall.c)
NtCreateIoCompletion, NtSetIoCompletion, NtRemoveIoCompletion, io_completion_post() Completion ports (nt_file.c)
AlpcAssociateCompletionPort() Route ALPC messages to a completion port (alpc_port.h)
NtCreateMailslotFile, LPC services Registered stubs

How do I use it?

A Win32 program can create an anonymous pipe pair and a completion port today; CreateNamedPipe servers and mailslots fail. Pipes are tested in test_ipc.c and completion ports through ALPC in test_alpc.c:

bash scripts/test.sh SUITE=ipc
bash scripts/test.sh SUITE=abi

What is not implemented yet?

How does it compare with Windows 11 and Linux?

Windows 11 has named pipes, mailslots, completion ports, named sync objects, LPC and ALPC; Linux has byte-stream FIFOs, no mailslots, and epoll and io_uring in place of completion ports. Impossible OS has ALPC, anonymous pipes, a small completion port pool and named sync objects, with every row of the roadmap's table still open. The planned addition beyond both is ImpossibleRing, a submission ring in the style of io_uring that works for every handle type.

See also

Impossible OS is free software under the GPL-3.0-only license. Last updated Edit this page on GitHub