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
- DataTableReaderListener.cs
- ArrayConverter.cs
- ScrollBarRenderer.cs
- DebugTracing.cs
- _DisconnectOverlappedAsyncResult.cs
- HtmlHead.cs
- UserControlAutomationPeer.cs
- UrlMappingsSection.cs
- SmiConnection.cs
- ColorConverter.cs
- StrongNameIdentityPermission.cs
- RegexReplacement.cs
- UpdateCompiler.cs
- Expressions.cs
- Point3DKeyFrameCollection.cs
- log.cs
- JoinTreeSlot.cs
- InternalPermissions.cs
- TypeConverter.cs
- HttpHandlersSection.cs
- XPathNavigator.cs
- AppAction.cs
- TagNameToTypeMapper.cs
- RegistryKey.cs
- RuleProcessor.cs
- IndexerNameAttribute.cs
- EventItfInfo.cs
- InvalidOleVariantTypeException.cs
- PropertyGridView.cs
- ApplicationFileParser.cs
- ListenerSingletonConnectionReader.cs
- HttpListener.cs
- ExtendedProtectionPolicyElement.cs
- CompilerGeneratedAttribute.cs
- TextBoxBase.cs
- SqlColumnizer.cs
- BinaryObjectReader.cs
- IImplicitResourceProvider.cs
- PrimaryKeyTypeConverter.cs
- OdbcRowUpdatingEvent.cs
- UnsafeNetInfoNativeMethods.cs
- ArraySegment.cs
- DateTimePicker.cs
- ColumnWidthChangedEvent.cs
- XmlNodeWriter.cs
- BridgeDataReader.cs
- TreeNodeStyle.cs
- FixedHighlight.cs
- StoreAnnotationsMap.cs
- DesignSurfaceCollection.cs
- DataControlFieldCell.cs
- TileModeValidation.cs
- XslNumber.cs
- SystemPens.cs
- PersonalizableTypeEntry.cs
- EmptyReadOnlyDictionaryInternal.cs
- SqlUserDefinedAggregateAttribute.cs
- ErrorWebPart.cs
- OAVariantLib.cs
- HtmlButton.cs
- SHA512Managed.cs
- QilLoop.cs
- DeviceContexts.cs
- PlaceHolder.cs
- BindingExpressionUncommonField.cs
- Point.cs
- PixelFormats.cs
- StrokeCollection2.cs
- ByteStream.cs
- ArrayExtension.cs
- Currency.cs
- Help.cs
- AppDomain.cs
- Frame.cs
- DrawingAttributeSerializer.cs
- PriorityBindingExpression.cs
- PropertyStore.cs
- CustomAttributeBuilder.cs
- SqlBinder.cs
- SafeEventLogReadHandle.cs
- SafeCryptoHandles.cs
- OrderPreservingPipeliningSpoolingTask.cs
- UInt16.cs
- MessageTransmitTraceRecord.cs
- RenderingEventArgs.cs
- StrokeDescriptor.cs
- WinEventQueueItem.cs
- Span.cs
- SQLDoubleStorage.cs
- WindowsToolbarAsMenu.cs
- StringComparer.cs
- XmlWriterDelegator.cs
- EncryptedData.cs
- WriteTimeStream.cs
- GridViewColumnCollection.cs
- EmbossBitmapEffect.cs
- ListViewItemMouseHoverEvent.cs
- ToolStripPanelRenderEventArgs.cs
- SqlGatherProducedAliases.cs
- HostProtectionPermission.cs