Code:
/ 4.0 / 4.0 / 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. // ==++== // // 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
- RelationshipType.cs
- Assembly.cs
- MulticastNotSupportedException.cs
- FormatterConverter.cs
- CodeDomExtensionMethods.cs
- HashHelper.cs
- CommonGetThemePartSize.cs
- NonParentingControl.cs
- MemberDescriptor.cs
- RestClientProxyHandler.cs
- EntityKey.cs
- CorrelationToken.cs
- XAMLParseException.cs
- WebPartConnectionsCancelEventArgs.cs
- PropertyOverridesDialog.cs
- ObjectDataProvider.cs
- DetailsViewUpdateEventArgs.cs
- AttachmentCollection.cs
- EditingCommands.cs
- Axis.cs
- AuthenticationSection.cs
- ContentDisposition.cs
- IntSecurity.cs
- FormatConvertedBitmap.cs
- SystemIPv6InterfaceProperties.cs
- EventLogStatus.cs
- EllipseGeometry.cs
- DependencyPropertyKey.cs
- ApplicationBuildProvider.cs
- XamlReader.cs
- WsdlExporter.cs
- InertiaRotationBehavior.cs
- ZipIOFileItemStream.cs
- ManagedWndProcTracker.cs
- ListView.cs
- ReaderWriterLockWrapper.cs
- HttpStreamXmlDictionaryReader.cs
- RuleInfoComparer.cs
- EntityViewGenerationAttribute.cs
- ReferenceEqualityComparer.cs
- PrivateFontCollection.cs
- latinshape.cs
- PauseStoryboard.cs
- SessionEndingEventArgs.cs
- XmlParser.cs
- TogglePattern.cs
- Dynamic.cs
- CodeMethodInvokeExpression.cs
- DataGridColumnReorderingEventArgs.cs
- XD.cs
- BulletedList.cs
- XPathMessageFilterElementComparer.cs
- OrderedEnumerableRowCollection.cs
- FacetDescription.cs
- EntityStoreSchemaFilterEntry.cs
- HeaderedItemsControl.cs
- PropertySet.cs
- ExpandableObjectConverter.cs
- CompilerErrorCollection.cs
- Select.cs
- ErrorFormatter.cs
- TextRunCache.cs
- OpenCollectionAsyncResult.cs
- MethodCallTranslator.cs
- ChildChangedEventArgs.cs
- FixedPageStructure.cs
- DataSetMappper.cs
- BindableTemplateBuilder.cs
- CompiledXpathExpr.cs
- XsltException.cs
- SelectionProviderWrapper.cs
- RpcResponse.cs
- login.cs
- DesignerActionList.cs
- DataGridViewCellStyleEditor.cs
- PathFigureCollection.cs
- OperationExecutionFault.cs
- FollowerQueueCreator.cs
- MetadataStore.cs
- BufferAllocator.cs
- SoapHeader.cs
- SQLInt64.cs
- WindowsListViewGroup.cs
- ChildDocumentBlock.cs
- AppDomainCompilerProxy.cs
- Atom10ItemFormatter.cs
- RTLAwareMessageBox.cs
- PageRanges.cs
- BaseAppDomainProtocolHandler.cs
- ListItemConverter.cs
- AssemblyEvidenceFactory.cs
- ReadWriteObjectLock.cs
- Size3D.cs
- XslTransform.cs
- Accessible.cs
- DesignerPerfEventProvider.cs
- ResourceBinder.cs
- DataServiceKeyAttribute.cs
- SingleAnimationUsingKeyFrames.cs
- ConfigurationLocationCollection.cs