ReactOS  0.4.15-dev-4927-gfe8f806
msserver.c
Go to the documentation of this file.
1 
2 
3 #include <windows.h>
4 
5 
6 int main(int argc, char *argv[])
7 {
8  HANDLE hMailslot;
9  CHAR chBuf[512];
10  BOOL fResult;
11  DWORD cbRead;
12  LPTSTR lpszMailslotName = "\\\\.\\mailslot\\mymailslot";
13 
14  hMailslot = CreateMailslot(lpszMailslotName,
15  512,
17  NULL);
18 for (;;)
19 {
20  fResult = ReadFile(hMailslot,
21  chBuf,
22  512,
23  &cbRead,
24  NULL);
25  if (fResult == FALSE)
26  {
27  printf("ReadFile() failed!\n");
28  CloseHandle(hMailslot);
29  return 0;
30  }
31 
32  printf("Data read: %s\n", chBuf);
33 }
34 
35  CloseHandle(hMailslot);
36 
37  return 0;
38 }
39 
40 /* EOF */
static int argc
Definition: ServiceArgs.c:12
#define CloseHandle
Definition: compat.h:598
char CHAR
Definition: xmlstorage.h:175
#define argv
Definition: mplay32.c:18
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
int main(int argc, char *argv[])
Definition: msserver.c:6
#define printf
Definition: freeldr.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define CreateMailslot
Definition: winbase.h:3616
#define MAILSLOT_WAIT_FOREVER
Definition: finfo.c:19
#define ReadFile(a, b, c, d, e)
Definition: compat.h:601
#define NULL
Definition: types.h:112