diff options
Diffstat (limited to 'src/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.EventWaitHandle.cs')
-rw-r--r-- | src/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.EventWaitHandle.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.EventWaitHandle.cs b/src/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.EventWaitHandle.cs new file mode 100644 index 000000000..b562e527e --- /dev/null +++ b/src/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.EventWaitHandle.cs @@ -0,0 +1,28 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using Microsoft.Win32.SafeHandles; +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Kernel32 + { + internal const uint CREATE_EVENT_INITIAL_SET = 0x2; + internal const uint CREATE_EVENT_MANUAL_RESET = 0x1; + + [DllImport(Interop.Libraries.Kernel32, SetLastError = true)] + internal static extern bool SetEvent(SafeWaitHandle handle); + + [DllImport(Interop.Libraries.Kernel32, SetLastError = true)] + internal static extern bool ResetEvent(SafeWaitHandle handle); + + [DllImport(Interop.Libraries.Kernel32, EntryPoint = "CreateEventExW", SetLastError = true, CharSet = CharSet.Unicode)] + internal static extern SafeWaitHandle CreateEventEx(IntPtr lpSecurityAttributes, string name, uint flags, uint desiredAccess); + + [DllImport(Interop.Libraries.Kernel32, EntryPoint = "OpenEventW", SetLastError = true, CharSet = CharSet.Unicode)] + internal static extern SafeWaitHandle OpenEvent(uint desiredAccess, bool inheritHandle, string name); + } +} |