Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / Microsoft / Win32 / SafeHandles / SafeEventHandle.cs / 1 / SafeEventHandle.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SafeEventHandle ** **Author: David Gutierrez ([....]) ** ** A wrapper for a win32 event handles ** ** Date: July 8, 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 SafeEventHandle : SafeHandleZeroOrMinusOneIsInvalid { // Note that CreateEvent returns 0 on failure internal SafeEventHandle() : base(true) {} [DllImport(ExternDll.Kernel32, CharSet=System.Runtime.InteropServices.CharSet.Unicode)] internal static extern SafeEventHandle CreateEvent(HandleRef lpEventAttributes, bool bManualReset, bool bInitialState, string name); [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
- Evidence.cs
- SelectionPatternIdentifiers.cs
- GlobalEventManager.cs
- COM2ExtendedUITypeEditor.cs
- CommandSet.cs
- LocatorBase.cs
- TaskFileService.cs
- PersonalizationStateInfoCollection.cs
- EtwTrace.cs
- DataListCommandEventArgs.cs
- Cursor.cs
- DataSysAttribute.cs
- BindingNavigatorDesigner.cs
- WindowPattern.cs
- ResourcesBuildProvider.cs
- FormViewActionList.cs
- XmlCharCheckingReader.cs
- PointLightBase.cs
- ToolStripCustomTypeDescriptor.cs
- ClassValidator.cs
- FixedSOMPageElement.cs
- ScrollViewer.cs
- MultiSelector.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- SqlUdtInfo.cs
- CellConstantDomain.cs
- ToolBarTray.cs
- ValidationError.cs
- SharedConnectionWorkflowTransactionService.cs
- brushes.cs
- ObjectStateEntry.cs
- SecureUICommand.cs
- ListViewUpdateEventArgs.cs
- Thread.cs
- ISCIIEncoding.cs
- ServicePointManagerElement.cs
- Image.cs
- _DisconnectOverlappedAsyncResult.cs
- ProvideValueServiceProvider.cs
- VirtualPathData.cs
- VirtualDirectoryMapping.cs
- SqlDataSourceFilteringEventArgs.cs
- XmlSerializerNamespaces.cs
- Viewport2DVisual3D.cs
- DES.cs
- ObjectDataSourceFilteringEventArgs.cs
- PenThreadPool.cs
- VerificationAttribute.cs
- Menu.cs
- WebPartCatalogCloseVerb.cs
- ArrayConverter.cs
- SQLDateTime.cs
- HostProtectionException.cs
- ToolStripContentPanel.cs
- PeerSecurityHelpers.cs
- VisualBasic.cs
- SQLByte.cs
- KeyValueInternalCollection.cs
- WorkflowServiceHost.cs
- TextAnchor.cs
- Vector3DAnimationBase.cs
- Empty.cs
- HtmlPageAdapter.cs
- LabelExpression.cs
- AppSettingsExpressionBuilder.cs
- PolicyException.cs
- ManagementClass.cs
- OperationGenerator.cs
- PartitionResolver.cs
- BufferedGraphicsContext.cs
- GridViewCommandEventArgs.cs
- XmlQueryStaticData.cs
- BuildProviderCollection.cs
- CqlQuery.cs
- MemoryRecordBuffer.cs
- TextEffectResolver.cs
- CacheHelper.cs
- CodeSubDirectory.cs
- RawContentTypeMapper.cs
- _AutoWebProxyScriptEngine.cs
- EventHandlersStore.cs
- arclist.cs
- CfgParser.cs
- RecordsAffectedEventArgs.cs
- DesignerDataSchemaClass.cs
- Speller.cs
- Oci.cs
- Wildcard.cs
- WebPartRestoreVerb.cs
- InternalSafeNativeMethods.cs
- IssuanceLicense.cs
- WebPartZoneCollection.cs
- EntityAdapter.cs
- HtmlProps.cs
- UnauthorizedWebPart.cs
- AssociationTypeEmitter.cs
- IPPacketInformation.cs
- PointAnimationUsingPath.cs
- XamlInt32CollectionSerializer.cs
- MiniCustomAttributeInfo.cs