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
- TextSpan.cs
- DbParameterCollectionHelper.cs
- SqlWebEventProvider.cs
- DesignerLabelAdapter.cs
- CompilerWrapper.cs
- _ScatterGatherBuffers.cs
- SqlFunctionAttribute.cs
- HashSetEqualityComparer.cs
- SafeNativeHandle.cs
- TextStore.cs
- cryptoapiTransform.cs
- DataObjectCopyingEventArgs.cs
- SequenceDesigner.xaml.cs
- ParseChildrenAsPropertiesAttribute.cs
- ParenthesizePropertyNameAttribute.cs
- DependsOnAttribute.cs
- TreeWalkHelper.cs
- TypeDependencyAttribute.cs
- UrlMapping.cs
- TripleDES.cs
- TemplateComponentConnector.cs
- ReliabilityContractAttribute.cs
- EntityContainerEntitySetDefiningQuery.cs
- DescendentsWalker.cs
- FileUtil.cs
- XPathNavigator.cs
- SimpleRecyclingCache.cs
- RunWorkerCompletedEventArgs.cs
- FreezableOperations.cs
- DataBoundControl.cs
- CodeMemberMethod.cs
- HtmlHistory.cs
- LambdaCompiler.Logical.cs
- ProjectionPlan.cs
- DefaultPropertyAttribute.cs
- WorkflowServiceHostFactory.cs
- EntityDataSourceWrapper.cs
- XmlDataCollection.cs
- AppDomainUnloadedException.cs
- Thickness.cs
- FragmentQuery.cs
- ReadOnlyPermissionSet.cs
- ToolStripItemCollection.cs
- PageRanges.cs
- TextFormatter.cs
- EventMappingSettings.cs
- ReadOnlyDataSource.cs
- _ListenerAsyncResult.cs
- HttpInputStream.cs
- ImageBrush.cs
- Stylus.cs
- ListCommandEventArgs.cs
- MessageQueueEnumerator.cs
- DataGridSortCommandEventArgs.cs
- ArglessEventHandlerProxy.cs
- KeyEvent.cs
- ChangePassword.cs
- SmtpMail.cs
- ListenerAdapter.cs
- HandlerFactoryWrapper.cs
- OrCondition.cs
- AutomationElement.cs
- DataSourceSelectArguments.cs
- ToolbarAUtomationPeer.cs
- CodeTypeOfExpression.cs
- BCryptSafeHandles.cs
- XPathNodePointer.cs
- BigInt.cs
- SectionInformation.cs
- RoutedCommand.cs
- CodeAccessSecurityEngine.cs
- XmlNodeChangedEventArgs.cs
- LockedAssemblyCache.cs
- StylusPointDescription.cs
- CheckoutException.cs
- ModuleConfigurationInfo.cs
- OperationExecutionFault.cs
- SelectionGlyphBase.cs
- ManagementEventWatcher.cs
- TablePattern.cs
- ResXBuildProvider.cs
- XmlExtensionFunction.cs
- OpenFileDialog.cs
- SoapObjectWriter.cs
- InputBinding.cs
- StyleCollection.cs
- XmlWriterDelegator.cs
- SRGSCompiler.cs
- WebServiceClientProxyGenerator.cs
- XmlUtil.cs
- XPathDocument.cs
- LabelAutomationPeer.cs
- HtmlInputHidden.cs
- EntityDataSourceConfigureObjectContextPanel.cs
- InkCanvas.cs
- ProfileEventArgs.cs
- XmlSchemaSubstitutionGroup.cs
- TextDecorationCollection.cs
- QueryCacheEntry.cs
- Utils.cs