Imported Upstream version 4.2.0.179

Former-commit-id: 0a113cb3a6feb7873f632839b1307cc6033cd595
This commit is contained in:
Xamarin Public Jenkins
2015-08-26 07:17:56 -04:00
committed by Jo Shields
parent 183bba2c9a
commit 6992685b86
7507 changed files with 90259 additions and 657307 deletions

View File

@@ -40,7 +40,13 @@ namespace Microsoft.Win32.SafeHandles {
[ResourceConsumption(ResourceScope.Machine)]
override protected bool ReleaseHandle()
{
#if MONO
System.IO.MonoIOError error;
System.IO.MonoIO.Close (handle, out error);
return error == System.IO.MonoIOError.ERROR_SUCCESS;
#else
return Win32Native.CloseHandle(handle);
#endif
}
}
}

View File

@@ -11,7 +11,7 @@
// Implements Microsoft.Win32.SafeHandles.SafeRegistryHandle
//
// ======================================================================================
#if !FEATURE_PAL
#if !FEATURE_PAL || MONO
namespace Microsoft.Win32.SafeHandles {
using System;
using System.Security;

View File

@@ -60,6 +60,10 @@ namespace Microsoft.Win32.SafeHandles {
[ResourceConsumption(ResourceScope.Machine)]
override protected bool ReleaseHandle()
{
#if MONO
NativeEventCalls.CloseEvent_internal (handle);
return true;
#else
#if !FEATURE_CORECLR
if (!bIsMutex || Environment.HasShutdownStarted)
return Win32Native.CloseHandle(handle);
@@ -82,6 +86,7 @@ namespace Microsoft.Win32.SafeHandles {
return bReturn;
#else
return Win32Native.CloseHandle(handle);
#endif
#endif
}