Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // 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); } } } // 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
- EntityDataSourceEntityTypeFilterItem.cs
- TypedRowGenerator.cs
- AppManager.cs
- ElementAction.cs
- LinkClickEvent.cs
- WsatEtwTraceListener.cs
- SupportingTokenBindingElement.cs
- LicFileLicenseProvider.cs
- TokenBasedSetEnumerator.cs
- Nodes.cs
- StdRegProviderWrapper.cs
- MetabaseServerConfig.cs
- UseAttributeSetsAction.cs
- WasHttpHandlersInstallComponent.cs
- XmlBinaryReader.cs
- WebPartManager.cs
- ServiceAppDomainAssociationProvider.cs
- ConstantCheck.cs
- __Filters.cs
- DefaultValueAttribute.cs
- PerspectiveCamera.cs
- MemberBinding.cs
- ActivationServices.cs
- Vector.cs
- CodeTypeDelegate.cs
- PolicyStatement.cs
- XmlReflectionImporter.cs
- TransactionChannelListener.cs
- QueryContinueDragEvent.cs
- Stopwatch.cs
- ArgumentDesigner.xaml.cs
- GridViewCommandEventArgs.cs
- XmlTypeAttribute.cs
- DbConnectionPool.cs
- GPPOINTF.cs
- RepeatBehavior.cs
- CodeDefaultValueExpression.cs
- InkSerializer.cs
- ResourceWriter.cs
- EDesignUtil.cs
- WebBrowserDesigner.cs
- HierarchicalDataSourceControl.cs
- WebBrowserPermission.cs
- LingerOption.cs
- XmlCompatibilityReader.cs
- FileSecurity.cs
- CommandDevice.cs
- Timeline.cs
- UdpReplyToBehavior.cs
- versioninfo.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- SizeFConverter.cs
- ActivityWithResult.cs
- PagedControl.cs
- PtsPage.cs
- MustUnderstandSoapException.cs
- SingleAnimationUsingKeyFrames.cs
- PageThemeParser.cs
- DynamicILGenerator.cs
- RtfToXamlLexer.cs
- DefaultSettingsSection.cs
- CommonBehaviorsSection.cs
- DynamicRendererThreadManager.cs
- HtmlInputRadioButton.cs
- BitmapEffectState.cs
- BamlBinaryReader.cs
- ElementMarkupObject.cs
- GestureRecognizer.cs
- SqlConnectionString.cs
- CharConverter.cs
- CaseCqlBlock.cs
- FrameAutomationPeer.cs
- AgileSafeNativeMemoryHandle.cs
- XmlDataImplementation.cs
- WebPartZoneCollection.cs
- StyleSelector.cs
- DataGridViewCellParsingEventArgs.cs
- OdbcDataAdapter.cs
- Error.cs
- ControlCachePolicy.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- FilterElement.cs
- PageSetupDialog.cs
- Common.cs
- PublishLicense.cs
- ArrangedElement.cs
- AssociationSetMetadata.cs
- MessageSecurityOverHttp.cs
- StylusPointCollection.cs
- HeaderedItemsControl.cs
- TextEditorDragDrop.cs
- OrderedHashRepartitionEnumerator.cs
- FtpWebResponse.cs
- InternalPermissions.cs
- SemaphoreFullException.cs
- PropertyChangedEventArgs.cs
- EndpointNameMessageFilter.cs
- wgx_sdk_version.cs
- XPathPatternBuilder.cs
- PanelStyle.cs