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
- InputQueueChannelAcceptor.cs
- WebPartEditorOkVerb.cs
- HijriCalendar.cs
- TextEditorParagraphs.cs
- EntityExpressionVisitor.cs
- SynchronizationHandlesCodeDomSerializer.cs
- RemoteWebConfigurationHostStream.cs
- ToolStripMenuItem.cs
- ContractTypeNameElement.cs
- ObjectSecurityT.cs
- DataException.cs
- UserPreferenceChangedEventArgs.cs
- XpsDocument.cs
- SyndicationDeserializer.cs
- IdentityReference.cs
- DATA_BLOB.cs
- DynamicQueryableWrapper.cs
- PersistenceTypeAttribute.cs
- MdImport.cs
- XamlHostingSection.cs
- TransformCollection.cs
- LogRestartAreaEnumerator.cs
- GetPageCompletedEventArgs.cs
- XPathEmptyIterator.cs
- TreeWalkHelper.cs
- DocumentPageViewAutomationPeer.cs
- SocketCache.cs
- WebPartEditorOkVerb.cs
- XhtmlBasicSelectionListAdapter.cs
- PrePostDescendentsWalker.cs
- SqlUDTStorage.cs
- DataSourceExpression.cs
- Clipboard.cs
- Empty.cs
- UIElementPropertyUndoUnit.cs
- _SecureChannel.cs
- TextRunTypographyProperties.cs
- DocumentPaginator.cs
- FontSource.cs
- NativeMethods.cs
- HtmlInputPassword.cs
- EdmComplexTypeAttribute.cs
- AccessDataSourceDesigner.cs
- MetadataUtilsSmi.cs
- Scripts.cs
- MessageQueueConverter.cs
- StateRuntime.cs
- DeviceContext2.cs
- DefaultExpressionVisitor.cs
- XPathNavigatorKeyComparer.cs
- LiteralTextContainerControlBuilder.cs
- AsyncOperationManager.cs
- NumericUpDownAccelerationCollection.cs
- DataServiceRequestException.cs
- ComponentResourceManager.cs
- ToolStripMenuItemCodeDomSerializer.cs
- ByteAnimationUsingKeyFrames.cs
- CodePageEncoding.cs
- Substitution.cs
- TextParagraphCache.cs
- ToolStripItemImageRenderEventArgs.cs
- SessionParameter.cs
- TrustLevel.cs
- RunClient.cs
- DocumentXPathNavigator.cs
- SmiMetaData.cs
- Stack.cs
- EndOfStreamException.cs
- PngBitmapEncoder.cs
- BidirectionalDictionary.cs
- GenericTextProperties.cs
- DataChangedEventManager.cs
- ProtocolsConfigurationHandler.cs
- HTMLTextWriter.cs
- ObjectQuery.cs
- ButtonStandardAdapter.cs
- SoapAttributes.cs
- ScriptComponentDescriptor.cs
- CommonXSendMessage.cs
- ChangeNode.cs
- BrowserTree.cs
- DrawingCollection.cs
- PeerInvitationResponse.cs
- FixedDocument.cs
- MultiSelectRootGridEntry.cs
- IteratorDescriptor.cs
- WebPartVerb.cs
- WebPartConnectionsCancelVerb.cs
- WebPartEditorCancelVerb.cs
- SQLInt64.cs
- PropertyManager.cs
- CLSCompliantAttribute.cs
- PerformanceCounterPermissionEntry.cs
- ProvidePropertyAttribute.cs
- QilXmlReader.cs
- ExtentKey.cs
- DocobjHost.cs
- basecomparevalidator.cs
- HtmlFormAdapter.cs
- Int32RectConverter.cs