ICALL_EXPORT gint64 ves_icall_System_Diagnostics_Stopwatch_GetTimestamp (void);
ICALL_EXPORT gint64 ves_icall_System_GC_GetTotalMemory (MonoBoolean forceCollection);
ICALL_EXPORT gint64 ves_icall_System_Threading_Timer_GetTimeMonotonic (void);
-ICALL_EXPORT gint8 ves_icall_System_Buffer_GetByteInternal (MonoArray*, gint32);
ICALL_EXPORT gpointer ves_icall_System_GCHandle_GetAddrOfPinnedObject (guint32 handle);
ICALL_EXPORT int ves_icall_Interop_Sys_DoubleToString (double, char*, char*, int);
ICALL_EXPORT int ves_icall_System_Environment_get_Platform (void);
ICALL_EXPORT void ves_icall_System_Array_GetGenericValueImpl (MonoArray*, guint32, gpointer);
ICALL_EXPORT void ves_icall_System_Array_SetGenericValueImpl (MonoArray*, guint32, gpointer);
ICALL_EXPORT void ves_icall_System_Buffer_MemcpyInternal (gpointer dest, gconstpointer src, gint32 count);
-ICALL_EXPORT void ves_icall_System_Buffer_SetByteInternal (MonoArray*, gint32, gint8);
ICALL_EXPORT void ves_icall_System_Environment_Exit (int);
ICALL_EXPORT void ves_icall_System_GCHandle_FreeHandle (guint32 handle);
ICALL_EXPORT void ves_icall_System_GC_InternalCollect (int generation);
ICALL(BUFFER_1, "InternalBlockCopy", ves_icall_System_Buffer_BlockCopyInternal)
NOHANDLES(ICALL(BUFFER_5, "InternalMemcpy", ves_icall_System_Buffer_MemcpyInternal))
ICALL(BUFFER_2, "_ByteLength", ves_icall_System_Buffer_ByteLengthInternal)
-ICALL(BUFFER_3, "_GetByte", ves_icall_System_Buffer_GetByteInternal)
-ICALL(BUFFER_4, "_SetByte", ves_icall_System_Buffer_SetByteInternal)
ICALL_TYPE(CLRCONFIG, "System.CLRConfig", CLRCONFIG_1)
HANDLES(CLRCONFIG_1, "CheckThrowUnobservedTaskExceptions", ves_icall_System_CLRConfig_CheckThrowUnobservedTaskExceptions, MonoBoolean, 0, ())
HANDLES(WINID_1, "GetCurrentToken", ves_icall_System_Security_Principal_WindowsIdentity_GetCurrentToken, gpointer, 0, ())
HANDLES(WINID_2, "GetTokenName", ves_icall_System_Security_Principal_WindowsIdentity_GetTokenName, MonoString, 1, (gpointer))
HANDLES(WINID_3, "GetUserToken", ves_icall_System_Security_Principal_WindowsIdentity_GetUserToken, gpointer, 1, (MonoString))
-ICALL(WINID_4, "_GetRoles", ves_icall_System_Security_Principal_WindowsIdentity_GetRoles)
+HANDLES(WINID_4, "_GetRoles", ves_icall_System_Security_Principal_WindowsIdentity_GetRoles, MonoArray, 1, (gpointer))
ICALL_TYPE(WINIMP, "System.Security.Principal.WindowsImpersonationContext", WINIMP_1)
HANDLES(WINIMP_1, "CloseToken", ves_icall_System_Security_Principal_WindowsImpersonationContext_CloseToken, MonoBoolean, 1, (gpointer))
return mono_array_get_byte_length (array);
}
-gint8
-ves_icall_System_Buffer_GetByteInternal (MonoArray *array, gint32 idx)
-{
- return mono_array_get_internal (array, gint8, idx);
-}
-
-void
-ves_icall_System_Buffer_SetByteInternal (MonoArray *array, gint32 idx, gint8 value)
-{
- mono_array_set_internal (array, gint8, idx, value);
-}
-
void
ves_icall_System_Buffer_MemcpyInternal (gpointer dest, gconstpointer src, gint32 count)
{
return mono_security_principal_windows_identity_get_current_token (error);
}
-MonoArray*
-ves_icall_System_Security_Principal_WindowsIdentity_GetRoles (gpointer token)
+MonoArrayHandle
+ves_icall_System_Security_Principal_WindowsIdentity_GetRoles (gpointer token, MonoError *error)
{
- // FIXME This is now supported by UWP.
- ERROR_DECL (error); // FIXMEcoop
mono_security_win_not_supported ("GetTokenInformation", error);
- mono_error_set_pending_exception (error); // FIXMEcoop
- return NULL;
+ return NULL_HANDLE_ARRAY;
}
gpointer
}
#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
-MonoArray*
-ves_icall_System_Security_Principal_WindowsIdentity_GetRoles (gpointer token)
+MonoArrayHandle
+ves_icall_System_Security_Principal_WindowsIdentity_GetRoles (gpointer token, MonoError *error)
{
- ERROR_DECL (error);
- MonoArray *array = NULL;
+ MonoArrayHandle array;
+ MonoStringHandle str_h;
MonoDomain *domain = mono_domain_get ();
-
gint32 size = 0;
+ gboolean created = FALSE;
GetTokenInformation (token, TokenGroups, NULL, size, (PDWORD)&size);
if (size > 0) {
int i=0;
int num = tg->GroupCount;
- array = mono_array_new_checked (domain, mono_get_string_class (), num, error);
- if (mono_error_set_pending_exception (error)) {
+ array = mono_array_new_handle (domain, mono_get_string_class (), num, error);
+ if (!is_ok (error)) {
g_free (tg);
- return NULL;
+ return NULL_HANDLE_ARRAY;
}
+ created = TRUE;
+ str_h = MONO_HANDLE_NEW (MonoString, NULL);
for (i=0; i < num; i++) {
gint32 size = 0;
gunichar2 *uniname = GetSidName (NULL, tg->Groups [i].Sid, &size);
if (uniname) {
MonoString *str = mono_string_new_utf16_checked (domain, uniname, size, error);
+ MONO_HANDLE_ASSIGN_RAW (str_h, str);
if (!is_ok (error)) {
g_free (uniname);
g_free (tg);
- mono_error_set_pending_exception (error);
- return NULL;
+ return NULL_HANDLE_ARRAY;
}
- mono_array_setref_internal (array, i, str);
+ MONO_HANDLE_ARRAY_SETREF (array, i, str_h);
g_free (uniname);
}
}
g_free (tg);
}
- if (!array) {
+ if (!created) {
/* return empty array of string, i.e. string [0] */
- array = mono_array_new_checked (domain, mono_get_string_class (), 0, error);
- mono_error_set_pending_exception (error);
+ array = mono_array_new_handle (domain, mono_get_string_class (), 0, error);
+ return_val_if_nok (error, NULL_HANDLE_ARRAY);
}
return array;
}
*/
#ifndef HOST_WIN32
-MonoArray*
-ves_icall_System_Security_Principal_WindowsIdentity_GetRoles (gpointer token)
+MonoArrayHandle
+ves_icall_System_Security_Principal_WindowsIdentity_GetRoles (gpointer token, MonoError *error)
{
- ERROR_DECL (error);
- MonoArray *array = NULL;
MonoDomain *domain = mono_domain_get ();
/* POSIX-compliant systems should use IsMemberOfGroupId or IsMemberOfGroupName */
g_warning ("WindowsIdentity._GetRoles should never be called on POSIX");
- if (!array) {
- /* return empty array of string, i.e. string [0] */
- array = mono_array_new_checked (domain, mono_get_string_class (), 0, error);
- mono_error_set_pending_exception (error);
- }
- return array;
+ return mono_array_new_handle (domain, mono_get_string_class (), 0, error);
}
#endif /* !HOST_WIN32 */
gpointer
mono_security_principal_windows_identity_get_current_token (MonoError *error);
-ICALL_EXPORT
-MonoArray*
-ves_icall_System_Security_Principal_WindowsIdentity_GetRoles (gpointer token);
-
#endif /* _MONO_METADATA_SECURITY_H_ */