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
- DataColumnPropertyDescriptor.cs
- KeyValueSerializer.cs
- HttpHeaderCollection.cs
- ScrollProperties.cs
- WindowsGraphicsCacheManager.cs
- IDQuery.cs
- TextTreeInsertElementUndoUnit.cs
- HiddenField.cs
- EmptyReadOnlyDictionaryInternal.cs
- _TimerThread.cs
- SQLByteStorage.cs
- OpCopier.cs
- TypeRefElement.cs
- WindowsRichEditRange.cs
- securestring.cs
- AsyncPostBackErrorEventArgs.cs
- xml.cs
- ListViewEditEventArgs.cs
- BindingGroup.cs
- GlyphingCache.cs
- ExpressionParser.cs
- TypeConverter.cs
- WebEventTraceProvider.cs
- SafeRsaProviderHandle.cs
- WebHostScriptMappingsInstallComponent.cs
- HTTPNotFoundHandler.cs
- MetadataUtilsSmi.cs
- ViewGenerator.cs
- DataStreams.cs
- AuthorizationRule.cs
- ProgressBarHighlightConverter.cs
- BinaryKeyIdentifierClause.cs
- DataColumn.cs
- NetworkStream.cs
- RegexBoyerMoore.cs
- TablePattern.cs
- IntSecurity.cs
- Int64Converter.cs
- XmlSchemaAttribute.cs
- DeferredElementTreeState.cs
- StyleSelector.cs
- DefinitionUpdate.cs
- VectorAnimation.cs
- DiscoveryDocumentSerializer.cs
- OleDbErrorCollection.cs
- FixedHyperLink.cs
- EvidenceTypeDescriptor.cs
- ExpandCollapsePatternIdentifiers.cs
- NetMsmqBindingElement.cs
- DependencyObject.cs
- BitmapInitialize.cs
- ListViewItemMouseHoverEvent.cs
- SystemGatewayIPAddressInformation.cs
- XmlChildNodes.cs
- HttpModulesSection.cs
- SqlCacheDependencyDatabase.cs
- ComPlusDiagnosticTraceRecords.cs
- QilCloneVisitor.cs
- keycontainerpermission.cs
- DBConcurrencyException.cs
- AttachedAnnotation.cs
- PiiTraceSource.cs
- FtpWebResponse.cs
- SurrogateSelector.cs
- DataSourceHelper.cs
- DoubleConverter.cs
- MappedMetaModel.cs
- TextTreeNode.cs
- SettingsPropertyValueCollection.cs
- LogSwitch.cs
- PenLineCapValidation.cs
- FormsAuthentication.cs
- CanExecuteRoutedEventArgs.cs
- QueryOpcode.cs
- RenamedEventArgs.cs
- EventArgs.cs
- DynamicActionMessageFilter.cs
- HostingEnvironment.cs
- serverconfig.cs
- WebProxyScriptElement.cs
- odbcmetadatafactory.cs
- ImmutableDispatchRuntime.cs
- SqlConnectionHelper.cs
- Mappings.cs
- COM2PropertyBuilderUITypeEditor.cs
- OleDbParameter.cs
- DEREncoding.cs
- WebBrowserUriTypeConverter.cs
- RegionInfo.cs
- FacetChecker.cs
- SqlCacheDependency.cs
- Exceptions.cs
- XmlSchemaCompilationSettings.cs
- PipeSecurity.cs
- RevocationPoint.cs
- FormsAuthenticationUserCollection.cs
- DisplayMemberTemplateSelector.cs
- SmtpReplyReader.cs
- RtfToXamlLexer.cs
- MembershipPasswordException.cs