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
- SqlDataSourceView.cs
- FunctionDetailsReader.cs
- Compiler.cs
- DeferredSelectedIndexReference.cs
- BindingGroup.cs
- BindingElementExtensionElement.cs
- ListViewDeleteEventArgs.cs
- Model3DGroup.cs
- DbXmlEnabledProviderManifest.cs
- SoapParser.cs
- DoubleConverter.cs
- Resources.Designer.cs
- XPathMessageFilterElementCollection.cs
- WindowsScroll.cs
- BaseDataList.cs
- WebPartEditorCancelVerb.cs
- ParameterModifier.cs
- WeakHashtable.cs
- TemplateComponentConnector.cs
- XmlNodeChangedEventManager.cs
- Char.cs
- Marshal.cs
- XamlTreeBuilder.cs
- RelationshipEnd.cs
- BaseDataBoundControl.cs
- AppDomainUnloadedException.cs
- PeerMessageDispatcher.cs
- ChangePassword.cs
- SupportingTokenParameters.cs
- RijndaelManaged.cs
- sqlpipe.cs
- StickyNoteContentControl.cs
- HTMLTagNameToTypeMapper.cs
- _DomainName.cs
- PartialCachingControl.cs
- SimpleTextLine.cs
- SectionXmlInfo.cs
- XmlValidatingReaderImpl.cs
- FunctionDescription.cs
- PlainXmlSerializer.cs
- EventBuilder.cs
- IPPacketInformation.cs
- HtmlShimManager.cs
- NestedContainer.cs
- DecoderBestFitFallback.cs
- FlowLayoutSettings.cs
- IntegerValidatorAttribute.cs
- TextEditorCharacters.cs
- StylusPointCollection.cs
- ServicePointManager.cs
- ConfigurationSectionGroup.cs
- XsdBuilder.cs
- KeyValueConfigurationCollection.cs
- ContentPlaceHolder.cs
- RotationValidation.cs
- DataGridViewColumnConverter.cs
- HttpContext.cs
- StreamReader.cs
- CapacityStreamGeometryContext.cs
- Grid.cs
- SspiSafeHandles.cs
- PropertySegmentSerializer.cs
- ObjectQueryState.cs
- MethodExecutor.cs
- HtmlInputCheckBox.cs
- Privilege.cs
- Vector.cs
- JulianCalendar.cs
- CrossSiteScriptingValidation.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- GlyphCollection.cs
- SimpleWebHandlerParser.cs
- RegexCharClass.cs
- LeftCellWrapper.cs
- XmlSerializableReader.cs
- TimeSpanOrInfiniteValidator.cs
- SelectionUIHandler.cs
- CharEntityEncoderFallback.cs
- EndOfStreamException.cs
- XmlSchemaSimpleTypeList.cs
- CommandSet.cs
- Point.cs
- ElementProxy.cs
- XmlAttributeCache.cs
- WinFormsUtils.cs
- HttpHandlerAction.cs
- TreeIterator.cs
- WebDisplayNameAttribute.cs
- RowsCopiedEventArgs.cs
- CmsInterop.cs
- SecurityRuntime.cs
- ListViewSortEventArgs.cs
- SystemParameters.cs
- ButtonBase.cs
- ProjectionAnalyzer.cs
- DataServiceResponse.cs
- NullableLongAverageAggregationOperator.cs
- RIPEMD160.cs
- OciEnlistContext.cs
- AnimationTimeline.cs