NtCreateNamedPipeFile - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTIOAPI_H

NTSYSCALLAPI
NTSTATUS
NTAPI
NtCreateNamedPipeFile(
    _Out_ PHANDLE FileHandle,
    _In_ ACCESS_MASK DesiredAccess,
    _In_ POBJECT_ATTRIBUTES ObjectAttributes,
    _Out_ PIO_STATUS_BLOCK IoStatusBlock,
    _In_ ULONG ShareAccess,
    _In_ ULONG CreateDisposition,
    _In_ ULONG CreateOptions,
    _In_ ULONG NamedPipeType,
    _In_ ULONG ReadMode,
    _In_ ULONG CompletionMode,
    _In_ ULONG MaximumInstances,
    _In_ ULONG InboundQuota,
    _In_ ULONG OutboundQuota,
    _In_ PLARGE_INTEGER DefaultTimeout
    );

#endif

View code on GitHub
#ifndef _NTZWAPI_H

NTSYSCALLAPI
NTSTATUS
NTAPI
ZwCreateNamedPipeFile(
    _Out_ PHANDLE FileHandle,
    _In_ ACCESS_MASK DesiredAccess,
    _In_ POBJECT_ATTRIBUTES ObjectAttributes,
    _Out_ PIO_STATUS_BLOCK IoStatusBlock,
    _In_ ULONG ShareAccess,
    _In_ ULONG CreateDisposition,
    _In_ ULONG CreateOptions,
    _In_ ULONG NamedPipeType,
    _In_ ULONG ReadMode,
    _In_ ULONG CompletionMode,
    _In_ ULONG MaximumInstances,
    _In_ ULONG InboundQuota,
    _In_ ULONG OutboundQuota,
    _In_ PLARGE_INTEGER DefaultTimeout
    );

#endif

View code on GitHub

This function is documented in Windows SDK.


Function NtCreateNamedPipeFile creates Named Pipe File Object. Named Pipes are especial kind of files, so all functionality is provided with file's functions like NtReadFile, NtWriteFile etc.
Named Pipes are frequently used in NT system, for example as stdin and stdout handles.

NamedPipeFileHandle

Result of call - pointer to HANDLE to Named Pipe.

DesiredAccess

Access rights for object's handle. Can be one or combination of:

ObjectAttributes

Pointer to OBJECT_ATTRIBUTES structure contains name of named pipe. Name must begin with "\??\PIPE\" string, that is Symbolic Link to NamedPipe device object.

IoStatusBlock

IO result of call.

ShareAccess

Can be combination of following:

CreateDisposition

Use FILE_CREATE, FILE_OPEN or FILE_OPEN_IF.

CreateOptions

See description of NtCreateFile for possible creation flags.

WriteModeMessage

If set, writing to created pipe are processed in Message Mode. If not, all writes are in Byte Mode.

ReadModeMessage

The same functionality as WriteModeMessage parameter, but for reading data.

NonBlocking

If set, all operations on created pipe are asynchronous.

MaxInstances

Maximum number of open handles for Named Pipe, or FILE_PIPE_UNLIMITED_INSTANCES constant.

InBufferSize

Input buffer size, in bytes.

OutBufferSize

Output buffer size, in bytes.

DefaultTimeOut

Pointer to LARGE_INTEGER value specifying pipe's time out, in 100-ns units. Negative value means relative time.

Documented by

See also