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
- TimeSpanSecondsOrInfiniteConverter.cs
- UrlAuthFailedErrorFormatter.cs
- CodeMemberEvent.cs
- WebColorConverter.cs
- DSASignatureDeformatter.cs
- CodeRemoveEventStatement.cs
- Size.cs
- SqlXml.cs
- Hex.cs
- SystemIPGlobalStatistics.cs
- ObjectViewFactory.cs
- VisualStyleInformation.cs
- HttpPostProtocolReflector.cs
- RegexReplacement.cs
- ToolStripLocationCancelEventArgs.cs
- FileEnumerator.cs
- xmlNames.cs
- Mutex.cs
- AddInDeploymentState.cs
- DesignerSerializationManager.cs
- EncryptedXml.cs
- VirtualDirectoryMappingCollection.cs
- SafeArrayTypeMismatchException.cs
- DbExpressionRules.cs
- AuthenticationSchemesHelper.cs
- RadioButton.cs
- RoutedPropertyChangedEventArgs.cs
- FontWeights.cs
- ResourceReferenceExpression.cs
- WindowsIdentity.cs
- DictionaryEntry.cs
- CompensationHandlingFilter.cs
- StateRuntime.cs
- SecurityBindingElement.cs
- MailMessageEventArgs.cs
- BrowsableAttribute.cs
- FileDialog.cs
- PeerEndPoint.cs
- LabelInfo.cs
- XmlDocument.cs
- Queue.cs
- XmlProcessingInstruction.cs
- SafeRightsManagementPubHandle.cs
- UserNamePasswordValidator.cs
- TreeViewEvent.cs
- AdornerPresentationContext.cs
- ContentPropertyAttribute.cs
- RelationalExpressions.cs
- XmlObjectSerializerWriteContextComplex.cs
- FileDialogCustomPlace.cs
- XPathException.cs
- SecurityValidationBehavior.cs
- DetailsViewUpdateEventArgs.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- SafeTimerHandle.cs
- Parameter.cs
- ApplicationTrust.cs
- Query.cs
- BrowserCapabilitiesCodeGenerator.cs
- ConfigXmlComment.cs
- OutputCacheProviderCollection.cs
- DynamicMethod.cs
- NonParentingControl.cs
- DPTypeDescriptorContext.cs
- NeutralResourcesLanguageAttribute.cs
- WebServiceFaultDesigner.cs
- ResourceProviderFactory.cs
- PropertyAccessVisitor.cs
- WebBrowserNavigatingEventHandler.cs
- SQLGuid.cs
- SupportingTokenProviderSpecification.cs
- SimpleExpression.cs
- WindowsFormsSynchronizationContext.cs
- ClientBuildManager.cs
- WebPartPersonalization.cs
- InternalTypeHelper.cs
- AuthorizationRuleCollection.cs
- PackageDigitalSignatureManager.cs
- EntityDataSourceConfigureObjectContext.cs
- MarkupExtensionReturnTypeAttribute.cs
- ObjectSpanRewriter.cs
- NetworkAddressChange.cs
- AsyncPostBackTrigger.cs
- COM2Enum.cs
- CompositeDataBoundControl.cs
- OletxTransactionHeader.cs
- LinkUtilities.cs
- ParserStreamGeometryContext.cs
- IisTraceWebEventProvider.cs
- WebPartMenuStyle.cs
- PtsContext.cs
- HttpModuleAction.cs
- MetadataArtifactLoaderFile.cs
- IPGlobalProperties.cs
- MediaSystem.cs
- PropertyToken.cs
- RoleManagerSection.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- OptimizerPatterns.cs
- PinnedBufferMemoryStream.cs