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
- StateMachineHelpers.cs
- Variable.cs
- Compiler.cs
- ChangePasswordDesigner.cs
- SharedStatics.cs
- XmlSchemaParticle.cs
- TraceSection.cs
- HtmlControlAdapter.cs
- HostingEnvironment.cs
- EntityDataReader.cs
- HashHelper.cs
- BooleanToVisibilityConverter.cs
- EntityDescriptor.cs
- EditorZoneBase.cs
- SqlParameterCollection.cs
- StoragePropertyMapping.cs
- EditorPartCollection.cs
- CheckedListBox.cs
- FastPropertyAccessor.cs
- WindowHideOrCloseTracker.cs
- Internal.cs
- DBDataPermissionAttribute.cs
- ColorMap.cs
- StreamGeometry.cs
- CurrentTimeZone.cs
- LocalValueEnumerator.cs
- PreProcessor.cs
- SelfIssuedTokenFactoryCredential.cs
- FormatConvertedBitmap.cs
- TraceContextEventArgs.cs
- NativeBuffer.cs
- PackageFilter.cs
- FormViewCommandEventArgs.cs
- RegexWorker.cs
- PortCache.cs
- errorpatternmatcher.cs
- ValueType.cs
- metadatamappinghashervisitor.cs
- TypeBuilderInstantiation.cs
- DbMetaDataColumnNames.cs
- PageAdapter.cs
- PartialTrustVisibleAssembliesSection.cs
- StartFileNameEditor.cs
- Listbox.cs
- SoapRpcMethodAttribute.cs
- PriorityRange.cs
- RankException.cs
- DataSourceXmlSerializer.cs
- FormViewRow.cs
- ScriptingAuthenticationServiceSection.cs
- ACL.cs
- ButtonColumn.cs
- FaultFormatter.cs
- MessageTransmitTraceRecord.cs
- OracleString.cs
- KeyConstraint.cs
- SpellerStatusTable.cs
- Delegate.cs
- RSAPKCS1SignatureDeformatter.cs
- InputLanguageProfileNotifySink.cs
- PackWebRequestFactory.cs
- Utils.cs
- ThreadStartException.cs
- ContractSearchPattern.cs
- NavigationWindow.cs
- AttachmentCollection.cs
- MarginCollapsingState.cs
- MsmqException.cs
- ActivityInstanceReference.cs
- SmiGettersStream.cs
- ChannelProtectionRequirements.cs
- Soap11ServerProtocol.cs
- HttpResponseHeader.cs
- _ConnectOverlappedAsyncResult.cs
- WebPartConnectionsCloseVerb.cs
- EntryIndex.cs
- DrawingGroup.cs
- DesignerTransactionCloseEvent.cs
- PointCollectionConverter.cs
- DbgCompiler.cs
- DBSqlParserTable.cs
- Ref.cs
- StringBuilder.cs
- StreamWithDictionary.cs
- TrackingProfileCache.cs
- BeginStoryboard.cs
- ContentType.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- RegisterInfo.cs
- OpacityConverter.cs
- OdbcConnectionPoolProviderInfo.cs
- XmlBaseReader.cs
- DynamicPropertyHolder.cs
- SecurityKeyIdentifier.cs
- GACIdentityPermission.cs
- ContainerTracking.cs
- IOException.cs
- TextLine.cs
- DesignTimeParseData.cs
- SqlFunctionAttribute.cs