ReactOS 0.4.15-dev-8219-ge8b88cf
Mailslot.c File Reference
#include "precomp.h"
Include dependency graph for Mailslot.c:

Go to the source code of this file.

Macros

#define LMS   TEXT("\\\\.\\mailslot\\rostest_slot")
 
#define MSG   (0x50DA)
 

Functions

DWORD WINAPI MailSlotWriter (LPVOID lpParam)
 
DWORD WINAPI MailSlotReader (LPVOID lpParam)
 
VOID StartTestCORE10188 (VOID)
 
 START_TEST (Mailslot)
 

Variables

static DWORD dInMsg = MSG
 
static DWORD dOutMsg = 0x0
 

Macro Definition Documentation

◆ LMS

#define LMS   TEXT("\\\\.\\mailslot\\rostest_slot")

Definition at line 10 of file Mailslot.c.

◆ MSG

#define MSG   (0x50DA)

Definition at line 11 of file Mailslot.c.

Function Documentation

◆ MailSlotReader()

DWORD WINAPI MailSlotReader ( LPVOID  lpParam)

Definition at line 38 of file Mailslot.c.

40{
41 HANDLE hMailslotClient;
42 DWORD cbRead;
44
46 ok(hMailslotClient != INVALID_HANDLE_VALUE, "CreateMailslot failed\n");
47 if (hMailslotClient != INVALID_HANDLE_VALUE)
48 {
50 ok(hThread != INVALID_HANDLE_VALUE, "CreateThread failed\n");
52 {
53 ok(ReadFile(hMailslotClient, &dOutMsg, sizeof(dOutMsg), &cbRead, NULL), "Slot read failed\n");
56 }
57 CloseHandle(hMailslotClient);
58 }
59 return 0;
60}
DWORD WINAPI MailSlotWriter(LPVOID lpParam)
Definition: Mailslot.c:18
static DWORD dOutMsg
Definition: Mailslot.c:14
#define LMS
Definition: Mailslot.c:10
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
#define CloseHandle
Definition: compat.h:739
#define ReadFile(a, b, c, d, e)
Definition: compat.h:742
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
#define INFINITE
Definition: serial.h:102
unsigned long DWORD
Definition: ntddk_ex.h:95
#define MAILSLOT_WAIT_FOREVER
Definition: finfo.c:19
HANDLE hThread
Definition: wizard.c:28
#define L(x)
Definition: ntvdm.h:50
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define CreateMailslot
Definition: winbase.h:3755

Referenced by StartTestCORE10188().

◆ MailSlotWriter()

DWORD WINAPI MailSlotWriter ( LPVOID  lpParam)

Definition at line 18 of file Mailslot.c.

20{
21 DWORD cbWritten;
22 HANDLE hMailslot;
23
26 ok(hMailslot != INVALID_HANDLE_VALUE, "CreateFile failed, results might not be accurate\n");
27 if (hMailslot != INVALID_HANDLE_VALUE)
28 {
29 Sleep(1000);
30 ok(WriteFile(hMailslot, &dInMsg, sizeof(dInMsg), &cbWritten, (LPOVERLAPPED) NULL), "Slot write failed\n");
31 CloseHandle(hMailslot);
32 }
33 return 0;
34}
static DWORD dInMsg
Definition: Mailslot.c:13
#define OPEN_EXISTING
Definition: compat.h:775
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define FILE_SHARE_READ
Definition: compat.h:136
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define GENERIC_WRITE
Definition: nt_native.h:90
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
#define CreateFile
Definition: winbase.h:3749

Referenced by MailSlotReader().

◆ START_TEST()

START_TEST ( Mailslot  )

Definition at line 77 of file Mailslot.c.

78{
80}
VOID StartTestCORE10188(VOID)
Definition: Mailslot.c:63

◆ StartTestCORE10188()

VOID StartTestCORE10188 ( VOID  )

Definition at line 63 of file Mailslot.c.

64{
66
68 ok(hThread != INVALID_HANDLE_VALUE, "CreateThread failed\n");
70 {
73 }
74 ok(dInMsg == dOutMsg, "Transfer data failed\n");
75}
DWORD WINAPI MailSlotReader(LPVOID lpParam)
Definition: Mailslot.c:38

Referenced by START_TEST().

Variable Documentation

◆ dInMsg

DWORD dInMsg = MSG
static

Definition at line 13 of file Mailslot.c.

Referenced by MailSlotWriter(), and StartTestCORE10188().

◆ dOutMsg

DWORD dOutMsg = 0x0
static

Definition at line 14 of file Mailslot.c.

Referenced by MailSlotReader(), and StartTestCORE10188().