#include <windows.h>
Go to the source code of this file.
◆ main()
Definition at line 10 of file npclient.c.
11{
16 DWORD cbRead, cbWritten, dwMode;
17 LPTSTR lpszPipename =
"\\\\.\\pipe\\mynamedpipe";
18
19
20
21 while (1)
22 {
24 lpszPipename,
27 0,
30 0,
32
33
34
36 break;
37
38
39
42
43
44
47 }
48
49
50
53 hPipe,
54 &dwMode,
57 if (!fSuccess)
59
60
61
62 lpvMessage = (
argc > 1) ?
argv[1] :
"default message";
63
65 hPipe,
66 lpvMessage,
68 &cbWritten,
70 if (! fSuccess)
72
73 do
74 {
75
76
78 hPipe,
79 chBuf,
80 512,
81 &cbRead,
83
85 break;
86
87
88
90 chBuf, cbRead, &cbWritten,
NULL))
91 {
92 break;
93 }
94
95 } while (! fSuccess);
96
98
99 return 0;
100}
ACPI_SIZE strlen(const char *String)
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
#define ReadFile(a, b, c, d, e)
#define INVALID_HANDLE_VALUE
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
VOID MyErrExit(LPTSTR Message)
BOOL WINAPI SetNamedPipeHandleState(HANDLE hNamedPipe, LPDWORD lpMode, LPDWORD lpMaxCollectionCount, LPDWORD lpCollectDataTimeout)
#define STD_OUTPUT_HANDLE
DWORD WINAPI GetLastError(void)
#define PIPE_READMODE_MESSAGE
◆ MyErrExit()
Definition at line 3 of file npclient.c.
4{
5
8}
int puts(const char *string)
VOID WINAPI ExitProcess(IN UINT uExitCode)
static const WCHAR Message[]
Referenced by main().