Create a branch for Thomas Faber's work on creating a kernel mode test suite for the Google Summer of Code project

svn path=/branches/GSoC_2011/KMTestSuite/; revision=51606
This commit is contained in:
Ged Murphy 2011-05-06 13:25:33 +00:00
parent ac4083c6d7
commit 705706e05f
20922 changed files with 0 additions and 7613918 deletions

46
tests/mstest/msclient.c Normal file
View 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 */