8#define PIPE_TIMEOUT 1000
36 LPTSTR lpszPipename =
TEXT(
"\\\\.\\pipe\\mynamedpipe");
52 printf(
"CreateNamedPipe() failed\n");
61 printf(
"Pipe connected!\n");
91 DWORD cbBytesRead, cbReplyBytes, cbWritten;
103 if (!fSuccess || cbBytesRead == 0)
113 if (!fSuccess || cbReplyBytes != cbWritten)
int puts(const char *string)
#define ReadFile(a, b, c, d, e)
#define INVALID_HANDLE_VALUE
BOOL WINAPI FlushFileBuffers(IN HANDLE hFile)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
VOID WINAPI ExitProcess(IN UINT uExitCode)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
static const WCHAR Message[]
BOOL WINAPI ConnectNamedPipe(IN HANDLE hNamedPipe, IN LPOVERLAPPED lpOverlapped)
BOOL WINAPI DisconnectNamedPipe(HANDLE hNamedPipe)
VOID MyErrExit(LPTSTR Message)
VOID InstanceThread(LPVOID)
VOID GetAnswerToRequest(LPTSTR lpRequest, LPTSTR lpReply, LPDWORD lpcbReplyBytes)
DWORD WINAPI GetLastError(void)
#define PIPE_ACCESS_DUPLEX
#define PIPE_READMODE_MESSAGE
#define PIPE_TYPE_MESSAGE
DWORD(WINAPI * LPTHREAD_START_ROUTINE)(LPVOID)
#define PIPE_UNLIMITED_INSTANCES
#define ERROR_PIPE_CONNECTED