Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / Log / System / IO / Log / SafeReadContext.cs / 1305376 / SafeReadContext.cs
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
namespace System.IO.Log
{
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Runtime.ConstrainedExecution;
using System.Runtime.Versioning;
using System.Security;
internal sealed class SafeReadContext : SafeHandle
{
public SafeReadContext() : base(IntPtr.Zero, true)
{
}
public override bool IsInvalid
{
get
{
return IsClosed || this.handle == IntPtr.Zero;
}
}
[DllImport("clfsw32.dll"),
SuppressUnmanagedCodeSecurity,
ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[ResourceExposure(ResourceScope.None)]
private static extern bool TerminateReadLog(IntPtr ptr);
override protected bool ReleaseHandle()
{
return TerminateReadLog(this.handle);
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RedirectionProxy.cs
- AuditLevel.cs
- ObservableDictionary.cs
- CodeDomSerializerBase.cs
- GcHandle.cs
- printdlgexmarshaler.cs
- SecurityPermission.cs
- DictionaryMarkupSerializer.cs
- GenerateScriptTypeAttribute.cs
- NativeMethods.cs
- CustomErrorCollection.cs
- DynamicRenderer.cs
- ContainerVisual.cs
- ColumnTypeConverter.cs
- ComUdtElement.cs
- ValidationErrorEventArgs.cs
- HtmlElementEventArgs.cs
- DataError.cs
- SmtpException.cs
- PasswordTextNavigator.cs
- Propagator.Evaluator.cs
- ControlValuePropertyAttribute.cs
- OleDbStruct.cs
- ViewStateModeByIdAttribute.cs
- SchemaMerger.cs
- ReferenceList.cs
- TraceXPathNavigator.cs
- WindowsGrip.cs
- TypeInfo.cs
- ConsumerConnectionPointCollection.cs
- GenericUI.cs
- RuntimeConfigurationRecord.cs
- SerializationStore.cs
- FieldBuilder.cs
- Button.cs
- FormsAuthenticationTicket.cs
- ToolStripRenderer.cs
- TreeNodeStyle.cs
- UnconditionalPolicy.cs
- ExpressionBinding.cs
- CompleteWizardStep.cs
- XmlCustomFormatter.cs
- DefaultMemberAttribute.cs
- CodeExporter.cs
- AssemblyCollection.cs
- EventArgs.cs
- _UncName.cs
- WorkflowCompensationBehavior.cs
- CacheSection.cs
- CssStyleCollection.cs
- ErrorWebPart.cs
- ErrorLog.cs
- SpeechUI.cs
- WindowsSolidBrush.cs
- securestring.cs
- ExpressionDumper.cs
- XmlDocument.cs
- CommentEmitter.cs
- PermissionRequestEvidence.cs
- DataGridPageChangedEventArgs.cs
- UpdateRecord.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- IncrementalHitTester.cs
- ToolStripRenderEventArgs.cs
- CodeConstructor.cs
- OutputCacheModule.cs
- KeyInfo.cs
- EventLogEntryCollection.cs
- ByteRangeDownloader.cs
- KeyedCollection.cs
- DynamicArgumentDesigner.xaml.cs
- ToolStripDropDown.cs
- PipelineModuleStepContainer.cs
- FieldAccessException.cs
- ClipboardProcessor.cs
- EncryptedXml.cs
- ComponentCollection.cs
- ToolStripContentPanelRenderEventArgs.cs
- EventManager.cs
- TrustLevelCollection.cs
- TableLayoutSettingsTypeConverter.cs
- MemberProjectedSlot.cs
- RTLAwareMessageBox.cs
- CertificateReferenceElement.cs
- ServiceDesigner.xaml.cs
- AutoSizeComboBox.cs
- XmlSiteMapProvider.cs
- ConstructorBuilder.cs
- ActivatableWorkflowsQueryResult.cs
- InputBuffer.cs
- XPathNode.cs
- CallbackHandler.cs
- TrackBarRenderer.cs
- CodeMemberProperty.cs
- ResponseStream.cs
- ObjectReaderCompiler.cs
- DesignerForm.cs
- XXXOnTypeBuilderInstantiation.cs
- DictionaryTraceRecord.cs
- Button.cs