Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ // 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
- TiffBitmapDecoder.cs
- Point3D.cs
- CellQuery.cs
- RenamedEventArgs.cs
- EmptyEnumerator.cs
- HostProtectionPermission.cs
- _AutoWebProxyScriptHelper.cs
- Tablet.cs
- ProcessHostServerConfig.cs
- CollectionType.cs
- HtmlTable.cs
- DataGridViewRowPrePaintEventArgs.cs
- DataRecordInternal.cs
- HtmlCalendarAdapter.cs
- DateTimeFormatInfo.cs
- IntegrationExceptionEventArgs.cs
- hwndwrapper.cs
- TreeNode.cs
- securitymgrsite.cs
- TextTrailingWordEllipsis.cs
- XmlSchemaGroup.cs
- CharacterShapingProperties.cs
- ExternalException.cs
- HttpStaticObjectsCollectionBase.cs
- ToolboxCategory.cs
- ControlDesignerState.cs
- BaseCollection.cs
- XsltCompileContext.cs
- ExpandedProjectionNode.cs
- HtmlControl.cs
- Itemizer.cs
- PrePostDescendentsWalker.cs
- XpsFilter.cs
- HtmlLink.cs
- AnimationTimeline.cs
- DataMisalignedException.cs
- PropertyValueChangedEvent.cs
- FrameworkElement.cs
- StringInfo.cs
- Environment.cs
- AnnotationResourceChangedEventArgs.cs
- Int32Collection.cs
- RoleManagerSection.cs
- X509CertificateStore.cs
- WebPartZoneCollection.cs
- GridViewCommandEventArgs.cs
- FunctionDetailsReader.cs
- Codec.cs
- BitmapFrameDecode.cs
- WmlFormAdapter.cs
- AttributeData.cs
- SynchronizationLockException.cs
- TableAdapterManagerGenerator.cs
- WebPart.cs
- HtmlToClrEventProxy.cs
- XmlExceptionHelper.cs
- UTF32Encoding.cs
- IncrementalReadDecoders.cs
- MenuTracker.cs
- LinearKeyFrames.cs
- SharedUtils.cs
- DocumentViewerConstants.cs
- TypeExtension.cs
- CapabilitiesPattern.cs
- RegistryPermission.cs
- ContextInformation.cs
- SqlRemoveConstantOrderBy.cs
- FormatConvertedBitmap.cs
- ThaiBuddhistCalendar.cs
- TypeConstant.cs
- ProviderConnectionPoint.cs
- CodeParameterDeclarationExpression.cs
- RootBrowserWindow.cs
- XPathAxisIterator.cs
- BitmapEffectState.cs
- TimeIntervalCollection.cs
- Quaternion.cs
- XmlSchemaIdentityConstraint.cs
- BindingMemberInfo.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- TimeStampChecker.cs
- SqlConnectionStringBuilder.cs
- CodeThrowExceptionStatement.cs
- ProcessHost.cs
- Html32TextWriter.cs
- DataTableReaderListener.cs
- RequestedSignatureDialog.cs
- Select.cs
- HttpHandlerAction.cs
- CompoundFileDeflateTransform.cs
- CrossContextChannel.cs
- Renderer.cs
- GridViewSortEventArgs.cs
- SiteMapPath.cs
- BidPrivateBase.cs
- RijndaelCryptoServiceProvider.cs
- DocumentReferenceCollection.cs
- Underline.cs
- Int64AnimationUsingKeyFrames.cs
- EncoderNLS.cs