Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ReadOnlyDataSource.cs
- RegexMatchCollection.cs
- RotationValidation.cs
- TimeEnumHelper.cs
- LinkClickEvent.cs
- TableLayoutStyleCollection.cs
- ActivityDesignerLayoutSerializers.cs
- documentation.cs
- DbConnectionOptions.cs
- SqlLiftIndependentRowExpressions.cs
- NativeMethods.cs
- Vector3DValueSerializer.cs
- cryptoapiTransform.cs
- OdbcConnectionFactory.cs
- RecoverInstanceLocksCommand.cs
- XamlInt32CollectionSerializer.cs
- XmlILCommand.cs
- DbTransaction.cs
- OutputScopeManager.cs
- IgnoreFileBuildProvider.cs
- AddInServer.cs
- CollectionBuilder.cs
- WizardForm.cs
- TypeConverter.cs
- MetadataCache.cs
- DispatcherHooks.cs
- TableAdapterManagerNameHandler.cs
- KerberosReceiverSecurityToken.cs
- TreeIterators.cs
- CdpEqualityComparer.cs
- KoreanLunisolarCalendar.cs
- ColorBuilder.cs
- SettingsBindableAttribute.cs
- UTF32Encoding.cs
- CursorInteropHelper.cs
- PropertyNames.cs
- XmlTextReader.cs
- TextPattern.cs
- SequenceNumber.cs
- SQLGuid.cs
- SmtpLoginAuthenticationModule.cs
- UInt64.cs
- XmlChoiceIdentifierAttribute.cs
- ZipIOModeEnforcingStream.cs
- CombinedGeometry.cs
- PageCache.cs
- Timeline.cs
- SimpleApplicationHost.cs
- UniqueIdentifierService.cs
- XmlDesignerDataSourceView.cs
- DotNetATv1WindowsLogEntryDeserializer.cs
- ComponentDispatcher.cs
- TraceHandler.cs
- ContentHostHelper.cs
- SmiRecordBuffer.cs
- RangeExpression.cs
- SessionSwitchEventArgs.cs
- XmlValueConverter.cs
- DataGridViewComboBoxEditingControl.cs
- UriSection.cs
- DatatypeImplementation.cs
- ObjectReferenceStack.cs
- DbConnectionPoolIdentity.cs
- EntityReference.cs
- HashSetDebugView.cs
- InputLanguageManager.cs
- XmlAttributes.cs
- VerticalAlignConverter.cs
- AppDomainUnloadedException.cs
- SqlConnection.cs
- MgmtConfigurationRecord.cs
- AssemblyNameProxy.cs
- ClientTargetSection.cs
- LostFocusEventManager.cs
- ReadWriteObjectLock.cs
- SynchronousSendBindingElement.cs
- TCEAdapterGenerator.cs
- AddingNewEventArgs.cs
- MsmqAppDomainProtocolHandler.cs
- NumericUpDown.cs
- FunctionQuery.cs
- ExpressionNode.cs
- CurrencyWrapper.cs
- TimersDescriptionAttribute.cs
- DataGridViewCheckBoxColumn.cs
- SystemFonts.cs
- FontStretch.cs
- VirtualDirectoryMapping.cs
- PageThemeBuildProvider.cs
- DelegateInArgument.cs
- SortQuery.cs
- PersonalizationStateInfo.cs
- CancelEventArgs.cs
- JoinQueryOperator.cs
- KeyProperty.cs
- QueryInterceptorAttribute.cs
- ContentWrapperAttribute.cs
- SecureStringHasher.cs
- ECDiffieHellmanCng.cs
- X509ThumbprintKeyIdentifierClause.cs