Build mono runtime under none desktop Windows API family, adjustments and cleanup.
[mono.git] / mono / metadata / coree-windows-uwp.c
1 /*
2  * coree-windows-uwp.c: UWP coree support for Mono.
3  *
4  * Copyright 2016 Microsoft
5  * Licensed under the MIT license. See LICENSE file in the project root for full license information.
6 */
7 #include <config.h>
8 #include <glib.h>
9 #include "mono/utils/mono-compiler.h"
10
11 #if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
12 #include <windows.h>
13 #include "mono/metadata/coree-internals.h"
14
15 BOOL STDMETHODCALLTYPE
16 _CorDllMain(HINSTANCE hInst, DWORD dwReason, LPVOID lpReserved)
17 {
18         g_unsupported_api ("_CorDllMain");
19         return FALSE;
20 }
21
22 __int32 STDMETHODCALLTYPE
23 _CorExeMain(void)
24 {
25         g_unsupported_api ("_CorExeMain");
26         ExitProcess (EXIT_FAILURE);
27 }
28
29 STDAPI
30 _CorValidateImage(PVOID *ImageBase, LPCWSTR FileName)
31 {
32         g_unsupported_api ("_CorValidateImage");
33         return E_UNEXPECTED;
34 }
35
36 HMODULE WINAPI
37 MonoLoadImage(LPCWSTR FileName)
38 {
39         g_unsupported_api ("MonoLoadImage");
40         return NULL;
41 }
42
43 void
44 mono_coree_set_act_ctx (const char *file_name)
45 {
46         g_unsupported_api ("CreateActCtx, ActivateActCtx");
47         SetLastError (ERROR_NOT_SUPPORTED);
48
49         return;
50 }
51
52 #else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
53
54 MONO_EMPTY_SOURCE_FILE (coree_windows_uwp);
55 #endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */