7aacb5ec86481c791df073bcf31baab29e61cecc
[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
10 #if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
11 #include <Windows.h>
12 #include "mono/metadata/coree-internals.h"
13
14 BOOL STDMETHODCALLTYPE
15 _CorDllMain(HINSTANCE hInst, DWORD dwReason, LPVOID lpReserved)
16 {
17         g_unsupported_api ("_CorDllMain");
18         return FALSE;
19 }
20
21 __int32 STDMETHODCALLTYPE
22 _CorExeMain(void)
23 {
24         g_unsupported_api ("_CorExeMain");
25         ExitProcess (EXIT_FAILURE);
26 }
27
28 STDAPI
29 _CorValidateImage(PVOID *ImageBase, LPCWSTR FileName)
30 {
31         g_unsupported_api ("_CorValidateImage");
32         return E_UNEXPECTED;
33 }
34
35 HMODULE WINAPI
36 MonoLoadImage(LPCWSTR FileName)
37 {
38         g_unsupported_api ("MonoLoadImage");
39         return NULL;
40 }
41
42 void
43 mono_coree_set_act_ctx (const char *file_name)
44 {
45         g_unsupported_api ("CreateActCtx, ActivateActCtx");
46         SetLastError (ERROR_NOT_SUPPORTED);
47
48         return;
49 }
50
51 #else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
52
53 #ifdef _MSC_VER
54 // Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
55 void __mono_win32_coree_windows_uwp_quiet_lnk4221(void) {}
56 #endif
57 #endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */