#ifndef _NTLPCAPI_H
//
// Port connection (client)
//
/**
* The NtConnectPort routine requests a connection to a named port.
*
* \param PortHandle Receives a handle to the client-side communication port.
* \param PortName Name of the port to connect to.
* \param SecurityQos Security quality of service for the connection.
* \param ClientView Optional shared memory mapping for the client.
* \param ServerView Optional shared memory mapping for the server.
* \param MaxMessageLength Optional receives the maximum message length supported.
* \param ConnectionInformation Optional data to send to the server.
* \param ConnectionInformationLength Optional size of the connection information.
* \return NTSTATUS Successful or errant status.
*/
NTSYSCALLAPI
NTSTATUS
NTAPI
NtConnectPort(
_Out_ PHANDLE PortHandle,
_In_ PCUNICODE_STRING PortName,
_In_ PSECURITY_QUALITY_OF_SERVICE SecurityQos,
_Inout_opt_ PPORT_VIEW ClientView,
_Inout_opt_ PREMOTE_PORT_VIEW ServerView,
_Out_opt_ PULONG MaxMessageLength,
_Inout_updates_bytes_to_opt_(*ConnectionInformationLength, *ConnectionInformationLength) PVOID ConnectionInformation,
_Inout_opt_ PULONG ConnectionInformationLength
);
View code on GitHub#ifndef _NTZWAPI_H
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwConnectPort(
_Out_ PHANDLE PortHandle,
_In_ PCUNICODE_STRING PortName,
_In_ PSECURITY_QUALITY_OF_SERVICE SecurityQos,
_Inout_opt_ PPORT_VIEW ClientView,
_Inout_opt_ PREMOTE_PORT_VIEW ServerView,
_Out_opt_ PULONG MaxMessageLength,
_Inout_updates_bytes_to_opt_(*ConnectionInformationLength, *ConnectionInformationLength) PVOID ConnectionInformation,
_Inout_opt_ PULONG ConnectionInformationLength
);
View code on GitHubNo description available.
NtConnectPort is used by client process for establish LPC connection with Named Port's owner.
Result of call - HANDLE to Port Object.
Name of port to connect to.
Used when calling process created Section Object for shared memory. See NtAcceptConnectPort for details.
Used when calling process didn't create Section Object. See NtAcceptConnectPort for details.
Maximum communication message length. This value is calculated by server on port creation process (see NtCreatePort).
Pointer to RAW buffer containing information from client. That information is received by server through LPC_MESSAGE with MessageType field set to LPC_CONNECTION_REQUEST.
Size of ConnectionInfo buffer, in bytes.
LPC_MESSAGELPC_SECTION_MEMORYLPC_SECTION_OWNER_MEMORYNtAcceptConnectPortNtCompleteConnectPortNtCreatePort