Code:
/ DotNET / DotNET / 8.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
- UpDownEvent.cs
- ColorMap.cs
- DetailsViewDeleteEventArgs.cs
- BmpBitmapEncoder.cs
- DrawingState.cs
- WebUtil.cs
- DetailsViewCommandEventArgs.cs
- RegistrationServices.cs
- BufferedWebEventProvider.cs
- BigInt.cs
- TextCharacters.cs
- EdmComplexTypeAttribute.cs
- ScrollEventArgs.cs
- SqlPersonalizationProvider.cs
- PassportAuthentication.cs
- ValidatorCollection.cs
- BufferedWebEventProvider.cs
- DataTableReaderListener.cs
- BamlBinaryReader.cs
- ServiceDescriptionData.cs
- PropertyGeneratedEventArgs.cs
- Timer.cs
- InitializingNewItemEventArgs.cs
- PartialToken.cs
- Pair.cs
- EpmContentDeSerializerBase.cs
- LingerOption.cs
- WinFormsSecurity.cs
- CreateRefExpr.cs
- NumberSubstitution.cs
- TextElement.cs
- DesignerTextViewAdapter.cs
- ComPlusInstanceContextInitializer.cs
- DeviceContexts.cs
- EntityClassGenerator.cs
- CompModHelpers.cs
- ResourceDefaultValueAttribute.cs
- MouseActionValueSerializer.cs
- WindowsImpersonationContext.cs
- DateTimeParse.cs
- ExtensibleSyndicationObject.cs
- PropertyValidationContext.cs
- MenuItemStyleCollectionEditor.cs
- CodeArgumentReferenceExpression.cs
- ListBoxItemWrapperAutomationPeer.cs
- GenerateHelper.cs
- XamlSerializerUtil.cs
- UnicastIPAddressInformationCollection.cs
- ELinqQueryState.cs
- ObjectQuery.cs
- SystemIPv6InterfaceProperties.cs
- BaseEntityWrapper.cs
- FormViewPageEventArgs.cs
- TypeSystem.cs
- SafeArrayRankMismatchException.cs
- BindingWorker.cs
- ProxyFragment.cs
- WebFaultException.cs
- SparseMemoryStream.cs
- webproxy.cs
- RegexWriter.cs
- XmlIlTypeHelper.cs
- TileBrush.cs
- SortableBindingList.cs
- CalendarDayButton.cs
- CodeParameterDeclarationExpression.cs
- ExitEventArgs.cs
- HttpCacheVaryByContentEncodings.cs
- ElementHostAutomationPeer.cs
- SkinIDTypeConverter.cs
- InputScopeAttribute.cs
- Transform3D.cs
- ListBoxItemWrapperAutomationPeer.cs
- SortAction.cs
- Variable.cs
- PackageRelationshipCollection.cs
- TdsParameterSetter.cs
- StringArrayEditor.cs
- UInt16Converter.cs
- WmfPlaceableFileHeader.cs
- HtmlShim.cs
- JsonReaderWriterFactory.cs
- UpdateCommand.cs
- BookmarkManager.cs
- CellTreeNodeVisitors.cs
- MultiSelectRootGridEntry.cs
- TreeViewItemAutomationPeer.cs
- StructuralCache.cs
- UnsafeNativeMethodsTablet.cs
- VarInfo.cs
- VisualBrush.cs
- Configuration.cs
- MonthCalendar.cs
- FontDialog.cs
- IncrementalCompileAnalyzer.cs
- OleDbEnumerator.cs
- SessionEndedEventArgs.cs
- ForeignKeyConstraint.cs
- ConfigurationProperty.cs
- StatusStrip.cs