ReactOS 0.4.16-dev-2110-ge3521eb
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
#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
#define va_end(v)
Definition: stdarg.h:28
#define va_start(v, l)
Definition: stdarg.h:26
_ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl vsprintf(char *, const char *, va_list) __WINE_CRT_PRINTF_ATTR(2
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1592
char * va_list
Definition: vadefs.h:50
#define L(x)
Definition: resources.c:13
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
#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
strcpy
Definition: string.h:131
#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:156
#define FILE_MAP_ALL_ACCESS
Definition: winbase.h:158