3 * Runtime support for managed Event on Win32
6 * Ludovic Henry (luhenry@microsoft.com)
8 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
15 #include <mono/metadata/handle.h>
16 #include <mono/utils/mono-error-internals.h>
17 #include "icall-decl.h"
20 mono_w32event_init (void)
25 mono_w32event_create (gboolean manual
, gboolean initial
)
27 return CreateEvent (NULL
, manual
, initial
, NULL
);
31 mono_w32event_close (gpointer handle
)
33 return CloseHandle (handle
);
37 mono_w32event_set (gpointer handle
)
43 mono_w32event_reset (gpointer handle
)
49 ves_icall_System_Threading_Events_CreateEvent_icall (MonoBoolean manual
, MonoBoolean initial
,
50 const gunichar2
*name
, gint32 name_length
, gint32
*win32error
, MonoError
*error
)
55 event
= CreateEventW (NULL
, manual
, initial
, name
);
56 *win32error
= GetLastError ();
63 ves_icall_System_Threading_Events_SetEvent_internal (gpointer handle
)
65 return SetEvent (handle
);
69 ves_icall_System_Threading_Events_ResetEvent_internal (gpointer handle
)
71 return ResetEvent (handle
);
75 ves_icall_System_Threading_Events_CloseEvent_internal (gpointer handle
)
81 ves_icall_System_Threading_Events_OpenEvent_icall (const gunichar2
*name
, gint32 name_length
,
82 gint32 rights
, gint32
*win32error
, MonoError
*error
)
86 *win32error
= ERROR_SUCCESS
;
89 handle
= OpenEventW (rights
, FALSE
, name
);
91 *win32error
= GetLastError ();