FreeRDP
|
#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 = NULL |
static LPTSTR | lpszPipeName = _T("\\\\.\\pipe\\winpr_test_pipe_overlapped") |
#define PIPE_BUFFER_SIZE 32 |
#define PIPE_TIMEOUT_MS 20000 |
|
static |
|
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)
int TestPipeCreateNamedPipeOverlapped | ( | int | argc, |
char * | argv[] | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |