2 Copyright (C) 2010 g10 Code GmbH
3 Written by Marcus Brinkmann <marcus@g10code.com>
5 This file is part of HiMemCE.
7 HiMemCE is free software; you can redistribute it and/or modify it
8 under the terms of the GNU Lesser General Public License as
9 published by the Free Software Foundation; either version 2.1 of
10 the License, or (at your option) any later version.
12 HiMemCE is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 You should have received a copy of the GNU Lesser General Public
18 License along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22 #ifndef HIMEMCE_WINE_H
23 #define HIMEMCE_WINE_H
29 #include "my_winternl.h"
30 #include "server_protocol.h"
32 /* Support for the wine code. */
33 extern struct _PEB _peb;
34 #define current_peb() (&_peb)
36 #define OBJECT_ATTRIBUTES void
41 size_t pread(HANDLE handle, char *buffer, size_t len, off_t offset);
43 int get_prot_flags (int vprot);
47 ULONG MyRtlNtStatusToDosError (NTSTATUS status);
50 PIMAGE_NT_HEADERS MyRtlImageNtHeader (HMODULE hModule);
51 NTSTATUS MyLdrLoadDll (LPCWSTR path_name, DWORD flags,
52 LPCWSTR libname, HMODULE* hModule);
53 void MyLdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
54 ULONG_PTR unknown3, ULONG_PTR unknown4 );
55 IMAGE_BASE_RELOCATION *MyLdrProcessRelocationBlock (void *page, UINT count,
58 PVOID MyRtlImageDirectoryEntryToData( HMODULE module, BOOL image,
59 WORD dir, ULONG *size );
63 NTSTATUS MyNtCreateSection (HANDLE *handle, ACCESS_MASK access,
64 const OBJECT_ATTRIBUTES *attr,
65 const LARGE_INTEGER *size, ULONG protect,
66 ULONG sec_flags, HANDLE file);
67 NTSTATUS MyNtMapViewOfSection (HANDLE handle, HANDLE process,
68 PVOID *addr_ptr, ULONG zero_bits,
70 const LARGE_INTEGER *offset_ptr,
72 SECTION_INHERIT inherit, ULONG alloc_type,
75 /* kernel32_module.c */
76 HMODULE MyLoadLibraryExW (LPCWSTR libnameW, HANDLE hfile, DWORD flags);
78 /* kernel32_process.c */
79 BOOL MyCreateProcessW (LPCWSTR app_name, LPWSTR cmd_line, int *exit_code);