Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / Microsoft / Win32 / SafeHandles / SafeEventLogReadHandle.cs / 1 / 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; 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)] internal static extern SafeEventLogReadHandle OpenEventLog(string UNCServerName, string sourceName); [DllImport(ExternDll.Advapi32, SetLastError=true)] [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] private static extern bool CloseEventLog(IntPtr hEventLog); override protected bool ReleaseHandle() { return CloseEventLog(handle); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WindowsProgressbar.cs
- SiteOfOriginContainer.cs
- LiteralText.cs
- AudioFormatConverter.cs
- DrawListViewColumnHeaderEventArgs.cs
- IssuedTokenParametersElement.cs
- WindowsListViewGroupHelper.cs
- XmlDataSourceNodeDescriptor.cs
- OuterGlowBitmapEffect.cs
- UrlMappingsSection.cs
- IndependentlyAnimatedPropertyMetadata.cs
- CompiledAction.cs
- PrinterUnitConvert.cs
- TemplateBaseAction.cs
- ConstraintStruct.cs
- XPathArrayIterator.cs
- TextChangedEventArgs.cs
- ObfuscationAttribute.cs
- UnsafeNativeMethods.cs
- DoubleIndependentAnimationStorage.cs
- embossbitmapeffect.cs
- VerticalAlignConverter.cs
- AutoResizedEvent.cs
- SynchronizedChannelCollection.cs
- BitmapFrameEncode.cs
- ModifierKeysValueSerializer.cs
- HttpStaticObjectsCollectionBase.cs
- RolePrincipal.cs
- ToolStripMenuItem.cs
- Calendar.cs
- HelpEvent.cs
- VerificationAttribute.cs
- MethodBody.cs
- XamlPoint3DCollectionSerializer.cs
- AQNBuilder.cs
- InputScope.cs
- SplayTreeNode.cs
- CursorEditor.cs
- SamlAssertionDirectKeyIdentifierClause.cs
- basecomparevalidator.cs
- UIPropertyMetadata.cs
- HttpModuleActionCollection.cs
- sitestring.cs
- GenericWebPart.cs
- WindowsRichEdit.cs
- LambdaCompiler.Address.cs
- SerialPinChanges.cs
- XMLDiffLoader.cs
- DbProviderManifest.cs
- ListBindingHelper.cs
- Thickness.cs
- FindCriteria.cs
- FormClosedEvent.cs
- MetaTable.cs
- LineServicesRun.cs
- DiagnosticTrace.cs
- RoleBoolean.cs
- DataTableReaderListener.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- KeyPullup.cs
- DbInsertCommandTree.cs
- SynchronizationContext.cs
- EntryIndex.cs
- JoinGraph.cs
- WSSecurityPolicy.cs
- ZeroOpNode.cs
- InternalBufferOverflowException.cs
- Font.cs
- RegisteredHiddenField.cs
- TypeSystem.cs
- AddInControllerImpl.cs
- QilDataSource.cs
- SafeMILHandle.cs
- SecurityDescriptor.cs
- GetMemberBinder.cs
- NeutralResourcesLanguageAttribute.cs
- TraceLevelStore.cs
- CompiledRegexRunnerFactory.cs
- TextProviderWrapper.cs
- PropertyContainer.cs
- XmlSerializableWriter.cs
- ObjectSet.cs
- Environment.cs
- FixedDocumentSequencePaginator.cs
- CustomCategoryAttribute.cs
- OracleNumber.cs
- SendingRequestEventArgs.cs
- CodeChecksumPragma.cs
- IconEditor.cs
- DataList.cs
- Span.cs
- StyleSheetDesigner.cs
- ValidateNames.cs
- ObfuscationAttribute.cs
- UnsafeNativeMethods.cs
- MessageSmuggler.cs
- LinearKeyFrames.cs
- TextRenderer.cs
- ButtonBaseAdapter.cs
- Crc32Helper.cs