FreeRDP
TestPipeCreateNamedPipe.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/print.h>
#include <winpr/synch.h>
#include <winpr/wlog.h>
#include <winpr/thread.h>
#include <signal.h>
#include "../pipe.h"

Macros

#define PIPE_BUFFER_SIZE   32
 
#define TESTNUMPIPESST   16
 

Functions

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

Variables

static HANDLE ReadyEvent
 
static LPTSTR lpszPipeNameMt = _T("\\\\.\\pipe\\winpr_test_pipe_mt")
 
static LPTSTR lpszPipeNameSt = _T("\\\\.\\pipe\\winpr_test_pipe_st")
 
static BOOL testFailed = FALSE
 

Macro Definition Documentation

#define PIPE_BUFFER_SIZE   32
#define TESTNUMPIPESST   16

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

Note: If a client connects before ConnectNamedPipe is called, the function returns zero and GetLastError returns ERROR_PIPE_CONNECTED. This can happen if a client connects in the interval between the call to CreateNamedPipe and the call to ConnectNamedPipe. In this situation, there is a good connection between client and server, even though the function returns zero.

Here is the call graph for this function:

Here is the caller graph for this function:

static DWORD WINAPI named_pipe_single_thread ( LPVOID  arg)
static

Note: If a client connects before ConnectNamedPipe is called, the function returns zero and GetLastError returns ERROR_PIPE_CONNECTED. This can happen if a client connects in the interval between the call to CreateNamedPipe and the call to ConnectNamedPipe. In this situation, there is a good connection between client and server, even though the function returns zero.

After DisconnectNamedPipe on server end ReadFile/WriteFile must fail on client end

After CloseHandle (without calling DisconnectNamedPipe first) on server end ReadFile/WriteFile must fail on client end

After CloseHandle on client end ReadFile/WriteFile must fail on server end

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

LPTSTR lpszPipeNameMt = _T("\\\\.\\pipe\\winpr_test_pipe_mt")
static
LPTSTR lpszPipeNameSt = _T("\\\\.\\pipe\\winpr_test_pipe_st")
static
HANDLE ReadyEvent
static
BOOL testFailed = FALSE
static