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
- TreeNodeSelectionProcessor.cs
- HtmlLink.cs
- AssociationSet.cs
- XMLUtil.cs
- DataGridColumnFloatingHeader.cs
- StructureChangedEventArgs.cs
- PropertyInformation.cs
- UpdateExpressionVisitor.cs
- Message.cs
- PartialList.cs
- PanningMessageFilter.cs
- SqlBulkCopyColumnMapping.cs
- BaseHashHelper.cs
- SweepDirectionValidation.cs
- AspCompat.cs
- ToolboxComponentsCreatedEventArgs.cs
- ConfigsHelper.cs
- CapabilitiesRule.cs
- ActiveDocumentEvent.cs
- PerfService.cs
- TextContainerChangedEventArgs.cs
- RijndaelManagedTransform.cs
- ThicknessAnimationBase.cs
- BaseParser.cs
- WebPartChrome.cs
- SerializationAttributes.cs
- CompModSwitches.cs
- DynamicDataResources.Designer.cs
- IndentedWriter.cs
- DataGrid.cs
- TreeNodeCollection.cs
- MailDefinitionBodyFileNameEditor.cs
- HttpApplicationFactory.cs
- ExpandoObject.cs
- XmlElementList.cs
- ServerValidateEventArgs.cs
- Item.cs
- FeatureSupport.cs
- DbProviderConfigurationHandler.cs
- ScriptMethodAttribute.cs
- MatrixTransform3D.cs
- ConfigurationPropertyAttribute.cs
- NavigationFailedEventArgs.cs
- ParserStreamGeometryContext.cs
- DataServiceHost.cs
- MethodBody.cs
- DataGridViewButtonColumn.cs
- RenderDataDrawingContext.cs
- IDispatchConstantAttribute.cs
- DataServiceContext.cs
- ConstraintConverter.cs
- prompt.cs
- ProfileServiceManager.cs
- Subset.cs
- DBCommandBuilder.cs
- SplitterEvent.cs
- SEHException.cs
- CodeDomDecompiler.cs
- ColorTranslator.cs
- XPathDocumentIterator.cs
- DataGridViewTextBoxEditingControl.cs
- Comparer.cs
- RotateTransform3D.cs
- HttpWebRequestElement.cs
- Wizard.cs
- HttpRequest.cs
- SortableBindingList.cs
- AspNetSynchronizationContext.cs
- CodeCatchClause.cs
- ArgumentNullException.cs
- ZoomingMessageFilter.cs
- StreamInfo.cs
- XmlLoader.cs
- AppDomainShutdownMonitor.cs
- AuthenticationModeHelper.cs
- ILGenerator.cs
- ObjectHandle.cs
- ConfigurationProperty.cs
- XmlSchemaSimpleContent.cs
- StdValidatorsAndConverters.cs
- DbInsertCommandTree.cs
- XmlImplementation.cs
- BoundingRectTracker.cs
- MemberProjectedSlot.cs
- Blend.cs
- SoapFormatterSinks.cs
- SingleConverter.cs
- PrinterUnitConvert.cs
- DataListItemCollection.cs
- DeleteWorkflowOwnerCommand.cs
- TripleDESCryptoServiceProvider.cs
- DropDownHolder.cs
- Matrix3D.cs
- SoapAttributeAttribute.cs
- HwndMouseInputProvider.cs
- PolyBezierSegment.cs
- GroupDescription.cs
- BitmapEffectInput.cs
- LinkClickEvent.cs
- SubqueryRules.cs