FreeRDP
pipe.c File Reference
#include <winpr/crt.h>
#include <winpr/path.h>
#include <winpr/synch.h>
#include <winpr/handle.h>
#include <winpr/pipe.h>
#include "../handle/handle.h"
#include <fcntl.h>
#include <errno.h>
#include <sys/un.h>
#include <sys/socket.h>
#include <assert.h>
#include <unistd.h>
#include "pipe.h"
#include "../log.h"

Macros

#define TAG   WINPR_TAG("pipe")
 

Functions

static BOOL PipeIsHandled (HANDLE handle)
 
static int PipeGetFd (HANDLE handle)
 
static BOOL PipeCloseHandle (HANDLE handle)
 
static BOOL PipeRead (PVOID Object, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped)
 
static BOOL PipeWrite (PVOID Object, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped)
 
static BOOL NamedPipeIsHandled (HANDLE handle)
 
static int NamedPipeGetFd (HANDLE handle)
 
static BOOL NamedPipeCloseHandle (HANDLE handle)
 
BOOL NamedPipeRead (PVOID Object, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped)
 
BOOL NamedPipeWrite (PVOID Object, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped)
 
static BOOL InitWinPRPipeModule ()
 
BOOL CreatePipe (PHANDLE hReadPipe, PHANDLE hWritePipe, LPSECURITY_ATTRIBUTES lpPipeAttributes, DWORD nSize)
 
static void winpr_unref_named_pipe (WINPR_NAMED_PIPE *pNamedPipe)
 
