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
- CodeNamespaceImportCollection.cs
- OutputWindow.cs
- XmlAggregates.cs
- QueryGenerator.cs
- ElementInit.cs
- XmlTextReader.cs
- ModelEditingScope.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- WebPartDisplayMode.cs
- StyleSheetDesigner.cs
- Helper.cs
- COSERVERINFO.cs
- TagPrefixCollection.cs
- QilReference.cs
- TransformGroup.cs
- BufferedGraphics.cs
- DeploymentSectionCache.cs
- XmlNode.cs
- MachineKeySection.cs
- WizardSideBarListControlItem.cs
- CustomErrorCollection.cs
- BufferBuilder.cs
- PhysicalFontFamily.cs
- AuthorizationRule.cs
- EventSinkHelperWriter.cs
- LogStore.cs
- DataControlFieldCell.cs
- TableCell.cs
- DiscreteKeyFrames.cs
- _PooledStream.cs
- AdornedElementPlaceholder.cs
- EventSchemaTraceListener.cs
- StringFormat.cs
- FixedTextContainer.cs
- DesignerSerializationVisibilityAttribute.cs
- UdpSocketReceiveManager.cs
- RowToFieldTransformer.cs
- SqlDataReaderSmi.cs
- PositiveTimeSpanValidatorAttribute.cs
- SimpleLine.cs
- SqlDataSourceCommandEventArgs.cs
- LicenseProviderAttribute.cs
- ImportException.cs
- Point.cs
- SQLChars.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- PngBitmapDecoder.cs
- Adorner.cs
- SafeThemeHandle.cs
- CacheDependency.cs
- QueryCorrelationInitializer.cs
- DataControlFieldCollection.cs
- ClientSettingsSection.cs
- TextBox.cs
- ImportOptions.cs
- Size3DConverter.cs
- SqlCachedBuffer.cs
- BoolLiteral.cs
- newitemfactory.cs
- XamlUtilities.cs
- HttpProcessUtility.cs
- WorkflowService.cs
- WebConvert.cs
- XPathArrayIterator.cs
- DragDeltaEventArgs.cs
- PipeStream.cs
- StrokeNodeData.cs
- QilName.cs
- FirstMatchCodeGroup.cs
- AccessDataSourceView.cs
- GB18030Encoding.cs
- Encoder.cs
- TranslateTransform3D.cs
- DebugView.cs
- ClientType.cs
- MiniLockedBorderGlyph.cs
- OdbcConnectionFactory.cs
- PropertyGridView.cs
- TextViewBase.cs
- ReferenceConverter.cs
- SafeSecurityHelper.cs
- ElementAction.cs
- PresentationAppDomainManager.cs
- XmlUTF8TextWriter.cs
- HelloMessageApril2005.cs
- OdbcConnectionString.cs
- ResourceCategoryAttribute.cs
- WinEventWrap.cs
- ColumnClickEvent.cs
- RightsManagementPermission.cs
- TabControlCancelEvent.cs
- MenuCommand.cs
- TrackingProfileSerializer.cs
- X509RawDataKeyIdentifierClause.cs
- WindowsScrollBarBits.cs
- ACE.cs
- WinInetCache.cs
- ByteFacetDescriptionElement.cs
- PartialCachingControl.cs
- WsdlEndpointConversionContext.cs