8 #define MAILSLOT_TIMEOUT 1000
11 int main(int argc
, char *argv
[])
14 LPSTR lpszMailslotName
= "\\\\.\\MAILSLOT\\mymailslot";
15 LPSTR lpszTestMessage
= "Mailslot test message!";
16 DWORD cbLength
, cbWritten
;
18 hMailslot
= CreateFile(lpszMailslotName
,
21 (LPSECURITY_ATTRIBUTES
)NULL
,
23 FILE_ATTRIBUTE_NORMAL
,
25 printf("hMailslot %x\n", (DWORD
)hMailslot
);
26 if (hMailslot
== INVALID_HANDLE_VALUE
)
28 printf("CreateFile() failed\n");
32 cbLength
= (ULONG
)strlen(lpszTestMessage
)+1;
40 CloseHandle(hMailslot
);