Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / Microsoft / Win32 / SafeHandles / SafeTimerHandle.cs / 1 / SafeTimerHandle.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SafeTimerHandle ** **Author: David Gutierrez ([....]) ** ** A wrapper for a timer handle ** ** Date: July 23, 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 SafeTimerHandle : SafeHandleZeroOrMinusOneIsInvalid { // Note that CreateWaitableTimer returns 0 on failure internal SafeTimerHandle() : base (true) {} // Not currently used //[SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode=true)] //internal SafeTimerHandle(IntPtr existingHandle, bool ownsHandle) : base(ownsHandle) { // SetHandle(existingHandle); //} [DllImport(ExternDll.Kernel32, ExactSpelling=true, SetLastError=true)] [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] private static extern bool CloseHandle(IntPtr handle); override protected bool ReleaseHandle() { return CloseHandle(handle); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ActivityDesigner.cs
- OdbcConnectionStringbuilder.cs
- ConnectionStringsExpressionEditor.cs
- Stack.cs
- HttpStreams.cs
- AliasExpr.cs
- WindowsToolbar.cs
- Single.cs
- SystemUnicastIPAddressInformation.cs
- TemplateControlBuildProvider.cs
- TTSEngineProxy.cs
- ProxyWebPart.cs
- EntityKey.cs
- LinkButton.cs
- PathHelper.cs
- VectorValueSerializer.cs
- DelayDesigner.cs
- SupportingTokenSpecification.cs
- _IPv6Address.cs
- StringSorter.cs
- invalidudtexception.cs
- NativeRecognizer.cs
- FormViewRow.cs
- GlyphInfoList.cs
- Lease.cs
- RuntimeConfigLKG.cs
- CompareValidator.cs
- WebRequestModuleElementCollection.cs
- ItemsControl.cs
- DataViewListener.cs
- SqlConnection.cs
- CompositeTypefaceMetrics.cs
- PersistNameAttribute.cs
- XmlProcessingInstruction.cs
- StringWriter.cs
- TemplatedWizardStep.cs
- SHA1Managed.cs
- InkCanvasSelection.cs
- EmptyEnumerator.cs
- HelpExampleGenerator.cs
- XmlSchemaInfo.cs
- GlyphRunDrawing.cs
- DataGridSortCommandEventArgs.cs
- SuppressIldasmAttribute.cs
- Empty.cs
- Module.cs
- X509CertificateStore.cs
- DataTableExtensions.cs
- BrowserDefinitionCollection.cs
- SuppressIldasmAttribute.cs
- UnsafeNativeMethods.cs
- SecurityHeader.cs
- util.cs
- XappLauncher.cs
- ServiceChannelManager.cs
- ComponentSerializationService.cs
- WebPartCloseVerb.cs
- XmlArrayItemAttributes.cs
- PhysicalAddress.cs
- DataTemplateSelector.cs
- FormatException.cs
- DockingAttribute.cs
- HtmlElement.cs
- SecurityListenerSettingsLifetimeManager.cs
- EditorZoneAutoFormat.cs
- TargetFrameworkUtil.cs
- RSAPKCS1SignatureFormatter.cs
- _ScatterGatherBuffers.cs
- Decoder.cs
- AutoResizedEvent.cs
- InstanceLockedException.cs
- PenLineJoinValidation.cs
- CompilerWrapper.cs
- _OSSOCK.cs
- ObjectConverter.cs
- _ConnectStream.cs
- TextProperties.cs
- PolyLineSegment.cs
- ComponentCodeDomSerializer.cs
- Fx.cs
- DesignerTextBoxAdapter.cs
- ResXResourceReader.cs
- VirtualPathData.cs
- FieldCollectionEditor.cs
- PathSegment.cs
- ExpandCollapsePattern.cs
- CodeTypeParameterCollection.cs
- ForceCopyBuildProvider.cs
- CodeSnippetStatement.cs
- PointAnimationUsingPath.cs
- AlignmentYValidation.cs
- TextDecorationUnitValidation.cs
- GeneratedCodeAttribute.cs
- ScopeElement.cs
- UrlAuthFailedErrorFormatter.cs
- XmlSchemaAnyAttribute.cs
- WebPartEditorOkVerb.cs
- NegotiateStream.cs
- TabControl.cs
- ImageBrush.cs