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
- StyleXamlTreeBuilder.cs
- ZipFileInfo.cs
- recordstate.cs
- SessionStateUtil.cs
- ResourceProperty.cs
- ButtonField.cs
- XamlPoint3DCollectionSerializer.cs
- NotifyInputEventArgs.cs
- EntityDataSourceColumn.cs
- CustomServiceCredentials.cs
- ButtonRenderer.cs
- WorkflowInstanceProvider.cs
- DesignerSerializerAttribute.cs
- VisualCollection.cs
- SiteMapPath.cs
- StringDictionaryCodeDomSerializer.cs
- XmlSchemaGroup.cs
- PartialClassGenerationTask.cs
- ImageButton.cs
- CmsInterop.cs
- Glyph.cs
- RegexRunnerFactory.cs
- CollectionBase.cs
- CodeRemoveEventStatement.cs
- InputDevice.cs
- IdentifierCollection.cs
- ObjectQueryState.cs
- PaintValueEventArgs.cs
- PeerInvitationResponse.cs
- AncillaryOps.cs
- PackageDigitalSignatureManager.cs
- OdbcUtils.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- RectangleHotSpot.cs
- DecoderBestFitFallback.cs
- ControlCachePolicy.cs
- InternalBufferOverflowException.cs
- XmlWrappingWriter.cs
- CompilerInfo.cs
- WebEvents.cs
- ButtonFlatAdapter.cs
- NativeMethods.cs
- DetailsViewDeleteEventArgs.cs
- prefixendpointaddressmessagefiltertable.cs
- EventListener.cs
- GridProviderWrapper.cs
- StandardBindingOptionalReliableSessionElement.cs
- OleDbRowUpdatingEvent.cs
- ManagedIStream.cs
- GroupItemAutomationPeer.cs
- MemberRelationshipService.cs
- GeneralTransform2DTo3D.cs
- EntryPointNotFoundException.cs
- UnauthorizedAccessException.cs
- CodeGenerator.cs
- OracleRowUpdatingEventArgs.cs
- mongolianshape.cs
- QueryExpression.cs
- ZipIOLocalFileDataDescriptor.cs
- CodeExporter.cs
- TemplateControlBuildProvider.cs
- ApplicationSettingsBase.cs
- SupportsEventValidationAttribute.cs
- OneOfConst.cs
- ReadOnlyHierarchicalDataSource.cs
- ConfigurationManagerInternalFactory.cs
- TraceFilter.cs
- FutureFactory.cs
- SslStream.cs
- BrushValueSerializer.cs
- JsonObjectDataContract.cs
- Workspace.cs
- TagMapInfo.cs
- DataBindingCollectionConverter.cs
- XmlSchemaAnyAttribute.cs
- DynamicDiscoveryDocument.cs
- BuildProvidersCompiler.cs
- WrappedDispatcherException.cs
- SignatureToken.cs
- BindingCollection.cs
- DocumentOrderQuery.cs
- TextTreeUndo.cs
- SkinIDTypeConverter.cs
- AssemblyName.cs
- EmptyReadOnlyDictionaryInternal.cs
- WebPartTracker.cs
- ProviderCollection.cs
- BamlCollectionHolder.cs
- DbException.cs
- TreeViewImageKeyConverter.cs
- QilDataSource.cs
- LexicalChunk.cs
- ChangeTracker.cs
- TCEAdapterGenerator.cs
- WrappedReader.cs
- Rss20FeedFormatter.cs
- StateManagedCollection.cs
- EntitySetBase.cs
- ThemeableAttribute.cs
- Menu.cs