FreeRDP
TestPipeCreateNamedPipeOverlapped.c File Reference
#include <stdio.h>
#include <winpr/crt.h>
#include <winpr/pipe.h>
#include <winpr/file.h>
#include <winpr/tchar.h>
#include <winpr/winpr.h>
#include <winpr/wlog.h>
#include <winpr/print.h>
#include <winpr/synch.h>
#include <winpr/thread.h>

Macros

#define PIPE_BUFFER_SIZE   32
 
#define PIPE_TIMEOUT_MS   20000
 

Functions

static DWORD WINAPI named_pipe_client_thread (LPVOID arg)
 
static DWORD WINAPI named_pipe_server_thread (LPVOID arg)
 
int TestPipeCreateNamedPipeOverlapped (int argc, char *argv[])
 

Variables

static BYTE SERVER_MESSAGE [PIPE_BUFFER_SIZE]
 
static BYTE CLIENT_MESSAGE [PIPE_BUFFER_SIZE]
 
static BOOL bClientSuccess = FALSE
 
static BOOL bServerSuccess = FALSE
 
static HANDLE serverReadyEvent
 
static LPTSTR lpszPipeName = _T("\\\\.\\pipe\\winpr_test_pipe_overlapped")
 

Macro Definition Documentation

#define PIPE_BUFFER_SIZE   32
#define PIPE_TIMEOUT_MS   20000

Function Documentation

static DWORD WINAPI named_pipe_client_thread ( LPVOID  arg)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static DWORD WINAPI named_pipe_server_thread ( LPVOID  arg)
static

At this point if fConnected is FALSE, we have to check GetLastError() for: ERROR_PIPE_CONNECTED: client has already connected before we have called ConnectNamedPipe. this is quite common depending on the timings and indicates success ERROR_IO_PENDING: Since we're using ConnectNamedPipe asynchronously here, the function returns immediately and this error code simply indicates that the operation is still in progress. Hence we have to wait for the completion event and use GetOverlappedResult to query the actual result of the operation (note that the lpNumberOfBytesTransferred parameter is undefined/useless for a ConnectNamedPipe operation)

Here is the call graph for this function:

Here is the caller graph for this function:

int TestPipeCreateNamedPipeOverlapped ( int  argc,
char *  argv[] 
)

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

BOOL bClientSuccess = FALSE
static
BOOL bServerSuccess = FALSE
static
BYTE CLIENT_MESSAGE[PIPE_BUFFER_SIZE]
static
LPTSTR lpszPipeName = _T("\\\\.\\pipe\\winpr_test_pipe_overlapped")
static
BYTE SERVER_MESSAGE[PIPE_BUFFER_SIZE]
static
HANDLE serverReadyEvent
static