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
- StoreItemCollection.Loader.cs
- ConfigurationPropertyAttribute.cs
- OleDbDataAdapter.cs
- SqlAliasesReferenced.cs
- MemberExpression.cs
- HttpListenerRequest.cs
- HttpBrowserCapabilitiesBase.cs
- KeyedCollection.cs
- PersistChildrenAttribute.cs
- ProcessProtocolHandler.cs
- GestureRecognizer.cs
- KeyProperty.cs
- IndependentAnimationStorage.cs
- TraceXPathNavigator.cs
- BuildManagerHost.cs
- SequentialUshortCollection.cs
- FormattedText.cs
- TypeKeyValue.cs
- nulltextcontainer.cs
- TemplateNameScope.cs
- PkcsMisc.cs
- TrackBarRenderer.cs
- CachedTypeface.cs
- securitycriticaldataformultiplegetandset.cs
- StringValueSerializer.cs
- AddInDeploymentState.cs
- IndependentAnimationStorage.cs
- ControlsConfig.cs
- StringUtil.cs
- SafeNativeMethods.cs
- VBIdentifierDesigner.xaml.cs
- PlainXmlWriter.cs
- Profiler.cs
- parserscommon.cs
- BitVec.cs
- TextServicesManager.cs
- AdPostCacheSubstitution.cs
- NotifyParentPropertyAttribute.cs
- AppSettingsExpressionBuilder.cs
- StringBuilder.cs
- SqlProfileProvider.cs
- PaperSize.cs
- LicenseContext.cs
- BindingSource.cs
- WebBrowserEvent.cs
- CompilerTypeWithParams.cs
- HashSet.cs
- AutoResetEvent.cs
- SingleConverter.cs
- HwndTarget.cs
- BindingsCollection.cs
- ReadOnlyDictionary.cs
- XmlWriterTraceListener.cs
- TrackBarRenderer.cs
- ToolStripSplitStackLayout.cs
- PenLineJoinValidation.cs
- UseAttributeSetsAction.cs
- CreateUserErrorEventArgs.cs
- ControlOperationInvoker.cs
- TcpDuplicateContext.cs
- SoapIncludeAttribute.cs
- ArgumentDesigner.xaml.cs
- EDesignUtil.cs
- ResourceDefaultValueAttribute.cs
- _DigestClient.cs
- TreeNodeBinding.cs
- SocketAddress.cs
- ECDsa.cs
- AppDomainFactory.cs
- ScrollBar.cs
- CommentEmitter.cs
- EpmSyndicationContentDeSerializer.cs
- TypeForwardedToAttribute.cs
- WebPartTransformerAttribute.cs
- SafeHandle.cs
- OletxTransactionManager.cs
- RegexCharClass.cs
- PropertyMapper.cs
- ListSortDescriptionCollection.cs
- SHA256.cs
- infer.cs
- SqlConnectionPoolProviderInfo.cs
- Ppl.cs
- EventMap.cs
- QueryStringParameter.cs
- MethodAccessException.cs
- IdentifierCollection.cs
- HtmlShimManager.cs
- BezierSegment.cs
- DbInsertCommandTree.cs
- WebEventCodes.cs
- UnsafeNativeMethods.cs
- SiteMapSection.cs
- MimeMapping.cs
- InternalBufferOverflowException.cs
- RSAProtectedConfigurationProvider.cs
- SelectionRange.cs
- RotationValidation.cs
- Line.cs
- ExpressionBuilder.cs