ReactOS 0.4.15-dev-7958-gcd0bb1a
shmsrv.c File Reference
#include <ddk/ntddk.h>
#include <windows.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
Include dependency graph for shmsrv.c:

Go to the source code of this file.

Functions

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

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

Definition at line 11 of file shmsrv.c.

12{
13 HANDLE Section;
15
16 printf("Shm test server\n");
17
18 Section = CreateFileMappingW (
19 (HANDLE) 0xFFFFFFFF,
20 NULL,
22 0,
23 8192,
24 L"TestSection"
25 );
26 if (Section == NULL)
27 {
28 printf("Failed to create section (err=%d)", GetLastError());
29 return 1;
30 }
31
32 printf("Mapping view of section\n");
33 BaseAddress = MapViewOfFile(Section,
35 0,
36 0,
37 8192);
38 printf("BaseAddress %x\n", (UINT) BaseAddress);
39 if (BaseAddress == NULL)
40 {
41 printf("Failed to map section\n");
42 }
43
44 printf("Copying to section\n");
45 printf("Copying %s\n", GetCommandLineA());
47
49
50 return 0;
51}
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define NULL
Definition: types.h:112
#define CreateFileMappingW(a, b, c, d, e, f)
Definition: compat.h:744
#define MapViewOfFile
Definition: compat.h:745
LPSTR WINAPI GetCommandLineA(VOID)
Definition: proc.c:2003
#define INFINITE
Definition: serial.h:102
#define printf
Definition: freeldr.h:97
unsigned int UINT
Definition: ndis.h:50
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
#define PAGE_READWRITE
Definition: nt_native.h:1304
#define L(x)
Definition: ntvdm.h:50
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define FILE_MAP_ALL_ACCESS
Definition: winbase.h:156