HANDLE CreateNamedPipeA (LPCSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD nMaxInstances, DWORD nOutBufferSize, DWORD nInBufferSize, DWORD nDefaultTimeOut, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
 
HANDLE CreateNamedPipeW (LPCWSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD nMaxInstances, DWORD nOutBufferSize, DWORD nInBufferSize, DWORD nDefaultTimeOut, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
 
BOOL ConnectNamedPipe (HANDLE hNamedPipe, LPOVERLAPPED lpOverlapped)
 
BOOL DisconnectNamedPipe (HANDLE hNamedPipe)
 
BOOL PeekNamedPipe (HANDLE hNamedPipe, LPVOID lpBuffer, DWORD nBufferSize, LPDWORD lpBytesRead, LPDWORD lpTotalBytesAvail, LPDWORD lpBytesLeftThisMessage)
 
BOOL TransactNamedPipe (HANDLE hNamedPipe, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesRead, LPOVERLAPPED lpOverlapped)
 
BOOL WaitNamedPipeA (LPCSTR lpNamedPipeName, DWORD nTimeOut)
 
BOOL WaitNamedPipeW (LPCWSTR lpNamedPipeName, DWORD nTimeOut)
 
BOOL SetNamedPipeHandleState (HANDLE hNamedPipe, LPDWORD lpMode, LPDWORD lpMaxCollectionCount, LPDWORD lpCollectDataTimeout)
 
BOOL ImpersonateNamedPipeClient (HANDLE hNamedPipe)
 
BOOL GetNamedPipeClientComputerNameA (HANDLE Pipe, LPCSTR ClientComputerName, ULONG ClientComputerNameLength)
 
BOOL GetNamedPipeClientComputerNameW (HANDLE Pipe, LPCWSTR ClientComputerName, ULONG ClientComputerNameLength)
 

Variables

static wArrayList * g_NamedPipeServerSockets = NULL
 
static HANDLE_OPS ops
 
static HANDLE_OPS namedOps
 

Macro Definition Documentation

#define TAG   WINPR_TAG("pipe")

WinPR: Windows Portable Runtime Pipe Functions

Copyright 2012 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com Copyright 2017 Armin Novak armin.nosp@m..nov.nosp@m.ak@th.nosp@m.inca.nosp@m.st.co.nosp@m.m Copyright 2017 Thincast Technologies GmbH

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

BOOL ConnectNamedPipe ( HANDLE  hNamedPipe,
LPOVERLAPPED  lpOverlapped 
)

Here is the call graph for this function:

Here is the caller graph for this function:

HANDLE CreateNamedPipeA ( LPCSTR  lpName,
DWORD  dwOpenMode,
DWORD  dwPipeMode,
DWORD  nMaxInstances,
DWORD  nOutBufferSize,
DWORD  nInBufferSize,
DWORD  nDefaultTimeOut,
LPSECURITY_ATTRIBUTES  lpSecurityAttributes 
)

Named pipe

Here is the call graph for this function:

Here is the caller graph for this function:

HANDLE CreateNamedPipeW ( LPCWSTR  lpName,
DWORD  dwOpenMode,
DWORD  dwPipeMode,
DWORD  nMaxInstances,
DWORD  nOutBufferSize,
DWORD  nInBufferSize,
DWORD  nDefaultTimeOut,
LPSECURITY_ATTRIBUTES  lpSecurityAttributes 
)

Here is the call graph for this function:

BOOL CreatePipe ( PHANDLE  hReadPipe,
PHANDLE  hWritePipe,
LPSECURITY_ATTRIBUTES  lpPipeAttributes,
DWORD  nSize 
)

Unnamed pipe

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL DisconnectNamedPipe ( HANDLE  hNamedPipe)

Here is the caller graph for this function:

BOOL GetNamedPipeClientComputerNameA ( HANDLE  Pipe,
LPCSTR  ClientComputerName,
ULONG  ClientComputerNameLength 
)

Here is the call graph for this function:

BOOL GetNamedPipeClientComputerNameW ( HANDLE  Pipe,
LPCWSTR  ClientComputerName,
ULONG  ClientComputerNameLength 
)

Here is the call graph for this function:

BOOL ImpersonateNamedPipeClient ( HANDLE  hNamedPipe)

Here is the call graph for this function:

static BOOL InitWinPRPipeModule ( )
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL NamedPipeCloseHandle ( HANDLE  handle)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static int NamedPipeGetFd ( HANDLE  handle)
static

Here is the call graph for this function:

static BOOL NamedPipeIsHandled ( HANDLE  handle)
static

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL NamedPipeRead ( PVOID  Object,
LPVOID  lpBuffer,
DWORD  nNumberOfBytesToRead,
LPDWORD  lpNumberOfBytesRead,
LPOVERLAPPED  lpOverlapped 
)

Here is the call graph for this function:

BOOL NamedPipeWrite ( PVOID  Object,
LPCVOID  lpBuffer,
DWORD  nNumberOfBytesToWrite,
LPDWORD  lpNumberOfBytesWritten,
LPOVERLAPPED  lpOverlapped 
)

Here is the call graph for this function:

BOOL PeekNamedPipe ( HANDLE  hNamedPipe,
LPVOID  lpBuffer,
DWORD  nBufferSize,
LPDWORD  lpBytesRead,
LPDWORD  lpTotalBytesAvail,
LPDWORD  lpBytesLeftThisMessage 
)

Here is the call graph for this function:

static BOOL PipeCloseHandle ( HANDLE  handle)
static

Here is the call graph for this function:

static int PipeGetFd ( HANDLE  handle)
static

Here is the call graph for this function:

static BOOL PipeIsHandled ( HANDLE  handle)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL PipeRead ( PVOID  Object,
LPVOID  lpBuffer,
DWORD  nNumberOfBytesToRead,
LPDWORD  lpNumberOfBytesRead,
LPOVERLAPPED  lpOverlapped 
)
static

Here is the call graph for this function:

static BOOL PipeWrite ( PVOID  Object,
LPCVOID  lpBuffer,
DWORD  nNumberOfBytesToWrite,
LPDWORD  lpNumberOfBytesWritten,
LPOVERLAPPED  lpOverlapped 
)
static

Here is the call graph for this function:

BOOL SetNamedPipeHandleState ( HANDLE  hNamedPipe,
LPDWORD  lpMode,
LPDWORD  lpMaxCollectionCount,
LPDWORD  lpCollectDataTimeout 
)

Here is the call graph for this function:

BOOL TransactNamedPipe ( HANDLE  hNamedPipe,
LPVOID  lpInBuffer,
DWORD  nInBufferSize,
LPVOID  lpOutBuffer,
DWORD  nOutBufferSize,
LPDWORD  lpBytesRead,
LPOVERLAPPED  lpOverlapped 
)

Here is the call graph for this function:

BOOL WaitNamedPipeA ( LPCSTR  lpNamedPipeName,
DWORD  nTimeOut 
)

Here is the call graph for this function:

BOOL WaitNamedPipeW ( LPCWSTR  lpNamedPipeName,
DWORD  nTimeOut 
)

Here is the call graph for this function:

static void winpr_unref_named_pipe ( WINPR_NAMED_PIPE *  pNamedPipe)
static

Named pipe

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

wArrayList* g_NamedPipeServerSockets = NULL
static
HANDLE_OPS namedOps
static
Initial value:
=
{
NULL,
NULL
}
static BOOL NamedPipeCloseHandle(HANDLE handle)
Definition: pipe.c:245
BOOL NamedPipeWrite(PVOID Object, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped)
Definition: pipe.c:363
if availableBytes return NULL
Definition: TPCircularBuffer.h:104
static int NamedPipeGetFd(HANDLE handle)
Definition: pipe.c:232
BOOL NamedPipeRead(PVOID Object, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped)
Definition: pipe.c:269
static BOOL NamedPipeIsHandled(HANDLE handle)
Definition: pipe.c:219
HANDLE_OPS ops
static
Initial value:
=
{
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
}
static BOOL PipeWrite(PVOID Object, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped)
Definition: pipe.c:164
static BOOL PipeCloseHandle(HANDLE handle)
Definition: pipe.c:107
if availableBytes return NULL
Definition: TPCircularBuffer.h:104
static int PipeGetFd(HANDLE handle)
Definition: pipe.c:97
static BOOL PipeRead(PVOID Object, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped)
Definition: pipe.c:124
static BOOL PipeIsHandled(HANDLE handle)
Definition: pipe.c:84