Merge all static runtime libs into libmono-static.
[mono.git] / mono / utils / mono-dl-windows-uwp.c
1 /**
2  * \file
3  * UWP dl support for Mono.
4  *
5  * Copyright 2016 Microsoft
6  * Licensed under the MIT license. See LICENSE file in the project root for full license information.
7 */
8 #include <config.h>
9 #include <glib.h>
10 #include "mono/utils/mono-compiler.h"
11
12 #if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
13 #include <windows.h>
14 #include "mono/utils/mono-dl-windows-internals.h"
15
16 void*
17 mono_dl_lookup_symbol_in_process (const char *symbol_name)
18 {
19         g_unsupported_api ("EnumProcessModules");
20         SetLastError (ERROR_NOT_SUPPORTED);
21
22         return NULL;
23 }
24
25 char*
26 mono_dl_current_error_string (void)
27 {
28         char *ret = NULL;
29         TCHAR buf [1024];
30         DWORD code = GetLastError ();
31
32         if (!FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
33                 code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, G_N_ELEMENTS(buf) - 1, NULL))
34                 buf[0] = TEXT('\0');
35
36         ret = u16to8 (buf);
37         return ret;
38 }
39
40 #else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
41
42 MONO_EMPTY_SOURCE_FILE (mono_dl_windows_uwp);
43 #endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */