Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / CompMod / Microsoft / Win32 / SafeHandles / SafeFileMapViewHandle.cs / 1 / SafeFileMapViewHandle.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SafeFileMapViewHandle ** **Author: Brian Grunkemeyer ([....]) ** ** A wrapper for handles returned from MapViewOfFile, used ** for shared memory. ** ** Date: August 7, 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 SafeFileMapViewHandle : SafeHandleZeroOrMinusOneIsInvalid { // Note that MapViewOfFile returns 0 on failure internal SafeFileMapViewHandle() : base(true) {} [DllImport(ExternDll.Kernel32, ExactSpelling=true, CharSet=CharSet.Auto)] internal static extern SafeFileMapViewHandle MapViewOfFile(SafeFileMappingHandle hFileMappingObject, int dwDesiredAccess, int dwFileOffsetHigh, int dwFileOffsetLow, UIntPtr dwNumberOfBytesToMap); [DllImport(ExternDll.Kernel32, ExactSpelling=true, SetLastError=true)] [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] private static extern bool UnmapViewOfFile(IntPtr handle); override protected bool ReleaseHandle() { return UnmapViewOfFile(handle); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SafeFileMapViewHandle ** **Author: Brian Grunkemeyer ([....]) ** ** A wrapper for handles returned from MapViewOfFile, used ** for shared memory. ** ** Date: August 7, 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 SafeFileMapViewHandle : SafeHandleZeroOrMinusOneIsInvalid { // Note that MapViewOfFile returns 0 on failure internal SafeFileMapViewHandle() : base(true) {} [DllImport(ExternDll.Kernel32, ExactSpelling=true, CharSet=CharSet.Auto)] internal static extern SafeFileMapViewHandle MapViewOfFile(SafeFileMappingHandle hFileMappingObject, int dwDesiredAccess, int dwFileOffsetHigh, int dwFileOffsetLow, UIntPtr dwNumberOfBytesToMap); [DllImport(ExternDll.Kernel32, ExactSpelling=true, SetLastError=true)] [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] private static extern bool UnmapViewOfFile(IntPtr handle); override protected bool ReleaseHandle() { return UnmapViewOfFile(handle); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- UdpContractFilterBehavior.cs
- WeakEventManager.cs
- CollectionBase.cs
- LinkDesigner.cs
- wpf-etw.cs
- Soap12ServerProtocol.cs
- ScriptRef.cs
- ClientConfigPaths.cs
- EntityContainerEntitySet.cs
- MarkupProperty.cs
- XamlDesignerSerializationManager.cs
- StylusPointPropertyUnit.cs
- ExpressionConverter.cs
- MimeMapping.cs
- MemoryMappedFileSecurity.cs
- Page.cs
- MenuAutomationPeer.cs
- MultipleViewProviderWrapper.cs
- WpfWebRequestHelper.cs
- Win32PrintDialog.cs
- CodeTypeConstructor.cs
- MasterPageParser.cs
- SafeCertificateContext.cs
- ListManagerBindingsCollection.cs
- ControlCollection.cs
- ErrorActivity.cs
- XmlIlTypeHelper.cs
- RestHandlerFactory.cs
- _CookieModule.cs
- xsdvalidator.cs
- WorkflowOwnerAsyncResult.cs
- TreeViewBindingsEditor.cs
- SoapWriter.cs
- Environment.cs
- EntityClientCacheEntry.cs
- TypeValidationEventArgs.cs
- FunctionNode.cs
- DesignTimeParseData.cs
- Animatable.cs
- HtmlContainerControl.cs
- ScaleTransform.cs
- OutputCacheSettingsSection.cs
- Vector3DCollection.cs
- ThicknessAnimation.cs
- Win32SafeHandles.cs
- VBCodeProvider.cs
- BooleanKeyFrameCollection.cs
- _OverlappedAsyncResult.cs
- MachineKeySection.cs
- LineServicesCallbacks.cs
- Vector3DConverter.cs
- WebMethodAttribute.cs
- DataBoundLiteralControl.cs
- TextTreeTextNode.cs
- XmlIgnoreAttribute.cs
- IApplicationTrustManager.cs
- DateTimeConstantAttribute.cs
- BulletedListEventArgs.cs
- DBBindings.cs
- ResourcesGenerator.cs
- VarRemapper.cs
- ValueOfAction.cs
- WebRequestModulesSection.cs
- PackWebRequest.cs
- ProtectedConfigurationSection.cs
- NamespaceMapping.cs
- DbConnectionHelper.cs
- ProxyElement.cs
- UpdateTranslator.cs
- GeneralTransformCollection.cs
- Partitioner.cs
- WorkflowCommandExtensionItem.cs
- DayRenderEvent.cs
- Scheduling.cs
- XPathNodeHelper.cs
- sqlstateclientmanager.cs
- XMLDiffLoader.cs
- Thumb.cs
- DifferencingCollection.cs
- ParameterBuilder.cs
- TemplateBindingExtensionConverter.cs
- WebServiceClientProxyGenerator.cs
- RelationshipNavigation.cs
- OracleColumn.cs
- TcpStreams.cs
- ScalarType.cs
- RegexRunnerFactory.cs
- IdentityReference.cs
- TemplateBamlRecordReader.cs
- AspProxy.cs
- Matrix3D.cs
- CanonicalXml.cs
- XpsS0ValidatingLoader.cs
- HelpProvider.cs
- HtmlShim.cs
- FilteredDataSetHelper.cs
- SqlBuffer.cs
- DataTableExtensions.cs
- ToolStripArrowRenderEventArgs.cs
- StorageConditionPropertyMapping.cs