Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Core / CSharp / 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.
//------------------------------------------------------------------------------
// 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
- MobileCapabilities.cs
- _WebProxyDataBuilder.cs
- RTLAwareMessageBox.cs
- CmsUtils.cs
- ProfileGroupSettings.cs
- WorkflowPrinting.cs
- CatalogPartChrome.cs
- DesignTimeParseData.cs
- ProgressBar.cs
- GridViewUpdatedEventArgs.cs
- UndirectedGraph.cs
- OletxResourceManager.cs
- XPathDocumentBuilder.cs
- ConfigurationException.cs
- BuildProviderInstallComponent.cs
- InvokeProviderWrapper.cs
- ParserOptions.cs
- ToolStripCollectionEditor.cs
- SynchronizationContext.cs
- LicFileLicenseProvider.cs
- SiteMapDataSource.cs
- FormsIdentity.cs
- Compiler.cs
- InternalMappingException.cs
- ActivityInstanceReference.cs
- TextEffectCollection.cs
- CodeTypeOfExpression.cs
- IndentTextWriter.cs
- OleDbException.cs
- SelectionRange.cs
- TextParagraph.cs
- NetworkAddressChange.cs
- ToolStripSplitButton.cs
- EDesignUtil.cs
- OracleConnection.cs
- AssociationSet.cs
- XamlFrame.cs
- ContextMenuService.cs
- TreeViewTemplateSelector.cs
- TCEAdapterGenerator.cs
- IssuedTokenClientBehaviorsElement.cs
- SystemBrushes.cs
- _SpnDictionary.cs
- DateTimePickerDesigner.cs
- Button.cs
- ViewLoader.cs
- SqlInternalConnection.cs
- SemanticBasicElement.cs
- ServiceEndpointElement.cs
- SortedDictionary.cs
- TableRow.cs
- HttpModuleAction.cs
- ReferenceList.cs
- SqlProviderManifest.cs
- InternalTypeHelper.cs
- RepeatButtonAutomationPeer.cs
- DocumentSchemaValidator.cs
- PaginationProgressEventArgs.cs
- SafeNativeMethods.cs
- EmbeddedMailObject.cs
- SoapCodeExporter.cs
- ProviderUtil.cs
- TypeSystem.cs
- FixedPageAutomationPeer.cs
- ExpandoClass.cs
- RMEnrollmentPage3.cs
- Root.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- WebPartEditorCancelVerb.cs
- ElementUtil.cs
- AdjustableArrowCap.cs
- DbDataRecord.cs
- AuthenticationServiceManager.cs
- NamespaceQuery.cs
- WindowsToolbar.cs
- SortQuery.cs
- VoiceInfo.cs
- RegexFCD.cs
- QueryReaderSettings.cs
- DateTimeConverter.cs
- SQLSingleStorage.cs
- wmiprovider.cs
- MD5HashHelper.cs
- MultiPropertyDescriptorGridEntry.cs
- XmlDownloadManager.cs
- UniqueID.cs
- TextWriter.cs
- SmtpDigestAuthenticationModule.cs
- ToolStripContextMenu.cs
- DataMemberConverter.cs
- ObjectAnimationBase.cs
- xsdvalidator.cs
- PageContentAsyncResult.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- NameHandler.cs
- DataView.cs
- ToggleButtonAutomationPeer.cs
- DbParameterCollectionHelper.cs
- mansign.cs
- WinEventTracker.cs