ade821af5e316c1830aabb6e9096bf58a6179682
[mono.git] / mono / metadata / coree.h
1 /*
2  * coree.h: mscoree.dll functions
3  *
4  * Author:
5  *   Kornel Pal <http://www.kornelpal.hu/>
6  *
7  * Copyright (C) 2008 Kornel Pal
8  * Licensed under the MIT license. See LICENSE file in the project root for full license information.
9  */
10
11 #ifndef __MONO_COREE_H__
12 #define __MONO_COREE_H__
13
14 #include <config.h>
15 #include <glib.h>
16
17 #ifdef HOST_WIN32
18
19 #include <mono/io-layer/io-layer.h>
20 #include <mono/utils/mono-compiler.h>
21 #include "image.h"
22
23 #define STATUS_SUCCESS 0x00000000L
24 #define STATUS_INVALID_IMAGE_FORMAT 0xC000007BL
25
26 STDAPI MonoFixupCorEE(HMODULE ModuleHandle);
27
28 /* Defined by the linker. */
29 #ifndef _MSC_VER
30 #ifdef __MINGW64_VERSION_MAJOR
31 #define __ImageBase __MINGW_LSYMBOL(_image_base__)
32 #else
33 #define __ImageBase _image_base__
34 #endif
35 #endif
36 extern IMAGE_DOS_HEADER __ImageBase;
37
38 extern HMODULE coree_module_handle;
39
40 HMODULE WINAPI MonoLoadImage(LPCWSTR FileName);
41 STDAPI MonoFixupExe(HMODULE ModuleHandle);
42
43 gchar* mono_get_module_file_name (HMODULE module_handle);
44 void mono_load_coree (const char* file_name);
45 void mono_fixup_exe_image (MonoImage* image);
46
47 /* Declared in image.c. */
48 MonoImage* mono_image_open_from_module_handle (HMODULE module_handle, char* fname, gboolean has_entry_point, MonoImageOpenStatus* status);
49
50 #endif /* HOST_WIN32 */
51
52 #endif /* __MONO_COREE_H__ */