Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TargetInvocationException.cs
- DelegateHelpers.cs
- SspiSecurityToken.cs
- DoubleConverter.cs
- NameSpaceEvent.cs
- ParserHooks.cs
- ToolStripItem.cs
- DebugView.cs
- SmiGettersStream.cs
- ServiceDurableInstance.cs
- SwitchLevelAttribute.cs
- TextOutput.cs
- WebPartManager.cs
- PageAdapter.cs
- QuotedPrintableStream.cs
- WorkItem.cs
- RecognizerBase.cs
- TimeManager.cs
- SmtpReplyReaderFactory.cs
- SqlConnection.cs
- DataPagerFieldCommandEventArgs.cs
- ThemeDictionaryExtension.cs
- DeflateStream.cs
- MissingSatelliteAssemblyException.cs
- AnnotationAdorner.cs
- CubicEase.cs
- TerminatorSinks.cs
- LocalizableAttribute.cs
- StrongNameIdentityPermission.cs
- PersonalizationProviderHelper.cs
- TouchesOverProperty.cs
- _ConnectStream.cs
- PageBuildProvider.cs
- CodeTypeDeclaration.cs
- NativeMethods.cs
- ScrollBarAutomationPeer.cs
- RecognitionResult.cs
- TrustLevel.cs
- ConnectionString.cs
- PageContentAsyncResult.cs
- XPathDocumentNavigator.cs
- DeviceContext.cs
- EntityContainerEmitter.cs
- CommandEventArgs.cs
- PolygonHotSpot.cs
- BaseComponentEditor.cs
- DynamicObjectAccessor.cs
- Select.cs
- SafeFileMappingHandle.cs
- SqlDataSourceConfigureSelectPanel.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- ArcSegment.cs
- QueryCursorEventArgs.cs
- CapacityStreamGeometryContext.cs
- MdiWindowListStrip.cs
- StreamWriter.cs
- AttachedAnnotationChangedEventArgs.cs
- Property.cs
- FindCriteria11.cs
- ClientSettingsProvider.cs
- NegationPusher.cs
- TextTreeInsertElementUndoUnit.cs
- WindowsEditBox.cs
- QilParameter.cs
- Messages.cs
- RequestCache.cs
- KeyTimeConverter.cs
- XamlTreeBuilder.cs
- Process.cs
- RoleBoolean.cs
- OutputWindow.cs
- MeshGeometry3D.cs
- Header.cs
- GridViewSelectEventArgs.cs
- CompositeKey.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- HintTextConverter.cs
- ThreadExceptionDialog.cs
- XmlMemberMapping.cs
- BitmapSource.cs
- MultiTouchSystemGestureLogic.cs
- TableRow.cs
- SecurityKeyType.cs
- UserControlFileEditor.cs
- SecurityContext.cs
- ObjectDataSourceStatusEventArgs.cs
- FormatterServices.cs
- AccessDataSource.cs
- ResourceBinder.cs
- SortDescription.cs
- StorageConditionPropertyMapping.cs
- StreamGeometryContext.cs
- ContextMarshalException.cs
- ServiceModelSecurityTokenTypes.cs
- MULTI_QI.cs
- EventItfInfo.cs
- ListViewCancelEventArgs.cs
- SmtpFailedRecipientsException.cs
- SqlFileStream.cs
- SortExpressionBuilder.cs