[linker] We need to mark nested types even if the declaring type isn't marked.
[mono-project.git] / mono / metadata / w32event-win32.c
blob86590217c4d35bdcdbce1c6397f5fb849c88f10d
1 /*
2 * w32event-win32.c: Runtime support for managed Event on Win32
4 * Author:
5 * Ludovic Henry (luhenry@microsoft.com)
7 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
8 */
10 #include "w32event.h"
12 #include <windows.h>
13 #include <winbase.h>
15 void
16 mono_w32event_init (void)
20 gpointer
21 mono_w32event_create (gboolean manual, gboolean initial)
23 return CreateEvent (NULL, manual, initial, NULL);
26 void
27 mono_w32event_set (gpointer handle)
29 SetEvent (handle);
32 void
33 mono_w32event_reset (gpointer handle)
35 ResetEvent (handle);
38 gpointer
39 ves_icall_System_Threading_Events_CreateEvent_internal (MonoBoolean manual, MonoBoolean initial, MonoString *name, gint32 *error)
41 gpointer event;
43 event = CreateEvent (NULL, manual, initial, name ? mono_string_chars (name) : NULL);
45 *error = GetLastError ();
47 return event;
50 gboolean
51 ves_icall_System_Threading_Events_SetEvent_internal (gpointer handle)
53 return SetEvent (handle);
56 gboolean
57 ves_icall_System_Threading_Events_ResetEvent_internal (gpointer handle)
59 return ResetEvent (handle);
62 void
63 ves_icall_System_Threading_Events_CloseEvent_internal (gpointer handle)
65 CloseHandle (handle);
68 gpointer
69 ves_icall_System_Threading_Events_OpenEvent_internal (MonoString *name, gint32 rights, gint32 *error)
71 gpointer handle;
73 *error = ERROR_SUCCESS;
75 handle = OpenEvent (rights, FALSE, mono_string_chars (name));
76 if (!handle)
77 *error = GetLastError ();
79 return handle;