a2fa813499b6a3d54e89292b7a873f58002028dd
[mono.git] / mono / metadata / marshal-windows-uwp.c
1 /*
2  * marshal-windows-uwp.c: UWP marshal support for Mono.
3  *
4  * Copyright 2016 Microsoft
5  * Licensed under the MIT license. See LICENSE file in the project root for full license information.
6 */
7 #include <config.h>
8 #include <glib.h>
9
10 #if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
11 #include <Windows.h>
12 #include "mono/metadata/marshal-windows-internals.h"
13
14 void *
15 mono_marshal_alloc_hglobal (size_t size)
16 {
17         return HeapAlloc (GetProcessHeap (), 0, size);
18 }
19
20 gpointer
21 mono_marshal_realloc_hglobal (gpointer ptr, size_t size)
22 {
23         return HeapReAlloc (GetProcessHeap (), 0, ptr, size);
24 }
25
26 void
27 mono_marshal_free_hglobal (gpointer ptr)
28 {
29         HeapFree (GetProcessHeap (), 0, ptr);
30         return;
31 }
32
33 #else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
34
35 #ifdef _MSC_VER
36 // Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
37 void __mono_win32_marshal_windows_uwp_quiet_lnk4221(void) {}
38 #endif
39 #endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */