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
- PanelStyle.cs
- SoapWriter.cs
- DataChangedEventManager.cs
- CursorConverter.cs
- ConfigXmlText.cs
- SharedUtils.cs
- SourceFileBuildProvider.cs
- DictionaryEntry.cs
- SendingRequestEventArgs.cs
- ImageIndexConverter.cs
- LocalizationParserHooks.cs
- UidPropertyAttribute.cs
- SqlClientWrapperSmiStreamChars.cs
- AppliesToBehaviorDecisionTable.cs
- SelectionItemPattern.cs
- XmlArrayItemAttributes.cs
- InstallerTypeAttribute.cs
- ConnectionManagementElement.cs
- Figure.cs
- TableCellCollection.cs
- VisualStyleElement.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- LassoHelper.cs
- SafeEventLogReadHandle.cs
- __TransparentProxy.cs
- UITypeEditor.cs
- FixedSOMTextRun.cs
- PathSegment.cs
- DialogResultConverter.cs
- SystemWebCachingSectionGroup.cs
- PaperSource.cs
- CounterCreationData.cs
- SystemMulticastIPAddressInformation.cs
- Span.cs
- StyleXamlParser.cs
- ISCIIEncoding.cs
- DataDocumentXPathNavigator.cs
- OutOfMemoryException.cs
- DocumentPageViewAutomationPeer.cs
- VisualTreeHelper.cs
- TypeBuilder.cs
- BinHexDecoder.cs
- ToggleProviderWrapper.cs
- BindingOperations.cs
- QilReplaceVisitor.cs
- DefaultValueAttribute.cs
- HealthMonitoringSection.cs
- Int32Converter.cs
- ParserHooks.cs
- Matrix.cs
- SecurityException.cs
- ComplexObject.cs
- NetworkInterface.cs
- SHA384Managed.cs
- RouteParser.cs
- TreeNodeClickEventArgs.cs
- ControlIdConverter.cs
- XmlUtil.cs
- FormViewInsertEventArgs.cs
- DbProviderServices.cs
- WpfWebRequestHelper.cs
- BrowserCapabilitiesCompiler.cs
- XmlWriterDelegator.cs
- Point3DCollection.cs
- MeshGeometry3D.cs
- CompleteWizardStep.cs
- AttributeUsageAttribute.cs
- ErrorRuntimeConfig.cs
- PreservationFileReader.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- mediaeventargs.cs
- WebPartConnectionsConfigureVerb.cs
- VectorCollection.cs
- ListBox.cs
- OleDbDataReader.cs
- ElementUtil.cs
- SaveFileDialog.cs
- TraceContextEventArgs.cs
- x509store.cs
- XmlMessageFormatter.cs
- Parser.cs
- CompilerGeneratedAttribute.cs
- X509SubjectKeyIdentifierClause.cs
- WebHeaderCollection.cs
- HwndStylusInputProvider.cs
- ReaderWriterLock.cs
- KeyValuePair.cs
- InputLanguageSource.cs
- TableItemStyle.cs
- RunInstallerAttribute.cs
- SBCSCodePageEncoding.cs
- DocobjHost.cs
- TabControlCancelEvent.cs
- XmlILIndex.cs
- OpenTypeLayout.cs
- ReadOnlyCollectionBase.cs
- TerminatorSinks.cs
- Funcletizer.cs
- MoveSizeWinEventHandler.cs
- SqlCacheDependencySection.cs