Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TypeName.cs
- ByeMessageApril2005.cs
- HashCodeCombiner.cs
- DataSourceUtil.cs
- OutputCacheProfileCollection.cs
- SmiEventSink_Default.cs
- Identity.cs
- XsltLibrary.cs
- GridViewRowPresenter.cs
- EventLogInformation.cs
- WebPartVerb.cs
- HtmlShimManager.cs
- ClassData.cs
- ValidatingCollection.cs
- InfoCardClaim.cs
- AlphabeticalEnumConverter.cs
- cryptoapiTransform.cs
- DiagnosticTrace.cs
- DataGridViewCell.cs
- BamlBinaryReader.cs
- DebugView.cs
- ContentPlaceHolder.cs
- _TransmitFileOverlappedAsyncResult.cs
- StreamUpgradeAcceptor.cs
- XmlSchemaFacet.cs
- RequestUriProcessor.cs
- WebDisplayNameAttribute.cs
- LiteralTextParser.cs
- ResXFileRef.cs
- TransformValueSerializer.cs
- ProcessModuleCollection.cs
- EasingQuaternionKeyFrame.cs
- CompositeDispatchFormatter.cs
- AssemblyAttributesGoHere.cs
- StrongNameIdentityPermission.cs
- FormsAuthenticationEventArgs.cs
- UnsafeNativeMethods.cs
- StorageInfo.cs
- AliasedSlot.cs
- ActivityStateRecord.cs
- ValidationPropertyAttribute.cs
- SqlDependencyListener.cs
- Util.cs
- SchemaElementDecl.cs
- MessageDecoder.cs
- NamedElement.cs
- DesignerActionPanel.cs
- Socket.cs
- WebScriptMetadataMessageEncodingBindingElement.cs
- StrokeNode.cs
- AnimationStorage.cs
- ProcessHostFactoryHelper.cs
- ServiceModelExtensionCollectionElement.cs
- PropertyFilterAttribute.cs
- ManagementObjectSearcher.cs
- CodeCommentStatement.cs
- Brushes.cs
- SequentialOutput.cs
- PassportAuthenticationEventArgs.cs
- SamlAuthorizationDecisionStatement.cs
- GZipObjectSerializer.cs
- WebPartManagerInternals.cs
- DateTimeParse.cs
- Int64Storage.cs
- WebException.cs
- RegexStringValidator.cs
- DateTimePicker.cs
- InputMethodStateTypeInfo.cs
- RepeaterItemEventArgs.cs
- InternalCache.cs
- EntitySqlQueryState.cs
- PolyLineSegment.cs
- SettingsPropertyValue.cs
- DispatchWrapper.cs
- CornerRadiusConverter.cs
- ImageClickEventArgs.cs
- ScriptReference.cs
- EventMappingSettings.cs
- RegexEditorDialog.cs
- ProfileProvider.cs
- CapabilitiesRule.cs
- MatrixTransform.cs
- TableFieldsEditor.cs
- ThreadStaticAttribute.cs
- CanonicalizationDriver.cs
- XmlExceptionHelper.cs
- HtmlEmptyTagControlBuilder.cs
- Model3DCollection.cs
- SortedSet.cs
- MessageQueueTransaction.cs
- NativeMethods.cs
- DataSetUtil.cs
- XmlValidatingReader.cs
- UpdatableWrapper.cs
- WebPartTransformerAttribute.cs
- FileDialog.cs
- FileNotFoundException.cs
- ExpressionBuilderCollection.cs
- SiteMap.cs
- MsmqIntegrationBindingElement.cs