Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / Microsoft / Win32 / SafeHandles / SafeMemoryMappedViewHandle.cs / 1305376 / SafeMemoryMappedViewHandle.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SafeMemoryMappedViewHandle ** ** Purpose: Safe handle wrapping a MMF view pointer ** ** Date: February 7, 2007 ** ===========================================================*/ using System; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security.Permissions; using Microsoft.Win32; using Microsoft.Win32.SafeHandles; namespace Microsoft.Win32.SafeHandles { // Reliability notes: // ReleaseHandle has reliability guarantee of Cer.Success, as defined by SafeHandle. // It gets prepared as a CER at instance construction time. This safe handle doesn't // need to override IsInvalid because the one it inherits from // SafeHandleZeroOrMinusOneIsInvalid is correct. //// #pragma warning disable 618 // Have not migrated to v4 transparency yet [System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)] #pragma warning restore 618 public sealed class SafeMemoryMappedViewHandle : SafeBuffer { [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] internal SafeMemoryMappedViewHandle() : base(true) { } [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] internal SafeMemoryMappedViewHandle(IntPtr handle, bool ownsHandle) : base(ownsHandle) { base.SetHandle(handle); } [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] override protected bool ReleaseHandle() { if (UnsafeNativeMethods.UnmapViewOfFile(handle)) { handle = IntPtr.Zero; return true; } return false; } } } // 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
- Keyboard.cs
- IntegrationExceptionEventArgs.cs
- XPathChildIterator.cs
- PointConverter.cs
- ValidatorCollection.cs
- Clause.cs
- InfoCardTraceRecord.cs
- WorkflowDebuggerSteppingAttribute.cs
- PolyLineSegment.cs
- HWStack.cs
- TableLayoutStyle.cs
- ProfileSettingsCollection.cs
- WebMethodAttribute.cs
- UIElementAutomationPeer.cs
- PropertyManager.cs
- SQLChars.cs
- FixedSOMPageConstructor.cs
- ParserOptions.cs
- NameValuePermission.cs
- AccessibleObject.cs
- SQLMoneyStorage.cs
- IsolationInterop.cs
- ToolStripControlHost.cs
- Drawing.cs
- Stroke2.cs
- DataContractSet.cs
- RandomNumberGenerator.cs
- RtfFormatStack.cs
- ProjectionPath.cs
- AuthenticationService.cs
- ClassDataContract.cs
- URLMembershipCondition.cs
- ExplicitDiscriminatorMap.cs
- PropertyMetadata.cs
- TransactionBridgeSection.cs
- ResourceReferenceExpression.cs
- XmlSchemaInferenceException.cs
- StrongNamePublicKeyBlob.cs
- FrugalMap.cs
- StatementContext.cs
- TransformerTypeCollection.cs
- ContextMenuStrip.cs
- CanonicalizationDriver.cs
- XPathArrayIterator.cs
- DispatcherOperation.cs
- RedirectionProxy.cs
- _PooledStream.cs
- ChangeTracker.cs
- DataSvcMapFile.cs
- DES.cs
- NetMsmqSecurity.cs
- ConfigXmlCDataSection.cs
- ZipIOFileItemStream.cs
- SyntaxCheck.cs
- DictionaryGlobals.cs
- LinkConverter.cs
- ToolStripMenuItem.cs
- RightsManagementErrorHandler.cs
- ObjectQuery.cs
- WebProxyScriptElement.cs
- ManualResetEvent.cs
- EntityContainerEntitySet.cs
- XmlSchemaAppInfo.cs
- HtmlInputText.cs
- DataGridViewAutoSizeModeEventArgs.cs
- BitmapEffectInput.cs
- SoapIgnoreAttribute.cs
- ISFTagAndGuidCache.cs
- TextBoxAutoCompleteSourceConverter.cs
- EncryptedKey.cs
- WriteTimeStream.cs
- sortedlist.cs
- OdbcConnectionHandle.cs
- DropDownList.cs
- ThaiBuddhistCalendar.cs
- DataBinder.cs
- PersonalizationDictionary.cs
- AccessText.cs
- MetabaseReader.cs
- HttpListenerResponse.cs
- FileLevelControlBuilderAttribute.cs
- MimePart.cs
- TrackingProfileCache.cs
- DependencyObjectPropertyDescriptor.cs
- SafeMILHandleMemoryPressure.cs
- DoubleLink.cs
- LayoutEvent.cs
- CodeAccessPermission.cs
- EntityDataSourceSelectedEventArgs.cs
- SearchForVirtualItemEventArgs.cs
- _NTAuthentication.cs
- AssemblyBuilder.cs
- QilParameter.cs
- BasicCommandTreeVisitor.cs
- PrivacyNoticeBindingElementImporter.cs
- StrokeCollection.cs
- RoleManagerModule.cs
- PermissionListSet.cs
- TextEditorTables.cs
- MembershipValidatePasswordEventArgs.cs