mono_native_tls_get_value that does not change LastError. (#15568)
[mono-project.git] / mono / utils / mono-dl-windows-uwp.c
blobe3e5ddf7b6ada4287adb6b5bcf1b3cc2018596ac
1 /**
2 * \file
3 * UWP dl support for Mono.
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"
12 #if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
13 #include <windows.h>
14 #include "mono/utils/mono-dl-windows-internals.h"
16 void*
17 mono_dl_lookup_symbol_in_process (const char *symbol_name)
19 g_unsupported_api ("EnumProcessModules");
20 SetLastError (ERROR_NOT_SUPPORTED);
22 return NULL;
25 char*
26 mono_dl_current_error_string (void)
28 char *ret = NULL;
29 TCHAR buf [1024];
30 DWORD code = GetLastError ();
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');
36 ret = u16to8 (buf);
37 return ret;
40 #else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
42 MONO_EMPTY_SOURCE_FILE (mono_dl_windows_uwp);
43 #endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */