diff options
Diffstat (limited to 'src/mscorlib/src/System/Threading/EventWaitHandle.cs')
-rw-r--r-- | src/mscorlib/src/System/Threading/EventWaitHandle.cs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/mscorlib/src/System/Threading/EventWaitHandle.cs b/src/mscorlib/src/System/Threading/EventWaitHandle.cs index e910984439..cfb9c28415 100644 --- a/src/mscorlib/src/System/Threading/EventWaitHandle.cs +++ b/src/mscorlib/src/System/Threading/EventWaitHandle.cs @@ -83,7 +83,7 @@ namespace System.Threading if (null != name && 0 != name.Length && Win32Native.ERROR_INVALID_HANDLE == errorCode) throw new WaitHandleCannotBeOpenedException(SR.Format(SR.Threading_WaitHandleCannotBeOpenedException_InvalidHandle, name)); - __Error.WinIOError(errorCode, name); + throw Win32Marshal.GetExceptionForWin32Error(errorCode, name); } SetHandleInternal(_handle); } @@ -132,7 +132,7 @@ namespace System.Threading if (null != name && 0 != name.Length && Win32Native.ERROR_INVALID_HANDLE == errorCode) throw new WaitHandleCannotBeOpenedException(SR.Format(SR.Threading_WaitHandleCannotBeOpenedException_InvalidHandle, name)); - __Error.WinIOError(errorCode, name); + throw Win32Marshal.GetExceptionForWin32Error(errorCode, name); } createdNew = errorCode != Win32Native.ERROR_ALREADY_EXISTS; SetHandleInternal(_handle); @@ -160,8 +160,7 @@ namespace System.Threading throw new WaitHandleCannotBeOpenedException(SR.Format(SR.Threading_WaitHandleCannotBeOpenedException_InvalidHandle, name)); case OpenExistingResult.PathNotFound: - __Error.WinIOError(Win32Native.ERROR_PATH_NOT_FOUND, ""); - return result; //never executes + throw Win32Marshal.GetExceptionForWin32Error(Win32Native.ERROR_PATH_NOT_FOUND, ""); default: return result; @@ -210,7 +209,7 @@ namespace System.Threading if (null != name && 0 != name.Length && Win32Native.ERROR_INVALID_HANDLE == errorCode) return OpenExistingResult.NameInvalid; //this is for passed through Win32Native Errors - __Error.WinIOError(errorCode, ""); + throw Win32Marshal.GetExceptionForWin32Error(errorCode, ""); } result = new EventWaitHandle(myHandle); return OpenExistingResult.Success; @@ -220,7 +219,7 @@ namespace System.Threading { bool res = Win32Native.ResetEvent(safeWaitHandle); if (!res) - __Error.WinIOError(); + throw Win32Marshal.GetExceptionForLastWin32Error(); return res; } public bool Set() @@ -228,7 +227,7 @@ namespace System.Threading bool res = Win32Native.SetEvent(safeWaitHandle); if (!res) - __Error.WinIOError(); + throw Win32Marshal.GetExceptionForLastWin32Error(); return res; } |