Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Diagnostics / Eventing / Reader / EventLogHandle.cs / 1305376 / EventLogHandle.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: EventLogHandle ** ** Purpose: ** This internal class is a SafeHandle implementation over a ** native EVT_HANDLE - obtained from EventLog Native Methods. ** ============================================================*/ using System; using System.Runtime.InteropServices; using System.Security.Permissions; namespace System.Diagnostics.Eventing.Reader { // // Marked as SecurityCritical due to link demands from inherited // SafeHandle members. // // marked as Safe since the only real operation that is performed // by this class is NativeWrapper.EvtClose and that is protected // by a full Demand() before doing any work. [System.Security.SecuritySafeCritical] internal sealed class EventLogHandle : SafeHandle { // Called by P/Invoke when returning SafeHandles private EventLogHandle() : base(IntPtr.Zero, true) { } internal EventLogHandle(IntPtr handle, bool ownsHandle) : base(IntPtr.Zero, ownsHandle) { SetHandle(handle); } public override bool IsInvalid { get { return IsClosed || handle == IntPtr.Zero; } } protected override bool ReleaseHandle() { NativeWrapper.EvtClose(handle); handle = IntPtr.Zero; return true; } // DONT compare EventLogHandle with EventLogHandle.Zero // use IsInvalid instead. Zero is provided where a NULL handle needed public static EventLogHandle Zero { get { return new EventLogHandle(); } } } } // 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
- GetImportFileNameRequest.cs
- NoPersistScope.cs
- ResourceDisplayNameAttribute.cs
- UriSection.cs
- VirtualizedContainerService.cs
- SplayTreeNode.cs
- DataGridTableCollection.cs
- ViewGenerator.cs
- SizeAnimationClockResource.cs
- ColumnResult.cs
- BrowserDefinition.cs
- SortedDictionary.cs
- MobileControlPersister.cs
- DescriptionAttribute.cs
- DataSourceControlBuilder.cs
- LockedAssemblyCache.cs
- SearchForVirtualItemEventArgs.cs
- RemotingAttributes.cs
- COSERVERINFO.cs
- RankException.cs
- CodeParameterDeclarationExpression.cs
- HttpCachePolicy.cs
- IndexerNameAttribute.cs
- WSFederationHttpBindingCollectionElement.cs
- ProgressBarHighlightConverter.cs
- RightsManagementInformation.cs
- DataSourceConverter.cs
- StrokeFIndices.cs
- HostExecutionContextManager.cs
- SplitterCancelEvent.cs
- _StreamFramer.cs
- ObjectDataSourceChooseTypePanel.cs
- SignerInfo.cs
- ScrollBar.cs
- PanelStyle.cs
- DetailsViewUpdatedEventArgs.cs
- EntityKey.cs
- Visual3D.cs
- CheckedPointers.cs
- UnorderedHashRepartitionStream.cs
- LayoutInformation.cs
- isolationinterop.cs
- COM2PropertyPageUITypeConverter.cs
- DataGridViewCellPaintingEventArgs.cs
- SafeCertificateContext.cs
- AssemblyInfo.cs
- TableColumnCollectionInternal.cs
- ImageListDesigner.cs
- WebPartDisplayModeCancelEventArgs.cs
- Polygon.cs
- ServiceOperationParameter.cs
- HttpChannelListener.cs
- TransformerInfoCollection.cs
- OperationCanceledException.cs
- SourceFileBuildProvider.cs
- ParameterModifier.cs
- ClientSession.cs
- NonVisualControlAttribute.cs
- TypeElement.cs
- SearchExpression.cs
- NullableIntMinMaxAggregationOperator.cs
- ParameterCollection.cs
- ProtocolsSection.cs
- RecognizerStateChangedEventArgs.cs
- EncoderNLS.cs
- BrowserTree.cs
- TextEditorCharacters.cs
- PropertyNames.cs
- IfJoinedCondition.cs
- DataGridColumnHeader.cs
- ProofTokenCryptoHandle.cs
- SHA1Managed.cs
- SystemResourceKey.cs
- CustomCategoryAttribute.cs
- AutoGeneratedFieldProperties.cs
- ParallelDesigner.cs
- WebBrowserBase.cs
- COM2PropertyPageUITypeConverter.cs
- IPipelineRuntime.cs
- SmtpNetworkElement.cs
- SqlBulkCopy.cs
- IsolationInterop.cs
- DataGridViewRowConverter.cs
- CorrelationRequestContext.cs
- WrappedIUnknown.cs
- ConfigXmlAttribute.cs
- TableColumn.cs
- ItemDragEvent.cs
- TcpHostedTransportConfiguration.cs
- ActivityDesigner.cs
- PropertyManager.cs
- NameValuePermission.cs
- Column.cs
- ClientScriptManagerWrapper.cs
- HashCodeCombiner.cs
- TreeNodeBinding.cs
- DataContext.cs
- SelectionWordBreaker.cs
- EventlogProvider.cs
- ServicePointManagerElement.cs