ReactOS 0.4.15-dev-7842-g558ab78
shmsrv.c
Go to the documentation of this file.
1/*
2 * FILE : reactos/apps/shm/shmsrv.c
3 * AUTHOR: David Welch
4 */
5#include <ddk/ntddk.h>
6#include <windows.h>
7#include <stdarg.h>
8#include <string.h>
9#include <stdio.h>
10
11int main(int argc, char* argv[])
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}
52
static int argc
Definition: ServiceArgs.c:12
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
int main()
Definition: test.c:6
#define INFINITE
Definition: serial.h:102
#define printf
Definition: freeldr.h:93
#define argv
Definition: mplay32.c:18
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