Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Media / safemediahandle.cs / 1305600 / safemediahandle.cs
//------------------------------------------------------------------------------ // Microsoft Avalon // Copyright (c) Microsoft Corporation, All Rights Reserved. // // File: SafeMediaHandle.cs // //----------------------------------------------------------------------------- using System; using System.IO; using System.Security; using System.Security.Permissions; using System.Collections; using System.Reflection; using MS.Internal; using MS.Win32; using System.Diagnostics; using System.Windows.Media; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using Microsoft.Win32.SafeHandles; using UnsafeNativeMethods=MS.Win32.PresentationCore.UnsafeNativeMethods; namespace System.Windows.Media { internal class SafeMediaHandle : SafeMILHandle { ////// internal SafeMediaHandle() { } ////// ////// Critical: calls SafeHandle.SetHandle which LinkDemands /// also takes arbitrary IntPtr as a handle /// [SecurityCritical] internal SafeMediaHandle(IntPtr handle) { SetHandle(handle); } ////// Critical - calls unmanaged code, not treat as safe because you must /// validate that handle is a valid COM object. /// [SecurityCritical] protected override bool ReleaseHandle() { HRESULT.Check(MILMedia.Shutdown(handle)); UnsafeNativeMethods.MILUnknown.ReleaseInterface(ref handle); return true; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Slider.cs
- Query.cs
- HTMLTagNameToTypeMapper.cs
- WmlLinkAdapter.cs
- Assert.cs
- Perspective.cs
- NetworkStream.cs
- StorageTypeMapping.cs
- DynamicPropertyHolder.cs
- ContractsBCL.cs
- CodeTypeOfExpression.cs
- XmlNodeWriter.cs
- Size3D.cs
- XmlNamespaceDeclarationsAttribute.cs
- FieldAccessException.cs
- PasswordDeriveBytes.cs
- WindowsGrip.cs
- DropShadowBitmapEffect.cs
- SingleConverter.cs
- WebScriptEnablingElement.cs
- UnknownBitmapDecoder.cs
- RemotingConfiguration.cs
- NativeCppClassAttribute.cs
- Vector3D.cs
- ApplicationException.cs
- CommandLineParser.cs
- MapPathBasedVirtualPathProvider.cs
- SqlEnums.cs
- SafeBitVector32.cs
- NativeMethods.cs
- FigureParaClient.cs
- SplashScreen.cs
- ConstructorExpr.cs
- BlobPersonalizationState.cs
- HttpFileCollection.cs
- MenuItemAutomationPeer.cs
- CapabilitiesRule.cs
- TileModeValidation.cs
- DeleteBookmarkScope.cs
- EntityDataSourceViewSchema.cs
- NameHandler.cs
- Int16Animation.cs
- DataMisalignedException.cs
- SafeWaitHandle.cs
- DoubleAnimationUsingKeyFrames.cs
- FileLevelControlBuilderAttribute.cs
- CallbackTimeoutsElement.cs
- Rotation3D.cs
- SQLGuidStorage.cs
- ColorAnimation.cs
- InteropBitmapSource.cs
- SQLMembershipProvider.cs
- Material.cs
- SqlDependency.cs
- MarkedHighlightComponent.cs
- TaskFormBase.cs
- TextSearch.cs
- SQLString.cs
- TransformerInfo.cs
- SchemaExporter.cs
- DataExpression.cs
- QueryContinueDragEventArgs.cs
- FrugalList.cs
- ResourcesBuildProvider.cs
- ObjectDataSourceView.cs
- CheckBoxDesigner.cs
- XmlIlVisitor.cs
- DisplayMemberTemplateSelector.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- TablePattern.cs
- SecurityPolicySection.cs
- TextParagraphProperties.cs
- SQLCharsStorage.cs
- ObjectContextServiceProvider.cs
- ToolStripMenuItemDesigner.cs
- SessionSwitchEventArgs.cs
- HtmlTextViewAdapter.cs
- WebPartAddingEventArgs.cs
- SplashScreen.cs
- DictionaryGlobals.cs
- SessionKeyExpiredException.cs
- CodeTypeMember.cs
- AssemblyResolver.cs
- LineBreak.cs
- ListViewUpdatedEventArgs.cs
- BaseProcessProtocolHandler.cs
- FixedStringLookup.cs
- MultiDataTrigger.cs
- RouteParser.cs
- MetadataPropertyAttribute.cs
- MemoryFailPoint.cs
- FontStyleConverter.cs
- DaylightTime.cs
- securitycriticaldataformultiplegetandset.cs
- DataListItemEventArgs.cs
- ToolStripContainer.cs
- X509SecurityTokenProvider.cs
- XPathNodeIterator.cs
- DocumentGrid.cs
- FormViewModeEventArgs.cs