Build mono runtime under none desktop Windows API family, adjustments and cleanup.
[mono.git] / mono / utils / mono-dl-windows-uwp.c
1 /*
2  * mono-dl-windows-uwp.c: UWP dl 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/utils/mono-dl-windows-internals.h"
14
15 void*
16 mono_dl_lookup_symbol_in_process (const char *symbol_name)
17 {
18         g_unsupported_api ("EnumProcessModules");
19         SetLastError (ERROR_NOT_SUPPORTED);
20
21         return NULL;
22 }
23
24 char*
25 mono_dl_current_error_string (void)
26 {
27         char *ret = NULL;
28         TCHAR buf [1024];
29         DWORD code = GetLastError ();
30
31         if (!FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
32                 code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, G_N_ELEMENTS(buf) - 1, NULL))
33                 buf[0] = TEXT('\0');
34
35         ret = u16to8 (buf);
36         return ret;
37 }
38
39 #else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
40
41 MONO_EMPTY_SOURCE_FILE (mono_dl_windows_uwp);
42 #endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */