#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER
#ifndef _NAMEDPIPE_H_
#define _NAMEDPIPE_H_
#include <apiset.h>
#include <apisetcconv.h>
#include <minwindef.h>
#include <minwinbase.h>
#ifdef __cplusplus
extern
"C"
{
#endif
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
(
_Out_ PHANDLE hWritePipe,
_In_opt_ LPSECURITY_ATTRIBUTES lpPipeAttributes,
);
(
_Inout_opt_ LPOVERLAPPED lpOverlapped
);
(
);
(
_In_opt_ LPDWORD lpMaxCollectionCount,
_In_opt_ LPDWORD lpCollectDataTimeout
);
(
_Out_writes_bytes_to_opt_(nBufferSize,*lpBytesRead) LPVOID lpBuffer,
_Out_opt_ LPDWORD lpBytesRead,
_Out_opt_ LPDWORD lpTotalBytesAvail,
_Out_opt_ LPDWORD lpBytesLeftThisMessage
);
(
_In_reads_bytes_opt_(nInBufferSize) LPVOID lpInBuffer,
_In_ DWORD nInBufferSize,
_Out_writes_bytes_to_opt_(nOutBufferSize,*lpBytesRead) LPVOID lpOutBuffer,
_In_ DWORD nOutBufferSize,
_Out_ LPDWORD lpBytesRead,
_Inout_opt_ LPOVERLAPPED lpOverlapped
);
(
_In_ DWORD nMaxInstances,
_In_ DWORD nOutBufferSize,
_In_ DWORD nInBufferSize,
_In_ DWORD nDefaultTimeOut,
_In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes
);
#ifdef UNICODE
#define CreateNamedPipe CreateNamedPipeW
#endif
(
_In_ LPCWSTR lpNamedPipeName,
);
#ifdef UNICODE
#define WaitNamedPipe WaitNamedPipeW
#endif
#if (_WIN32_WINNT >= 0x0600)
GetNamedPipeClientComputerNameW
(
_Out_writes_bytes_(ClientComputerNameLength) LPWSTR ClientComputerName,
_In_ ULONG ClientComputerNameLength
);
#endif // (_WIN32_WINNT >= 0x0600)
#ifdef UNICODE
#define GetNamedPipeClientComputerName GetNamedPipeClientComputerNameW
#endif
_Must_inspect_result_
ImpersonateNamedPipeClient
(
);
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#pragma region Application Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
(
_Out_opt_ LPDWORD lpFlags,
_Out_opt_ LPDWORD lpOutBufferSize,
_Out_opt_ LPDWORD lpInBufferSize,
_Out_opt_ LPDWORD lpMaxInstances
);
(
_Out_opt_ LPDWORD lpState,
_Out_opt_ LPDWORD lpCurInstances,
_Out_opt_ LPDWORD lpMaxCollectionCount,
_Out_opt_ LPDWORD lpCollectDataTimeout,
_Out_writes_opt_(nMaxUserNameSize) LPWSTR lpUserName,
_In_ DWORD nMaxUserNameSize
);
#ifdef UNICODE
#define GetNamedPipeHandleState GetNamedPipeHandleStateW
#endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Application Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
(
_In_ LPCWSTR lpNamedPipeName,
_In_reads_bytes_opt_(nInBufferSize) LPVOID lpInBuffer,
_In_ DWORD nInBufferSize,
_Out_writes_bytes_to_opt_(nOutBufferSize,*lpBytesRead) LPVOID lpOutBuffer,
_In_ DWORD nOutBufferSize,
_Out_ LPDWORD lpBytesRead,
);
#ifdef UNICODE
#define CallNamedPipe CallNamedPipeW
#endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#ifdef __cplusplus
}
#endif
#endif // _NAMEDPIPE_H_