Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / Microsoft / Win32 / SafeHandles / SafeTimerHandle.cs / 1305376 / 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; using System.Runtime.Versioning; 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)] [ResourceExposure(ResourceScope.None)] [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
- BuildManagerHost.cs
- DrawListViewSubItemEventArgs.cs
- FlowSwitchDesigner.xaml.cs
- StrokeNodeEnumerator.cs
- ScriptRef.cs
- ReturnType.cs
- IItemContainerGenerator.cs
- DesignerActionPanel.cs
- ThreadAttributes.cs
- DoubleLinkListEnumerator.cs
- TemplateBuilder.cs
- RuleSet.cs
- Path.cs
- RankException.cs
- CodeDirectoryCompiler.cs
- ObjectQueryProvider.cs
- ToolboxBitmapAttribute.cs
- ResourceIDHelper.cs
- ThicknessAnimation.cs
- BitmapEncoder.cs
- XmlLoader.cs
- mda.cs
- SiteMapDataSourceView.cs
- ToolBarButtonClickEvent.cs
- FunctionGenerator.cs
- MenuItemCollectionEditorDialog.cs
- ProjectionNode.cs
- RegexCaptureCollection.cs
- Shape.cs
- DbParameterCollection.cs
- CultureTable.cs
- X509Certificate2.cs
- ParameterBuilder.cs
- PageOutputQuality.cs
- TaskFormBase.cs
- AddInPipelineAttributes.cs
- XMLSyntaxException.cs
- XmlSchemaAttribute.cs
- LinkGrep.cs
- ISCIIEncoding.cs
- Thickness.cs
- EventLogLink.cs
- GridViewColumnCollection.cs
- ChannelRequirements.cs
- ModuleElement.cs
- GridViewDesigner.cs
- StrongNameUtility.cs
- ObjectSecurity.cs
- FixedBufferAttribute.cs
- Renderer.cs
- CopyAttributesAction.cs
- XmlUnspecifiedAttribute.cs
- SourceLineInfo.cs
- WbmpConverter.cs
- ItemCheckedEvent.cs
- Mappings.cs
- LockedHandleGlyph.cs
- EventItfInfo.cs
- BinaryFormatterWriter.cs
- AppDomainManager.cs
- OutputCacheModule.cs
- ContentPropertyAttribute.cs
- JsonReader.cs
- HandlerBase.cs
- SecurityRuntime.cs
- TextDecorationCollection.cs
- SQLRoleProvider.cs
- DescendentsWalkerBase.cs
- ActivityExecutor.cs
- KeyValueConfigurationCollection.cs
- Timeline.cs
- ScalarConstant.cs
- unsafenativemethodsother.cs
- XamlToRtfParser.cs
- EmptyQuery.cs
- DrawingAttributeSerializer.cs
- odbcmetadatacolumnnames.cs
- PreservationFileWriter.cs
- ListViewInsertEventArgs.cs
- WebControl.cs
- PageCatalogPart.cs
- ScriptResourceHandler.cs
- SessionEndingEventArgs.cs
- FileChangesMonitor.cs
- EventProxy.cs
- DataGridViewCellStateChangedEventArgs.cs
- DataTableMappingCollection.cs
- ComponentEvent.cs
- ToggleButton.cs
- GifBitmapDecoder.cs
- ResourceExpression.cs
- MasterPageBuildProvider.cs
- Listbox.cs
- EdmConstants.cs
- StreamUpdate.cs
- ConnectionConsumerAttribute.cs
- InstanceDataCollectionCollection.cs
- LifetimeServices.cs
- Queue.cs
- DriveNotFoundException.cs