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
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Glyph.cs
- CapabilitiesPattern.cs
- SerializationFieldInfo.cs
- WebBrowser.cs
- AtomContentProperty.cs
- PartialClassGenerationTask.cs
- ReaderOutput.cs
- SqlMethodTransformer.cs
- AccessDataSourceWizardForm.cs
- SqlReferenceCollection.cs
- GestureRecognizer.cs
- NoneExcludedImageIndexConverter.cs
- DataPager.cs
- SqlException.cs
- RequestCacheEntry.cs
- columnmapkeybuilder.cs
- BrowserDefinitionCollection.cs
- DbDataAdapter.cs
- Clause.cs
- SystemResourceKey.cs
- MatrixTransform3D.cs
- NumericExpr.cs
- Sequence.cs
- RectAnimationUsingKeyFrames.cs
- ColumnHeader.cs
- Connector.cs
- BlockCollection.cs
- PointConverter.cs
- ServerValidateEventArgs.cs
- WebPartCollection.cs
- FixedTextBuilder.cs
- BaseCollection.cs
- DataTableReader.cs
- EntitySqlException.cs
- Pair.cs
- SharedUtils.cs
- Validator.cs
- XmlDocumentType.cs
- SecurityElement.cs
- Rotation3DKeyFrameCollection.cs
- GrammarBuilderPhrase.cs
- GridView.cs
- LinkedResourceCollection.cs
- KeyConstraint.cs
- FileChangesMonitor.cs
- X509SecurityToken.cs
- Compilation.cs
- ArgIterator.cs
- WebPageTraceListener.cs
- SmtpClient.cs
- Facet.cs
- PaintEvent.cs
- TableLayout.cs
- HttpAsyncResult.cs
- BuildProviderUtils.cs
- Registry.cs
- Stacktrace.cs
- ImageCodecInfo.cs
- DbParameterCollection.cs
- WorkflowLayouts.cs
- AlphabeticalEnumConverter.cs
- GraphicsContext.cs
- ListViewPagedDataSource.cs
- Scene3D.cs
- ArgumentDesigner.xaml.cs
- Cursor.cs
- RequestDescription.cs
- SpeakProgressEventArgs.cs
- AbstractDataSvcMapFileLoader.cs
- WindowsGraphicsWrapper.cs
- XmlSerializerSection.cs
- ErrorWebPart.cs
- ControlValuePropertyAttribute.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- StorageTypeMapping.cs
- Line.cs
- LinqToSqlWrapper.cs
- OleDbErrorCollection.cs
- CmsInterop.cs
- SizeLimitedCache.cs
- TableRow.cs
- GeometryGroup.cs
- LostFocusEventManager.cs
- ConfigurationProviderException.cs
- Rules.cs
- ApplicationSettingsBase.cs
- TypeInfo.cs
- ArgumentNullException.cs
- MenuItemBindingCollection.cs
- ScriptingWebServicesSectionGroup.cs
- TextDecorationUnitValidation.cs
- CodeDOMUtility.cs
- DataGridViewColumnCollection.cs
- _SingleItemRequestCache.cs
- FormatStringEditor.cs
- DataGridViewCellStateChangedEventArgs.cs
- EntityDataSourceChangingEventArgs.cs
- ActivityMarkupSerializer.cs
- Random.cs
- ScriptResourceAttribute.cs