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
- StyleTypedPropertyAttribute.cs
- Executor.cs
- ComplexObject.cs
- SimpleHandlerFactory.cs
- Clause.cs
- WindowsButton.cs
- XsdCachingReader.cs
- UserControl.cs
- DataControlImageButton.cs
- MatrixTransform3D.cs
- LongMinMaxAggregationOperator.cs
- XmlBinaryReader.cs
- PropertyConverter.cs
- BitmapEffectvisualstate.cs
- ColumnHeader.cs
- DataObjectAttribute.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- DataGridRelationshipRow.cs
- ElementUtil.cs
- OpenFileDialog.cs
- XmlBindingWorker.cs
- SqlStream.cs
- IRCollection.cs
- DataObject.cs
- EnterpriseServicesHelper.cs
- CaseStatement.cs
- ConstraintConverter.cs
- Relationship.cs
- MarkerProperties.cs
- ConfigXmlText.cs
- SspiSecurityToken.cs
- InvalidProgramException.cs
- dbdatarecord.cs
- DelegatedStream.cs
- OperationCanceledException.cs
- InternalCompensate.cs
- DoubleStorage.cs
- PersonalizationEntry.cs
- BeginEvent.cs
- Point4D.cs
- ToolStripLocationCancelEventArgs.cs
- XmlChoiceIdentifierAttribute.cs
- NativeMethodsCLR.cs
- PrimitiveType.cs
- WebBrowserEvent.cs
- StringDictionary.cs
- CharAnimationUsingKeyFrames.cs
- XmlArrayItemAttribute.cs
- ProfileParameter.cs
- DebugHandleTracker.cs
- CompiledQuery.cs
- Message.cs
- VisualTarget.cs
- SimpleBitVector32.cs
- OracleEncoding.cs
- COM2IPerPropertyBrowsingHandler.cs
- XamlSerializer.cs
- QuerySettings.cs
- Transform3D.cs
- StreamingContext.cs
- NoResizeSelectionBorderGlyph.cs
- TaskHelper.cs
- DoubleCollectionConverter.cs
- PaginationProgressEventArgs.cs
- ObjectQueryProvider.cs
- CustomWebEventKey.cs
- PixelShader.cs
- ConsumerConnectionPointCollection.cs
- MultipartIdentifier.cs
- TakeQueryOptionExpression.cs
- MimeImporter.cs
- BitArray.cs
- VirtualPathUtility.cs
- BufferModeSettings.cs
- XmlAttribute.cs
- SiteMapProvider.cs
- ReflectionTypeLoadException.cs
- CompilerResults.cs
- XmlSchemaDocumentation.cs
- TextDecorationCollection.cs
- DataView.cs
- ProviderUtil.cs
- EdmScalarPropertyAttribute.cs
- WebHttpSecurityModeHelper.cs
- DataControlPagerLinkButton.cs
- XmlSchemaSimpleTypeUnion.cs
- CompilerInfo.cs
- TagMapCollection.cs
- ColorPalette.cs
- DebugHandleTracker.cs
- WebEventCodes.cs
- cryptoapiTransform.cs
- ReverseInheritProperty.cs
- ObjectConverter.cs
- BamlLocalizableResourceKey.cs
- WebPermission.cs
- DoubleCollectionConverter.cs
- GridView.cs
- PointF.cs
- AttachmentService.cs