mono-dl-windows-uwp.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. #if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT | HAVE_XBOXONE_WINAPI_SUPPORT)
  12. #include <windows.h>
  13. #include "mono/utils/mono-dl-windows-internals.h"
  14. void*
  15. mono_dl_lookup_symbol_in_process (const char *symbol_name)
  16. {
  17. g_unsupported_api ("EnumProcessModules");
  18. SetLastError (ERROR_NOT_SUPPORTED);
  19. return NULL;
  20. }
  21. char*
  22. mono_dl_current_error_string (void)
  23. {
  24. char *ret = NULL;
  25. TCHAR buf [1024];
  26. DWORD code = GetLastError ();
  27. if (!FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
  28. code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, G_N_ELEMENTS(buf) - 1, NULL))
  29. buf[0] = TEXT('\0');
  30. ret = u16to8 (buf);
  31. return ret;
  32. }
  33. #else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
  34. MONO_EMPTY_SOURCE_FILE (mono_dl_windows_uwp);
  35. #endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */