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
- ReaderContextStackData.cs
- ChildTable.cs
- StorageAssociationSetMapping.cs
- ProtectedConfigurationSection.cs
- BamlMapTable.cs
- EventMappingSettingsCollection.cs
- COMException.cs
- RoleManagerEventArgs.cs
- DmlSqlGenerator.cs
- DocumentReferenceCollection.cs
- TraceSection.cs
- Floater.cs
- FileSecurity.cs
- DataKeyArray.cs
- ModuleConfigurationInfo.cs
- AttributeCollection.cs
- PeekCompletedEventArgs.cs
- JavaScriptSerializer.cs
- SqlBuffer.cs
- InfoCardRequestException.cs
- PhysicalAddress.cs
- TextPointerBase.cs
- DataControlFieldCollection.cs
- WebPartConnectionsCloseVerb.cs
- PermissionSetEnumerator.cs
- ThrowHelper.cs
- KerberosSecurityTokenParameters.cs
- ScaleTransform.cs
- HorizontalAlignConverter.cs
- JournalNavigationScope.cs
- ConfigurationStrings.cs
- TextParaLineResult.cs
- DataGridTablesFactory.cs
- ToolStripSplitStackLayout.cs
- XmlTextAttribute.cs
- HtmlImage.cs
- DynamicObject.cs
- PropertyCondition.cs
- MetadataArtifactLoader.cs
- CookieParameter.cs
- ObjectAssociationEndMapping.cs
- StringCollection.cs
- TransactedReceiveScope.cs
- BrushMappingModeValidation.cs
- SqlTrackingService.cs
- VirtualStackFrame.cs
- mediaclock.cs
- HostExecutionContextManager.cs
- Restrictions.cs
- DataTableCollection.cs
- ErrorReporting.cs
- EnlistmentTraceIdentifier.cs
- OperationAbortedException.cs
- NaturalLanguageHyphenator.cs
- WebPartEditorApplyVerb.cs
- OutgoingWebRequestContext.cs
- SimpleRecyclingCache.cs
- KeyboardEventArgs.cs
- BodyWriter.cs
- DataGrid.cs
- DataControlFieldTypeEditor.cs
- PositiveTimeSpanValidator.cs
- SoapObjectInfo.cs
- AvTrace.cs
- PageTheme.cs
- PkcsMisc.cs
- WebResourceAttribute.cs
- VirtualizedItemPattern.cs
- FilterEventArgs.cs
- SQLDouble.cs
- FilteredDataSetHelper.cs
- RootProfilePropertySettingsCollection.cs
- SyntaxCheck.cs
- Matrix.cs
- safesecurityhelperavalon.cs
- RegexFCD.cs
- ExpandCollapseProviderWrapper.cs
- DispatcherFrame.cs
- LocalBuilder.cs
- TextDecorationCollection.cs
- RTLAwareMessageBox.cs
- SpoolingTask.cs
- Path.cs
- MediaElementAutomationPeer.cs
- HttpHandlerAction.cs
- SqlRemoveConstantOrderBy.cs
- CreatingCookieEventArgs.cs
- FieldMetadata.cs
- LocatorPartList.cs
- XmlSchemaCompilationSettings.cs
- HTMLTagNameToTypeMapper.cs
- ToolStripCollectionEditor.cs
- TreeViewAutomationPeer.cs
- ServiceContractDetailViewControl.cs
- MediaScriptCommandRoutedEventArgs.cs
- ListViewItemSelectionChangedEvent.cs
- QueryRewriter.cs
- BinaryParser.cs
- BaseCollection.cs
- SafeMILHandle.cs