ReactOS  0.4.15-dev-3718-g2318f7f
msclient.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <windows.h>
#include <tchar.h>
Include dependency graph for msclient.c:

Go to the source code of this file.

Macros

#define BUFSIZE   1024
 
#define MAILSLOT_TIMEOUT   1000
 

Functions

int main (int argc, char *argv[])
 

Macro Definition Documentation

◆ BUFSIZE

#define BUFSIZE   1024

Definition at line 7 of file msclient.c.

◆ MAILSLOT_TIMEOUT

#define MAILSLOT_TIMEOUT   1000

Definition at line 8 of file msclient.c.

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

hosttype.c Copyright (C) 2002 by Brian Palmer brian.nosp@m.p@sg.nosp@m.inet..nosp@m.com

Definition at line 11 of file msclient.c.

12 {
13  HANDLE hMailslot;
14  LPSTR lpszMailslotName = "\\\\.\\MAILSLOT\\mymailslot";
15  LPSTR lpszTestMessage = "Mailslot test message!";
16  DWORD cbLength, cbWritten;
17 
18  hMailslot = CreateFile(lpszMailslotName,
24  (HANDLE)NULL);
25  printf("hMailslot %x\n", (DWORD)hMailslot);
26  if (hMailslot == INVALID_HANDLE_VALUE)
27  {
28  printf("CreateFile() failed\n");
29  return 0;
30  }
31 
32  cbLength = (ULONG)strlen(lpszTestMessage)+1;
33 
34  WriteFile(hMailslot,
35  lpszTestMessage,
36  cbLength,
37  &cbWritten,
38  NULL);
39 
40  CloseHandle(hMailslot);
41 
42  return 0;
43 }
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 CloseHandle
Definition: compat.h:598
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
char * LPSTR
Definition: xmlstorage.h:182
#define FILE_SHARE_READ
Definition: compat.h:136
#define GENERIC_WRITE
Definition: nt_native.h:90
#define OPEN_EXISTING
Definition: compat.h:634
unsigned long DWORD
Definition: ntddk_ex.h:95
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
IN OUT PVCB OUT PDIRENT OUT PBCB IN BOOLEAN CreateFile
Definition: fatprocs.h:913
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
#define printf
Definition: config.h:203