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
- COM2ExtendedBrowsingHandler.cs
- ContractNamespaceAttribute.cs
- DefaultShape.cs
- CustomSignedXml.cs
- BoundColumn.cs
- DirtyTextRange.cs
- StreamMarshaler.cs
- DebugView.cs
- HtmlFormWrapper.cs
- NameTable.cs
- NotImplementedException.cs
- OptimalTextSource.cs
- PersonalizationProvider.cs
- NativeMethods.cs
- CachedTypeface.cs
- XPathDocumentNavigator.cs
- ToolStripItemEventArgs.cs
- SafeThreadHandle.cs
- BuiltInExpr.cs
- UdpDiscoveryEndpointProvider.cs
- ViewSimplifier.cs
- SqlGenerator.cs
- path.cs
- SqlTriggerAttribute.cs
- SystemDropShadowChrome.cs
- ConfigXmlCDataSection.cs
- ToolBarButtonClickEvent.cs
- SingleAnimation.cs
- ListViewDeleteEventArgs.cs
- MDIWindowDialog.cs
- TextTrailingCharacterEllipsis.cs
- SerializerDescriptor.cs
- OleDbDataReader.cs
- RoleManagerSection.cs
- ErrorFormatter.cs
- SHA1.cs
- CultureInfoConverter.cs
- DataSourceControlBuilder.cs
- TableTextElementCollectionInternal.cs
- ProtectedProviderSettings.cs
- ContentPlaceHolder.cs
- KeyManager.cs
- TextTrailingCharacterEllipsis.cs
- DLinqAssociationProvider.cs
- WebSysDisplayNameAttribute.cs
- XmlDocument.cs
- WebServiceData.cs
- Error.cs
- TranslateTransform3D.cs
- WebPartUserCapability.cs
- xamlnodes.cs
- SafeWaitHandle.cs
- RoutedEventHandlerInfo.cs
- InitializerFacet.cs
- SiteMapProvider.cs
- RightsManagementEncryptedStream.cs
- TagPrefixCollection.cs
- IntegerValidator.cs
- ExtendedPropertiesHandler.cs
- PageBreakRecord.cs
- DynamicActivityXamlReader.cs
- TypeElement.cs
- WeakReferenceKey.cs
- SecurityContext.cs
- HtmlInputReset.cs
- OdbcDataReader.cs
- EnglishPluralizationService.cs
- ReadOnlyDictionary.cs
- FilterElement.cs
- ProcessModelInfo.cs
- XmlBinaryReader.cs
- SessionPageStatePersister.cs
- AssemblyName.cs
- FileSystemWatcher.cs
- base64Transforms.cs
- BinaryConverter.cs
- PropertyStore.cs
- TextEndOfSegment.cs
- HMAC.cs
- DataGridViewCellStyleChangedEventArgs.cs
- PostBackTrigger.cs
- DbUpdateCommandTree.cs
- PathFigureCollectionValueSerializer.cs
- XmlEncoding.cs
- SqlDataSourceFilteringEventArgs.cs
- InputLangChangeEvent.cs
- ConfigurationManagerHelperFactory.cs
- SoapTypeAttribute.cs
- ManagedFilter.cs
- OutputCacheSection.cs
- RightNameExpirationInfoPair.cs
- NonBatchDirectoryCompiler.cs
- WarningException.cs
- PaperSize.cs
- ParseChildrenAsPropertiesAttribute.cs
- TextBounds.cs
- BufferedReadStream.cs
- DrawingState.cs
- ListSortDescription.cs
- XmlILOptimizerVisitor.cs