Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / Microsoft / Win32 / SafeHandles / SafeFileMappingHandle.cs / 1 / SafeFileMappingHandle.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SafeFileMappingHandle ** **Author: David Gutierrez ([....]) ** ** A wrapper for handle to file mappings, returned by ** CreateFileMapping and OpenFileMapping. Used for shared ** memory. ** ** 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 SafeFileMappingHandle : SafeHandleZeroOrMinusOneIsInvalid { // Note that CreateFileMapping returns 0 on failure. // Note that you can pass in -1 for the hFile parameter. [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode=true)] internal SafeFileMappingHandle() : base(true) {} [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
- HtmlInputCheckBox.cs
- LeftCellWrapper.cs
- SessionStateUtil.cs
- HttpApplicationStateWrapper.cs
- FormsAuthenticationUser.cs
- PolicyLevel.cs
- PeerNearMe.cs
- AutoScrollHelper.cs
- TableLayoutCellPaintEventArgs.cs
- ControlUtil.cs
- RetrieveVirtualItemEventArgs.cs
- GridItemPattern.cs
- DataTransferEventArgs.cs
- CodeBinaryOperatorExpression.cs
- ChangePassword.cs
- HierarchicalDataSourceControl.cs
- WebBrowserHelper.cs
- StringToken.cs
- NonParentingControl.cs
- TypeListConverter.cs
- FormsAuthenticationTicket.cs
- ListView.cs
- OutputCacheProfile.cs
- SoapServerMethod.cs
- ToolStripKeyboardHandlingService.cs
- HttpMethodAttribute.cs
- GeometryValueSerializer.cs
- PhysicalFontFamily.cs
- MetadataArtifactLoaderComposite.cs
- DivideByZeroException.cs
- XPathArrayIterator.cs
- _StreamFramer.cs
- ObjectCacheSettings.cs
- SrgsText.cs
- AssertSection.cs
- MarginsConverter.cs
- ActivityWithResultConverter.cs
- Peer.cs
- AdPostCacheSubstitution.cs
- Stopwatch.cs
- ValidationEventArgs.cs
- SystemKeyConverter.cs
- LinqTreeNodeEvaluator.cs
- EntityClassGenerator.cs
- XmlNodeWriter.cs
- HtmlInputRadioButton.cs
- DefaultWorkflowTransactionService.cs
- Misc.cs
- Parameter.cs
- XmlResolver.cs
- PropVariant.cs
- dsa.cs
- X509Extension.cs
- Normalizer.cs
- RegexWorker.cs
- BoolExpressionVisitors.cs
- WmlCalendarAdapter.cs
- ChannelManager.cs
- DataGridViewCellPaintingEventArgs.cs
- EntityContainerEmitter.cs
- SymmetricKey.cs
- NotifyInputEventArgs.cs
- EventRoute.cs
- TextElementAutomationPeer.cs
- CodeTypeParameterCollection.cs
- TextChange.cs
- ListViewInsertedEventArgs.cs
- XmlQualifiedNameTest.cs
- SqlDataSource.cs
- HostedHttpTransportManager.cs
- AggregateNode.cs
- ListParagraph.cs
- TextServicesPropertyRanges.cs
- StsCommunicationException.cs
- SecurityContext.cs
- ImageInfo.cs
- EntityRecordInfo.cs
- StringUtil.cs
- TypeDescriptionProviderAttribute.cs
- KeyEvent.cs
- HTTPRemotingHandler.cs
- NamedPipeChannelFactory.cs
- LineGeometry.cs
- ContractListAdapter.cs
- __ComObject.cs
- HMACSHA1.cs
- WindowsSlider.cs
- cryptoapiTransform.cs
- ReliableSessionBindingElement.cs
- Operand.cs
- Light.cs
- FrameworkElementFactory.cs
- ParserStreamGeometryContext.cs
- ConvertersCollection.cs
- ConfigXmlWhitespace.cs
- SimpleNameService.cs
- TargetFrameworkUtil.cs
- TCPClient.cs
- LocationSectionRecord.cs
- XpsSerializationException.cs