Merge pull request #4781 from kumpera/unaligned-cleanup-1
[mono.git] / mono / metadata / mono-security-windows.c
index fda26d349c3ea6c9a396504b5afe58b80be5dcb7..7a34c8a1a6186206251169b4a6e0602a3dfa0c98 100644 (file)
@@ -1,5 +1,6 @@
-/*
- * mono-security-windows.c: Windows security support.
+/**
+ * \file
+ * Windows security support.
  *
  * Copyright 2016 Microsoft
  * Licensed under the MIT license. See LICENSE file in the project root for full license information.
@@ -8,8 +9,8 @@
 #include <glib.h>
 
 #if defined(HOST_WIN32)
-#include <WinSock2.h>
-#include <Windows.h>
+#include <winsock2.h>
+#include <windows.h>
 #include "mono/metadata/mono-security-windows-internals.h"
 
 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
@@ -111,7 +112,7 @@ ves_icall_System_Security_Principal_WindowsIdentity_GetTokenName (gpointer token
        gunichar2 *uniname = NULL;
        gint32 size = 0;
 
-       mono_error_init (&error);
+       error_init (&error);
 
        size = mono_security_win_get_token_name (token, &uniname);
 
@@ -119,7 +120,7 @@ ves_icall_System_Security_Principal_WindowsIdentity_GetTokenName (gpointer token
                result = mono_string_new_utf16_checked (mono_domain_get (), uniname, size, &error);
        }
        else
-               result = mono_string_new (mono_domain_get (), "");
+               result = mono_string_new_checked (mono_domain_get (), "", &error);
 
        if (uniname)
                g_free (uniname);