Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Core / System / Windows / Media / safemediahandle.cs / 1 / 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
- LOSFormatter.cs
- PassportPrincipal.cs
- DocumentPageTextView.cs
- ScriptControlDescriptor.cs
- SpellerStatusTable.cs
- CoreSwitches.cs
- ValidationPropertyAttribute.cs
- DefaultProxySection.cs
- Library.cs
- ObjectItemCollection.cs
- HtmlHistory.cs
- ActivityCodeDomSerializationManager.cs
- XPathDocumentIterator.cs
- AuthenticationModulesSection.cs
- ToolStripActionList.cs
- ObjectTypeMapping.cs
- ExpressionEvaluator.cs
- DataGridViewTopLeftHeaderCell.cs
- SelectQueryOperator.cs
- XmlHierarchicalEnumerable.cs
- FixedDocumentSequencePaginator.cs
- HttpClientChannel.cs
- AssertSection.cs
- CheckBoxPopupAdapter.cs
- NeedSkipTokenVisitor.cs
- ReadOnlyDictionary.cs
- Activator.cs
- ProtectedProviderSettings.cs
- DataGridHeaderBorder.cs
- SerializationSectionGroup.cs
- Vector3DCollectionConverter.cs
- WorkflowServiceHost.cs
- documentation.cs
- DbConnectionStringBuilder.cs
- Win32Exception.cs
- OwnerDrawPropertyBag.cs
- LZCodec.cs
- CompilerLocalReference.cs
- DoubleMinMaxAggregationOperator.cs
- COM2ExtendedTypeConverter.cs
- XmlValueConverter.cs
- GridItemPattern.cs
- WmlSelectionListAdapter.cs
- precedingquery.cs
- SiteMembershipCondition.cs
- TreeView.cs
- LoginUtil.cs
- SmiEventStream.cs
- UnauthorizedWebPart.cs
- HttpApplicationFactory.cs
- RequestCachePolicyConverter.cs
- ToolTip.cs
- TextServicesContext.cs
- JsonByteArrayDataContract.cs
- SchemaCollectionCompiler.cs
- XmlKeywords.cs
- AlternateView.cs
- Win32.cs
- Dictionary.cs
- ControlAdapter.cs
- HashLookup.cs
- LineBreak.cs
- SqlConnectionPoolProviderInfo.cs
- XmlBaseWriter.cs
- GenericAuthenticationEventArgs.cs
- IconHelper.cs
- DataColumnChangeEvent.cs
- EncryptedPackage.cs
- PartitionResolver.cs
- RootProfilePropertySettingsCollection.cs
- HashMembershipCondition.cs
- IImplicitResourceProvider.cs
- SystemWebExtensionsSectionGroup.cs
- MultipleViewProviderWrapper.cs
- MexNamedPipeBindingElement.cs
- AspNetSynchronizationContext.cs
- DataPointer.cs
- ProfileManager.cs
- BitmapFrame.cs
- Scene3D.cs
- TextCompositionEventArgs.cs
- ReadOnlyTernaryTree.cs
- BuildProviderAppliesToAttribute.cs
- WorkflowMarkupSerializationException.cs
- DataBindingCollection.cs
- MetadataHelper.cs
- ButtonChrome.cs
- AssociationEndMember.cs
- MethodCallConverter.cs
- DataGridDetailsPresenterAutomationPeer.cs
- SystemNetHelpers.cs
- XmlWrappingReader.cs
- ImageSourceValueSerializer.cs
- SwitchDesigner.xaml.cs
- RectangleGeometry.cs
- XsdDateTime.cs
- SourceInterpreter.cs
- FileIOPermission.cs
- ListViewItemEventArgs.cs
- PermissionSetEnumerator.cs