ReactOS 0.4.16-dev-340-g0540c21
shmclt.c
Go to the documentation of this file.
1#include <ddk/ntddk.h>
2#include <windows.h>
3#include <stdarg.h>
4#include <string.h>
5#include <stdio.h>
6
9
10void debug_printf(char* fmt, ...)
11{
13 char buffer[255];
14
18 va_end(args);
19}
20
21
22int
23main(int argc, char* argv[])
24{
25 HANDLE Section;
27 char buffer[256];
28
29 printf("Shm test server\n");
30
31 Section = OpenFileMappingW (
32// PAGE_EXECUTE_READWRITE, invalid parameter
34 FALSE,
35 L"TestSection"
36 );
37 if (Section == NULL)
38 {
39 printf("Failed to open section (err=%d)", GetLastError());
40 return 1;
41 }
42
43 BaseAddress = MapViewOfFile(Section,
45 0,
46 0,
47 8192);
48 if (BaseAddress == NULL)
49 {
50 printf("Failed to map section (err=%d)\n", GetLastError());
51 return 1;
52 }
53 printf("BaseAddress %x\n", (UINT) BaseAddress);
54 printf("Copying from section\n");
56 printf("Copyed <%s>\n", buffer);
57
58// for(;;);
59 return 0;
60}
61
static int argc
Definition: ServiceArgs.c:12
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define MapViewOfFile
Definition: compat.h:745
BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleA(IN HANDLE hConsoleOutput, IN CONST VOID *lpBuffer, IN DWORD nNumberOfCharsToWrite, OUT LPDWORD lpNumberOfCharsWritten, LPVOID lpReserved)
Definition: readwrite.c:1468
int main()
Definition: test.c:6
HANDLE NTAPI OpenFileMappingW(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN LPCWSTR lpName)
Definition: filemap.c:297
#define printf
Definition: freeldr.h:97
GLuint buffer
Definition: glext.h:5915
int __cdecl vsprintf(char *_Dest, const char *_Format, va_list _Args)
Definition: sprintf.c:733
#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 L(x)
Definition: ntvdm.h:50
#define args
Definition: format.c:66
HANDLE InputHandle
Definition: shmclt.c:8
void debug_printf(char *fmt,...)
Definition: shmclt.c:10
HANDLE OutputHandle
Definition: shmclt.c:7
Definition: match.c:390
Definition: dsound.c:943
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define FILE_MAP_WRITE
Definition: winbase.h:155
#define FILE_MAP_ALL_ACCESS
Definition: winbase.h:157