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

◆ PIPE_BUFFER_SIZE

#define PIPE_BUFFER_SIZE   32

◆ TESTNUMPIPESST

#define TESTNUMPIPESST   16

Function Documentation

◆ named_pipe_client_thread()

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:

◆ named_pipe_server_thread()

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:

◆ named_pipe_single_thread()

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:

◆ TestPipeCreateNamedPipe()

int TestPipeCreateNamedPipe ( int  argc,
char *  argv[] 
)
Here is the call graph for this function:

Variable Documentation

◆ lpszPipeNameMt

LPTSTR lpszPipeNameMt = _T("\\\\.\\pipe\\winpr_test_pipe_mt")
static

◆ lpszPipeNameSt

LPTSTR lpszPipeNameSt = _T("\\\\.\\pipe\\winpr_test_pipe_st")
static

◆ ReadyEvent

HANDLE ReadyEvent
static

◆ testFailed

BOOL testFailed = FALSE
static