Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / CompMod / Microsoft / Win32 / SafeHandles / SafeTimerHandle.cs / 1 / 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; 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)] [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; 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)] [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
- EntityDesignerDataSourceView.cs
- ColumnProvider.cs
- CheckBoxRenderer.cs
- CallbackBehaviorAttribute.cs
- MSG.cs
- Link.cs
- ResourceProviderFactory.cs
- ParagraphResult.cs
- DbConnectionHelper.cs
- RowUpdatedEventArgs.cs
- ClientApiGenerator.cs
- HybridDictionary.cs
- TagPrefixCollection.cs
- GenericTextProperties.cs
- PageCodeDomTreeGenerator.cs
- Effect.cs
- EarlyBoundInfo.cs
- HuffModule.cs
- WindowsRegion.cs
- DirtyTextRange.cs
- TypedTableGenerator.cs
- CommandManager.cs
- RoleManagerModule.cs
- LambdaCompiler.Binary.cs
- MergablePropertyAttribute.cs
- WindowsEditBoxRange.cs
- DataSysAttribute.cs
- DetailsViewDeleteEventArgs.cs
- ToolStripDropDownItemDesigner.cs
- ReadOnlyDictionary.cs
- DataReaderContainer.cs
- WeakReferenceKey.cs
- TextSelection.cs
- Label.cs
- ProvidersHelper.cs
- XmlSubtreeReader.cs
- TransformConverter.cs
- ImageButton.cs
- DataGridTableCollection.cs
- XmlFormatExtensionPointAttribute.cs
- WebPartMenu.cs
- DateRangeEvent.cs
- DefaultParameterValueAttribute.cs
- PropertyMappingExceptionEventArgs.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- diagnosticsswitches.cs
- TextLineResult.cs
- Section.cs
- EdmSchemaError.cs
- FormatConvertedBitmap.cs
- sqlpipe.cs
- NativeMethods.cs
- CannotUnloadAppDomainException.cs
- LineBreakRecord.cs
- ImpersonationContext.cs
- ColorKeyFrameCollection.cs
- ListViewItem.cs
- JsonWriterDelegator.cs
- CompilerGlobalScopeAttribute.cs
- CachedRequestParams.cs
- SynchronizedChannelCollection.cs
- ReadWriteObjectLock.cs
- ErrorLog.cs
- TransactedBatchContext.cs
- NavigatorOutput.cs
- DataSourceControl.cs
- ByteRangeDownloader.cs
- RecordManager.cs
- DynamicHyperLink.cs
- MethodExecutor.cs
- KnownColorTable.cs
- _ContextAwareResult.cs
- TypefaceMetricsCache.cs
- DataGridViewColumnEventArgs.cs
- BindUriHelper.cs
- StringKeyFrameCollection.cs
- SelectedDatesCollection.cs
- ContentElement.cs
- RegisteredExpandoAttribute.cs
- WrappedIUnknown.cs
- ClientUtils.cs
- TabControl.cs
- WaitHandleCannotBeOpenedException.cs
- EdmEntityTypeAttribute.cs
- DataGridViewCellEventArgs.cs
- TextServicesCompartmentEventSink.cs
- MemberJoinTreeNode.cs
- PagesSection.cs
- ServerValidateEventArgs.cs
- SqlDataSourceStatusEventArgs.cs
- _NestedMultipleAsyncResult.cs
- HtmlShimManager.cs
- AutomationTextAttribute.cs
- CustomMenuItemCollection.cs
- GeneratedView.cs
- CodePageUtils.cs
- CancellationTokenRegistration.cs
- Monitor.cs
- URIFormatException.cs
- InvalidAsynchronousStateException.cs