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
- TypeSystem.cs
- EncryptedXml.cs
- EventMemberCodeDomSerializer.cs
- SmiSettersStream.cs
- ListViewGroup.cs
- ServicesUtilities.cs
- LambdaExpression.cs
- PropertyGrid.cs
- XmlSerializer.cs
- Assembly.cs
- OleDbConnection.cs
- FixedSOMGroup.cs
- QueryResult.cs
- HMACSHA384.cs
- UseAttributeSetsAction.cs
- ObjectPersistData.cs
- StateMachine.cs
- ToolStripDropDownClosingEventArgs.cs
- ObjectPropertyMapping.cs
- ParameterReplacerVisitor.cs
- objectquery_tresulttype.cs
- WebBrowserEvent.cs
- GradientStopCollection.cs
- TypefaceMetricsCache.cs
- ObjectConverter.cs
- StreamAsIStream.cs
- ReadWriteSpinLock.cs
- SubMenuStyle.cs
- WindowsFormsHostPropertyMap.cs
- ListBoxChrome.cs
- TableCellsCollectionEditor.cs
- EntityConnectionStringBuilderItem.cs
- HMACSHA512.cs
- FontDifferentiator.cs
- DataGridViewLinkCell.cs
- WebPartAuthorizationEventArgs.cs
- InputLanguageSource.cs
- LinkTarget.cs
- ComPlusInstanceContextInitializer.cs
- DataMember.cs
- CompositeControl.cs
- SecurityHelper.cs
- Scheduler.cs
- _SSPIWrapper.cs
- EnumValAlphaComparer.cs
- XPathMultyIterator.cs
- ArrayHelper.cs
- OleDbConnectionFactory.cs
- WebPartDescription.cs
- TaskFormBase.cs
- CacheVirtualItemsEvent.cs
- CatalogPart.cs
- CommonRemoteMemoryBlock.cs
- RadioButtonAutomationPeer.cs
- ListViewItem.cs
- DataGridViewSortCompareEventArgs.cs
- HttpCachePolicyElement.cs
- PreviewPageInfo.cs
- HttpListenerRequest.cs
- DispatcherTimer.cs
- SchemaNotation.cs
- Vars.cs
- RequiredFieldValidator.cs
- DataListCommandEventArgs.cs
- LayoutTable.cs
- RightNameExpirationInfoPair.cs
- ActiveDocumentEvent.cs
- ComponentCollection.cs
- DependencyPropertyDescriptor.cs
- NavigationPropertyEmitter.cs
- XpsLiterals.cs
- Pen.cs
- WhitespaceReader.cs
- _SslState.cs
- HtmlListAdapter.cs
- QilXmlWriter.cs
- Shape.cs
- XMLUtil.cs
- DotNetATv1WindowsLogEntryDeserializer.cs
- SoapAttributeAttribute.cs
- CultureInfoConverter.cs
- PropertyConverter.cs
- Vertex.cs
- DataGridTableCollection.cs
- TemplateContentLoader.cs
- SingleTagSectionHandler.cs
- WebScriptEnablingElement.cs
- WindowsFormsLinkLabel.cs
- StorageMappingItemCollection.cs
- OutputCacheSection.cs
- ProfileInfo.cs
- DataColumnCollection.cs
- SqlDataSourceConnectionPanel.cs
- PeerPresenceInfo.cs
- XsdCachingReader.cs
- UndoManager.cs
- ProxyWebPartConnectionCollection.cs
- TableAdapterManagerGenerator.cs
- OrderedDictionary.cs
- AxisAngleRotation3D.cs