2 * icall-windows-uwp.c: UWP icall support for Mono.
4 * Copyright 2016 Microsoft
5 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
10 #if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
12 #include "mono/metadata/icall-windows-internals.h"
15 mono_icall_get_machine_name (void)
17 g_unsupported_api ("GetComputerName");
18 return mono_string_new (mono_domain_get (), "mono");
22 mono_icall_get_windows_folder_path (int folder)
24 g_unsupported_api ("SHGetFolderPath");
25 return mono_string_new (mono_domain_get (), "");
29 mono_icall_get_logical_drives (void)
32 mono_error_init (&mono_error);
34 g_unsupported_api ("GetLogicalDriveStrings");
36 mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "GetLogicalDriveStrings");
37 mono_error_set_pending_exception (&mono_error);
39 SetLastError (ERROR_NOT_SUPPORTED);
45 mono_icall_broadcast_setting_change (void)
48 mono_error_init (&mono_error);
50 g_unsupported_api ("SendMessageTimeout");
52 mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "SendMessageTimeout");
53 mono_error_set_pending_exception (&mono_error);
55 SetLastError (ERROR_NOT_SUPPORTED);
61 mono_icall_drive_info_get_drive_type (MonoString *root_path_name)
64 mono_error_init (&mono_error);
66 g_unsupported_api ("GetDriveType");
68 mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "GetDriveType");
69 mono_error_set_pending_exception (&mono_error);
75 mono_icall_wait_for_input_idle (gpointer handle, gint32 milliseconds)
78 mono_error_init (&mono_error);
80 g_unsupported_api ("WaitForInputIdle");
82 mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "WaitForInputIdle");
83 mono_error_set_pending_exception (&mono_error);
89 mono_icall_get_process_working_set_size (gpointer handle, gsize *min, gsize *max)
92 mono_error_init (&mono_error);
94 g_unsupported_api ("GetProcessWorkingSetSize");
96 mono_error_set_not_supported(&mono_error, G_UNSUPPORTED_API, "GetProcessWorkingSetSize");
97 mono_error_set_pending_exception (&mono_error);
99 SetLastError (ERROR_NOT_SUPPORTED);
105 mono_icall_set_process_working_set_size (gpointer handle, gsize min, gsize max)
107 MonoError mono_error;
108 mono_error_init (&mono_error);
110 g_unsupported_api ("SetProcessWorkingSetSize");
112 mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "SetProcessWorkingSetSize");
113 mono_error_set_pending_exception (&mono_error);
115 SetLastError (ERROR_NOT_SUPPORTED);
121 mono_icall_get_priority_class (gpointer handle)
123 MonoError mono_error;
124 mono_error_init (&mono_error);
126 g_unsupported_api ("GetPriorityClass");
128 mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "GetPriorityClass");
129 mono_error_set_pending_exception (&mono_error);
131 SetLastError (ERROR_NOT_SUPPORTED);
137 mono_icall_set_priority_class (gpointer handle, gint32 priorityClass)
139 MonoError mono_error;
140 mono_error_init (&mono_error);
142 g_unsupported_api ("SetPriorityClass");
144 mono_error_set_not_supported(&mono_error, G_UNSUPPORTED_API, "SetPriorityClass");
145 mono_error_set_pending_exception (&mono_error);
147 SetLastError (ERROR_NOT_SUPPORTED);
152 #else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
155 // Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
156 void __mono_win32_icall_windows_uwp_quiet_lnk4221(void) {}
158 #endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */