internal static void CloseInvalidOutCriticalHandle(CriticalHandle handle) { if (handle != null) { handle.SetHandleAsInvalid(); } }
[SuppressMessage(FxCop.Category.Security, FxCop.Rule.TransparentMethodsMustNotReferenceCriticalCode)] // we got APTCA approval with no requirement to fix this transparency warning. plus, the callers of this method are not supported in partial trust. internal static void CloseInvalidOutCriticalHandle(CriticalHandle handle) { if (handle != null) { #pragma warning disable 618 Fx.Assert(handle.IsInvalid, "CloseInvalidOutCriticalHandle called with a valid handle!"); #pragma warning restore 618 handle.SetHandleAsInvalid(); } }