Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / infocard / Client / System / IdentityModel / Selectors / SafeTokenHandle.cs / 1305376 / SafeTokenHandle.cs
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
namespace System.IdentityModel.Selectors
{
using System;
using System.Runtime.InteropServices;
using System.Runtime.ConstrainedExecution;
using System.Security;
//
// Summary:
// Provides a wrapper over the generic xml token returned from the native client
//
internal class SafeTokenHandle : SafeHandle
{
[DllImport( "infocardapi.dll",
EntryPoint ="FreeToken",
CharSet = CharSet.Unicode,
CallingConvention = CallingConvention.StdCall,
ExactSpelling = true,
SetLastError = true ) ]
[SuppressUnmanagedCodeSecurity]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
public static extern System.Int32 FreeToken( [In] IntPtr token );
private SafeTokenHandle() : base( IntPtr.Zero, true )
{
}
public override bool IsInvalid
{
get
{
return ( IntPtr.Zero == base.handle );
}
}
protected override bool ReleaseHandle()
{
#pragma warning suppress 56523
return ( 0 == FreeToken( base.handle ) ) ? false : true;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- hwndwrapper.cs
- LinkClickEvent.cs
- HttpListenerRequest.cs
- CodeIndexerExpression.cs
- WinFormsSecurity.cs
- CookieHandler.cs
- BinaryFormatterSinks.cs
- InvokePatternIdentifiers.cs
- WindowsSlider.cs
- StateManagedCollection.cs
- MenuItem.cs
- BufferedWebEventProvider.cs
- CodeDomSerializationProvider.cs
- FontCacheLogic.cs
- ScrollChrome.cs
- ForeignKeyConstraint.cs
- RuntimeHandles.cs
- NativeMethods.cs
- LayoutTableCell.cs
- ButtonColumn.cs
- StringSorter.cs
- ProfileProvider.cs
- CompletionBookmark.cs
- ExtendedPropertyCollection.cs
- RequestValidator.cs
- NotSupportedException.cs
- _NativeSSPI.cs
- UpdateTracker.cs
- ListBoxItemWrapperAutomationPeer.cs
- DataException.cs
- CodeCommentStatementCollection.cs
- Logging.cs
- ServiceModelConfigurationSection.cs
- Matrix.cs
- CodeAssignStatement.cs
- HighContrastHelper.cs
- XPathNodePointer.cs
- PointCollection.cs
- GeometryGroup.cs
- ReadOnlyHierarchicalDataSourceView.cs
- PartialTrustVisibleAssemblyCollection.cs
- WebConfigurationHostFileChange.cs
- IntSecurity.cs
- ConstructorExpr.cs
- IfAction.cs
- ClientScriptItem.cs
- AuthorizationSection.cs
- Padding.cs
- Stream.cs
- DbModificationClause.cs
- CodeVariableDeclarationStatement.cs
- CodeMethodReturnStatement.cs
- QuaternionValueSerializer.cs
- DocumentViewerHelper.cs
- MultipartIdentifier.cs
- DSASignatureFormatter.cs
- ConfigXmlAttribute.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- XmlCharType.cs
- ComboBoxItem.cs
- ProfileEventArgs.cs
- QilLiteral.cs
- StaticResourceExtension.cs
- BamlLocalizabilityResolver.cs
- ClientCultureInfo.cs
- DefaultSettingsSection.cs
- MenuBindingsEditorForm.cs
- XPathNodeHelper.cs
- IResourceProvider.cs
- IconConverter.cs
- CookielessHelper.cs
- StructuredTypeInfo.cs
- SafeEventLogWriteHandle.cs
- IntellisenseTextBox.cs
- DataGridClipboardHelper.cs
- RoleService.cs
- MatrixTransform3D.cs
- ReflectionTypeLoadException.cs
- ControlBindingsCollection.cs
- ThemeInfoAttribute.cs
- RequestNavigateEventArgs.cs
- ReflectionServiceProvider.cs
- CategoryAttribute.cs
- AssemblyInfo.cs
- __TransparentProxy.cs
- GridViewUpdatedEventArgs.cs
- DataServiceRequestException.cs
- TabItem.cs
- SiteIdentityPermission.cs
- ManagementScope.cs
- ScriptingJsonSerializationSection.cs
- ResolveNameEventArgs.cs
- Collection.cs
- PipelineModuleStepContainer.cs
- TextEditorMouse.cs
- MatrixCamera.cs
- RequestCacheEntry.cs
- PlaceHolder.cs
- EntityDataSourceWrapperCollection.cs
- PropertyStore.cs