add_compile_options(-fno-omit-frame-pointer)
# The -fms-extensions enable the stuff like __if_exists, __declspec(uuid()), etc.
- add_compile_options(-fms-extensions )
+ add_compile_options(-fms-extensions)
#-fms-compatibility Enable full Microsoft Visual C++ compatibility
#-fms-extensions Accept some non-standard constructs supported by the Microsoft compiler
# may not generate the same object layout as MSVC.
add_compile_options(-Wno-incompatible-ms-struct)
else()
- add_compile_options(-Wno-unused-variable)
add_compile_options(-Wno-unused-but-set-variable)
- add_compile_options(-fms-extensions)
add_compile_options(-Wno-unknown-pragmas)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
add_compile_options(-Wno-nonnull-compare)
<Compile Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\TypeDependencyAttribute.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\GCSettings.CoreCLR.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IEnumerable.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\CriticalHandle.CoreCLR.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\Expando\IExpando.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\GCHandle.CoreCLR.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\Marshal.CoreCLR.cs" />
+++ /dev/null
-// 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 System.Runtime.CompilerServices;
-using System.Runtime.ConstrainedExecution;
-
-namespace System.Runtime.InteropServices
-{
- public abstract partial class CriticalHandle : CriticalFinalizerObject, IDisposable
- {
- [MethodImpl(MethodImplOptions.InternalCall)]
- private extern void ReleaseHandleFailed();
- }
-}
FCFuncElement("GetExceptionCount", ExceptionNative::GetExceptionCount)
FCFuncEnd()
-FCFuncStart(gCriticalHandleFuncs)
- FCFuncElement("ReleaseHandleFailed", CriticalHandle::FireCustomerDebugProbe)
-FCFuncEnd()
-
FCFuncStart(gTypedReferenceFuncs)
FCFuncElement("InternalToObject", ReflectionInvocation::TypedReferenceToObject)
FCFuncElement("InternalMakeTypedReference", ReflectionInvocation::MakeTypedReference)
FCClassElement("Buffer", "System", gBufferFuncs)
FCClassElement("CLRConfig", "System", gClrConfig)
FCClassElement("CompatibilitySwitch", "System.Runtime.Versioning", gCompatibilitySwitchFuncs)
-FCClassElement("CriticalHandle", "System.Runtime.InteropServices", gCriticalHandleFuncs)
FCClassElement("CustomAttribute", "System.Reflection", gCOMCustomAttributeFuncs)
FCClassElement("CustomAttributeEncodedArgument", "System.Reflection", gCustomAttributeEncodedArgument)
FCClassElement("DateTime", "System", gDateTimeFuncs)
static size_t GetHandleOffset() { LIMITED_METHOD_CONTRACT; return offsetof(CriticalHandle, m_handle); }
void SetHandle(LPVOID handle) { LIMITED_METHOD_CONTRACT; m_handle = handle; }
-
- static FCDECL1(void, FireCustomerDebugProbe, CriticalHandle* refThisUNSAFE);
};
GCPROTECT_END();
}
-
-FCIMPL1(void, CriticalHandle::FireCustomerDebugProbe, CriticalHandle* refThisUNSAFE)
-{
- FCALL_CONTRACT;
-
- CRITICALHANDLEREF ch(refThisUNSAFE);
-
- HELPER_METHOD_FRAME_BEGIN_1(ch);
-
- FCUnique(0x53);
-
- HELPER_METHOD_FRAME_END();
-}
-FCIMPLEND
// occur implicitly as part of unmarshaling another P/Invoke).
int lastError = Marshal.GetLastWin32Error();
- if (!ReleaseHandle())
- ReleaseHandleFailed();
+ ReleaseHandle();
Marshal.SetLastWin32Error(lastError);
GC.SuppressFinalize(this);