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
- WebPartEventArgs.cs
- IdnElement.cs
- FtpWebResponse.cs
- ExtentKey.cs
- GeneralTransform3DCollection.cs
- PermissionSetTriple.cs
- MarshalByValueComponent.cs
- PersistNameAttribute.cs
- Baml6ConstructorInfo.cs
- ConsoleKeyInfo.cs
- LogoValidationException.cs
- AccessViolationException.cs
- EntityDataSourceContextDisposingEventArgs.cs
- SafeEventLogWriteHandle.cs
- SqlNamer.cs
- SQLDateTimeStorage.cs
- FunctionQuery.cs
- XmlSchemaImporter.cs
- Formatter.cs
- HttpResponseWrapper.cs
- SmtpFailedRecipientException.cs
- DataGridViewCheckBoxColumn.cs
- GeometryConverter.cs
- SHA256.cs
- Frame.cs
- FontStretches.cs
- BindingRestrictions.cs
- HandledMouseEvent.cs
- ExternalFile.cs
- TimeSpan.cs
- BuildProvider.cs
- ByteStreamGeometryContext.cs
- TextRange.cs
- TraceFilter.cs
- DynamicMetaObjectBinder.cs
- ThicknessAnimationBase.cs
- HtmlTableCell.cs
- XmlValidatingReader.cs
- ModuleBuilderData.cs
- DefaultValueTypeConverter.cs
- LinkedList.cs
- CollectionViewProxy.cs
- AVElementHelper.cs
- TreeNodeBindingCollection.cs
- TreeNodeBindingCollection.cs
- FixedDSBuilder.cs
- TextPattern.cs
- SqlTriggerContext.cs
- AsymmetricKeyExchangeDeformatter.cs
- DocumentApplication.cs
- SamlAuthorizationDecisionClaimResource.cs
- WindowsSlider.cs
- DataMisalignedException.cs
- DialogWindow.cs
- ScrollEventArgs.cs
- TextServicesContext.cs
- TextBoxAutomationPeer.cs
- MessageDescription.cs
- brushes.cs
- AddressHeader.cs
- ClickablePoint.cs
- DetailsView.cs
- DataGridRow.cs
- NameTable.cs
- FrameDimension.cs
- BitmapEffectInput.cs
- TextPattern.cs
- _ContextAwareResult.cs
- IIS7WorkerRequest.cs
- _KerberosClient.cs
- KeyManager.cs
- XmlToDatasetMap.cs
- AssemblySettingAttributes.cs
- AssemblyLoader.cs
- XPathDocumentBuilder.cs
- RulePatternOps.cs
- TransactionFilter.cs
- dtdvalidator.cs
- RuleSetReference.cs
- TargetConverter.cs
- BufferedStream.cs
- FrameworkElementFactory.cs
- EventManager.cs
- SlipBehavior.cs
- RenderDataDrawingContext.cs
- ProbeRequestResponseAsyncResult.cs
- InsufficientExecutionStackException.cs
- SqlRetyper.cs
- ThrowHelper.cs
- Int32Collection.cs
- PropertyRecord.cs
- ResXResourceSet.cs
- SharedPersonalizationStateInfo.cs
- ThemeableAttribute.cs
- AcceleratedTokenProvider.cs
- PropertyMappingExceptionEventArgs.cs
- SystemColorTracker.cs
- Win32.cs
- Composition.cs
- CharEntityEncoderFallback.cs