ReactOS  0.4.14-dev-358-gbef841c
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 }
#define LMS
Definition: Mailslot.c:10
#define CloseHandle
Definition: compat.h:406
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
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:136
smooth NULL
Definition: ftsmooth.c:416
DWORD WINAPI MailSlotWriter(LPVOID lpParam)
Definition: Mailslot.c:18
unsigned long DWORD
Definition: ntddk_ex.h:95
static DWORD dOutMsg
Definition: Mailslot.c:14
static const WCHAR L[]
Definition: oid.c:1250
#define CreateMailslot
Definition: winbase.h:3579
#define MAILSLOT_WAIT_FOREVER
Definition: finfo.c:19
#define ok(value,...)
Definition: atltest.h:57
HANDLE hThread
Definition: wizard.c:27
#define INFINITE
Definition: serial.h:102
BOOL WINAPI ReadFile(IN HANDLE hFile, IN LPVOID lpBuffer, IN DWORD nNumberOfBytesToRead, OUT LPDWORD lpNumberOfBytesRead OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:123

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
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 LMS
Definition: Mailslot.c:10
#define CloseHandle
Definition: compat.h:406
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FILE_SHARE_READ
Definition: compat.h:125
#define GENERIC_WRITE
Definition: nt_native.h:90
smooth NULL
Definition: ftsmooth.c:416
#define OPEN_EXISTING
Definition: compat.h:434
unsigned long DWORD
Definition: ntddk_ex.h:95
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
IN OUT PVCB OUT PDIRENT OUT PBCB IN BOOLEAN CreateFile
Definition: fatprocs.h:904
#define ok(value,...)
Definition: atltest.h:57

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 }
static DWORD dInMsg
Definition: Mailslot.c:13
#define CloseHandle
Definition: compat.h:406
DWORD WINAPI MailSlotReader(LPVOID lpParam)
Definition: Mailslot.c:38
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
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:136
smooth NULL
Definition: ftsmooth.c:416
static DWORD dOutMsg
Definition: Mailslot.c:14
#define ok(value,...)
Definition: atltest.h:57
HANDLE hThread
Definition: wizard.c:27
#define INFINITE
Definition: serial.h:102

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().