mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 20:05:41 +00:00
Move tests from rosapps to rostests
svn path=/trunk/; revision=26010
This commit is contained in:
parent
3e98dbd825
commit
2199ae9003
262 changed files with 362 additions and 6 deletions
46
rostests/tests/mstest/msclient.c
Normal file
46
rostests/tests/mstest/msclient.c
Normal file
|
@ -0,0 +1,46 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <windows.h>
|
||||
#include <tchar.h>
|
||||
|
||||
#define BUFSIZE 1024
|
||||
#define MAILSLOT_TIMEOUT 1000
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
HANDLE hMailslot;
|
||||
LPSTR lpszMailslotName = "\\\\.\\MAILSLOT\\mymailslot";
|
||||
LPSTR lpszTestMessage = "Mailslot test message!";
|
||||
DWORD cbLength, cbWritten;
|
||||
|
||||
hMailslot = CreateFile(lpszMailslotName,
|
||||
GENERIC_WRITE,
|
||||
FILE_SHARE_READ,
|
||||
(LPSECURITY_ATTRIBUTES)NULL,
|
||||
OPEN_EXISTING,
|
||||
FILE_ATTRIBUTE_NORMAL,
|
||||
(HANDLE)NULL);
|
||||
printf("hMailslot %x\n", (DWORD)hMailslot);
|
||||
if (hMailslot == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
printf("CreateFile() failed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
cbLength = (ULONG)strlen(lpszTestMessage)+1;
|
||||
|
||||
WriteFile(hMailslot,
|
||||
lpszTestMessage,
|
||||
cbLength,
|
||||
&cbWritten,
|
||||
NULL);
|
||||
|
||||
CloseHandle(hMailslot);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue