Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / Microsoft / Win32 / SafeHandles / SafeEventLogReadHandle.cs / 1305376 / SafeEventLogReadHandle.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SafeEventLogReadHandle ** **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 SafeEventLogReadHandle : SafeHandleZeroOrMinusOneIsInvalid { // Note: OpenEventLog returns 0 on failure. internal SafeEventLogReadHandle () : base(true) { } [DllImport(ExternDll.Advapi32, CharSet=System.Runtime.InteropServices.CharSet.Unicode, SetLastError=true)] [ResourceExposure(ResourceScope.Machine)] internal static extern SafeEventLogReadHandle OpenEventLog(string UNCServerName, string sourceName); [DllImport(ExternDll.Advapi32, SetLastError=true)] [ResourceExposure(ResourceScope.None)] [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] private static extern bool CloseEventLog(IntPtr hEventLog); override protected bool ReleaseHandle() { return CloseEventLog(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
- HelpEvent.cs
- FastEncoderWindow.cs
- SelectionItemPattern.cs
- CollectionBase.cs
- AddingNewEventArgs.cs
- printdlgexmarshaler.cs
- BaseTemplateParser.cs
- XMLDiffLoader.cs
- SectionVisual.cs
- CellConstant.cs
- IpcClientChannel.cs
- TraceHandler.cs
- TypeValidationEventArgs.cs
- TextElementAutomationPeer.cs
- ObjectDataSourceSelectingEventArgs.cs
- HtmlLink.cs
- TableChangeProcessor.cs
- StrokeIntersection.cs
- SQLUtility.cs
- PolicyConversionContext.cs
- TargetInvocationException.cs
- XamlValidatingReader.cs
- AttachedAnnotationChangedEventArgs.cs
- DbConnectionPoolIdentity.cs
- Logging.cs
- AxisAngleRotation3D.cs
- XhtmlBasicImageAdapter.cs
- MgmtResManager.cs
- AnnotationService.cs
- CaseStatementProjectedSlot.cs
- SimpleFileLog.cs
- ListControlConvertEventArgs.cs
- DataControlField.cs
- PrintPageEvent.cs
- TouchFrameEventArgs.cs
- Unit.cs
- HttpListenerRequestUriBuilder.cs
- RelationshipDetailsRow.cs
- RectangleGeometry.cs
- ContentElementAutomationPeer.cs
- CryptoStream.cs
- FullTrustAssemblyCollection.cs
- OLEDB_Util.cs
- CompoundFileReference.cs
- RtfToXamlReader.cs
- DataProtection.cs
- DataException.cs
- TreeNodeEventArgs.cs
- XmlObjectSerializerContext.cs
- XmlReaderSettings.cs
- CodeGenHelper.cs
- SelectionList.cs
- FixedPageStructure.cs
- ProfileService.cs
- ChildChangedEventArgs.cs
- RijndaelManaged.cs
- DebuggerAttributes.cs
- CurrentChangingEventManager.cs
- ActiveDesignSurfaceEvent.cs
- HttpListenerElement.cs
- SourceFileInfo.cs
- XmlDictionaryReaderQuotasElement.cs
- BehaviorDragDropEventArgs.cs
- UnsafeMethods.cs
- ReachVisualSerializerAsync.cs
- WebCategoryAttribute.cs
- ObjectIDGenerator.cs
- ProjectionCamera.cs
- PrefixQName.cs
- WebPartMovingEventArgs.cs
- StorageConditionPropertyMapping.cs
- DetailsViewPagerRow.cs
- SmtpNetworkElement.cs
- SessionIDManager.cs
- GrammarBuilder.cs
- TextParagraph.cs
- AddingNewEventArgs.cs
- __ComObject.cs
- DocumentAutomationPeer.cs
- Attributes.cs
- SyntaxCheck.cs
- HtmlButton.cs
- DbConnectionClosed.cs
- FileCodeGroup.cs
- ExtensionSimplifierMarkupObject.cs
- NumberSubstitution.cs
- GeometryGroup.cs
- XmlSerializationReader.cs
- QueryCacheKey.cs
- PropertyIDSet.cs
- QilStrConcatenator.cs
- MailBnfHelper.cs
- SurrogateChar.cs
- ByteStream.cs
- PrimitiveSchema.cs
- FixedSOMElement.cs
- Triangle.cs
- Profiler.cs
- ThaiBuddhistCalendar.cs
- ProfileProvider.cs