Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / Microsoft / Win32 / SafeHandles / SafeEventLogWriteHandle.cs / 1305376 / SafeEventLogWriteHandle.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SafeEventLogWriteHandle ** **Author: David Gutierrez ([....]) ** ** A wrapper for event log handles ** ** Date: July 8, 2002 ** ===========================================================*/ using System; using System.Security; using System.Security.Permissions; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using Microsoft.Win32; using Microsoft.Win32.SafeHandles; using System.Runtime.ConstrainedExecution; using System.Runtime.Versioning; namespace Microsoft.Win32.SafeHandles { [HostProtectionAttribute(MayLeakOnAbort = true)] [SuppressUnmanagedCodeSecurityAttribute] internal sealed class SafeEventLogWriteHandle : SafeHandleZeroOrMinusOneIsInvalid { // Note: RegisterEventSource returns 0 on failure internal SafeEventLogWriteHandle () : base(true) {} [DllImport(ExternDll.Advapi32, CharSet=System.Runtime.InteropServices.CharSet.Unicode, SetLastError=true)] [ResourceExposure(ResourceScope.Machine)] internal static extern SafeEventLogWriteHandle RegisterEventSource(string uncServerName, string sourceName); [DllImport(ExternDll.Advapi32, SetLastError=true)] [ResourceExposure(ResourceScope.None)] [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] private static extern bool DeregisterEventSource(IntPtr hEventLog); override protected bool ReleaseHandle() { return DeregisterEventSource(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
- ETagAttribute.cs
- PrintPageEvent.cs
- DefaultObjectMappingItemCollection.cs
- ConfigurationStrings.cs
- SmtpMail.cs
- WorkflowOwnershipException.cs
- XmlSchemaGroupRef.cs
- MetadataPropertyCollection.cs
- SharedDp.cs
- DictionaryBase.cs
- LayoutEvent.cs
- WindowInteropHelper.cs
- ZoneMembershipCondition.cs
- RtType.cs
- Processor.cs
- EncodingDataItem.cs
- ListViewTableRow.cs
- ToolStripItemTextRenderEventArgs.cs
- DeclaredTypeValidatorAttribute.cs
- ContextMenu.cs
- RunWorkerCompletedEventArgs.cs
- SizeIndependentAnimationStorage.cs
- FontDifferentiator.cs
- SortDescription.cs
- httpstaticobjectscollection.cs
- StrokeNodeOperations2.cs
- InvalidPropValue.cs
- HeaderedItemsControl.cs
- Set.cs
- CollectionContainer.cs
- LinearGradientBrush.cs
- XmlQuerySequence.cs
- DataViewSetting.cs
- IsolatedStorage.cs
- DataServiceQueryException.cs
- WebContext.cs
- DataGridTableCollection.cs
- SafeCoTaskMem.cs
- MulticastDelegate.cs
- DrawingGroup.cs
- TreeBuilder.cs
- ProfileGroupSettings.cs
- URIFormatException.cs
- GetIsBrowserClientRequest.cs
- SqlMethodCallConverter.cs
- MimeTypePropertyAttribute.cs
- DataGridColumnHeadersPresenterAutomationPeer.cs
- shaperfactoryquerycachekey.cs
- TreeViewDesigner.cs
- WindowsBrush.cs
- CatalogPart.cs
- ObjectConverter.cs
- SQLInt16.cs
- Vector3DCollectionValueSerializer.cs
- Propagator.JoinPropagator.cs
- TemplateBindingExpression.cs
- CompileXomlTask.cs
- Freezable.cs
- Calendar.cs
- FileLevelControlBuilderAttribute.cs
- brushes.cs
- TypeElementCollection.cs
- InternalDuplexChannelListener.cs
- PrimitiveType.cs
- ConfigurationSection.cs
- StylusPlugin.cs
- TransformGroup.cs
- UrlMappingsModule.cs
- XamlSerializerUtil.cs
- CacheChildrenQuery.cs
- EmptyEnumerator.cs
- PolicyStatement.cs
- KeyValuePair.cs
- GradientStopCollection.cs
- SafeReversePInvokeHandle.cs
- TCPClient.cs
- BinaryMethodMessage.cs
- ListViewInsertedEventArgs.cs
- PersonalizationStateQuery.cs
- ItemContainerProviderWrapper.cs
- FunctionDetailsReader.cs
- ConfigurationPropertyAttribute.cs
- CodeAssignStatement.cs
- HighlightVisual.cs
- TextRangeBase.cs
- MsmqIntegrationChannelFactory.cs
- PolyLineSegment.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- followingsibling.cs
- UpdateDelegates.Generated.cs
- AssociationTypeEmitter.cs
- SafeProcessHandle.cs
- ChangeTracker.cs
- Bitmap.cs
- SerializationBinder.cs
- ProvideValueServiceProvider.cs
- TableLayoutCellPaintEventArgs.cs
- MethodAccessException.cs
- WaitForChangedResult.cs
- RegexBoyerMoore.cs