#ifndef _NTLPCAPI_H
NTSYSCALLAPI
NTSTATUS
NTAPI
NtAcceptConnectPort(
    _Out_ PHANDLE PortHandle,
    _In_opt_ PVOID PortContext,
    _In_ PPORT_MESSAGE ConnectionRequest,
    _In_ BOOLEAN AcceptConnection,
    _Inout_opt_ PPORT_VIEW ServerView,
    _Out_opt_ PREMOTE_PORT_VIEW ClientView
    );
View code on GitHub#ifndef _NTZWAPI_H
// This file was automatically generated. Do not edit.
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwAcceptConnectPort(
    _Out_ PHANDLE PortHandle,
    _In_opt_ PVOID PortContext,
    _In_ PPORT_MESSAGE ConnectionRequest,
    _In_ BOOLEAN AcceptConnection,
    _Inout_opt_ PPORT_VIEW ServerView,
    _Out_opt_ PREMOTE_PORT_VIEW ClientView
    );
View code on GitHubNtAcceptConnectPort function is used in LPC communication by server process for establish connection with client. It should be called after NtListenPort completes.
Result of call - HANDLE to Port Object for established connection.
Pointer to LPC_MESSAGE structure received from NtListenPort.
If not set, connection on client's side will be refused.
If connection uses large data buffers, and a HANDLE to Section Object for shared memory window is created on server side, server process shout set this parameter to pointer to LPC_SECTION_OWNER_MEMORY structure with filled SectionHandle member.
Similar to ServerSharedMemory, but when connection client create Section Object. In this case server doesn't know section's HANDLE, but shared memory window is automatically mapped to his address space. Size and base address of mapped memory are returned in LPC_SECTION_MEMORY structure.
This function returns HANDLE to newly created Port Object. All other LPC functions for currently accepted connection should use this HANDLE, not a base named port HANDLE created with NtCreatePort.
LPC_MESSAGELPC_SECTION_MEMORYLPC_SECTION_OWNER_MEMORYNtCompleteConnectPortNtCreatePortNtListenPort