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
- Validator.cs
- DataGridViewLinkCell.cs
- EmbossBitmapEffect.cs
- FixUp.cs
- TimeoutException.cs
- SqlFileStream.cs
- InheritanceRules.cs
- ManagedIStream.cs
- AssemblyBuilderData.cs
- CodeLinePragma.cs
- InputScopeConverter.cs
- TdsParserStaticMethods.cs
- XamlWriter.cs
- MailMessage.cs
- DecimalFormatter.cs
- CollectionEditorDialog.cs
- LongValidator.cs
- XmlSchemaSimpleTypeUnion.cs
- XappLauncher.cs
- AppSecurityManager.cs
- HeaderCollection.cs
- Icon.cs
- CounterCreationDataConverter.cs
- RestHandler.cs
- SmtpMail.cs
- connectionpool.cs
- TabItemWrapperAutomationPeer.cs
- PrintController.cs
- WeakEventTable.cs
- CellTreeNode.cs
- VolatileEnlistmentState.cs
- GeneralTransform.cs
- HijriCalendar.cs
- TemplateBindingExpressionConverter.cs
- ProvideValueServiceProvider.cs
- _SSPISessionCache.cs
- UseLicense.cs
- WebPartConnectionsCancelEventArgs.cs
- HtmlControlPersistable.cs
- DataKey.cs
- LoginStatusDesigner.cs
- ListParagraph.cs
- Emitter.cs
- OTFRasterizer.cs
- Fonts.cs
- XmlTextReaderImpl.cs
- XamlTemplateSerializer.cs
- DBConnectionString.cs
- MouseButtonEventArgs.cs
- UpdateExpressionVisitor.cs
- WeakReferenceEnumerator.cs
- AppDomainManager.cs
- Solver.cs
- WindowsSolidBrush.cs
- FontFamilyConverter.cs
- GridItemCollection.cs
- ListBox.cs
- SQLResource.cs
- MediaTimeline.cs
- WindowInteractionStateTracker.cs
- Evaluator.cs
- XsdDateTime.cs
- And.cs
- DiagnosticsConfigurationHandler.cs
- ComponentSerializationService.cs
- FormView.cs
- DragEventArgs.cs
- HighContrastHelper.cs
- EmissiveMaterial.cs
- ConditionalAttribute.cs
- ClientData.cs
- DbDataReader.cs
- ControlCachePolicy.cs
- RegexInterpreter.cs
- Currency.cs
- NumberSubstitution.cs
- LiteralTextContainerControlBuilder.cs
- IdleTimeoutMonitor.cs
- InputMethodStateTypeInfo.cs
- DataGridViewRowsRemovedEventArgs.cs
- AsyncPostBackErrorEventArgs.cs
- DesignerCategoryAttribute.cs
- Viewport3DAutomationPeer.cs
- DateTimeHelper.cs
- CharacterString.cs
- ToolStripLabel.cs
- CustomTypeDescriptor.cs
- XamlSerializationHelper.cs
- Message.cs
- ButtonField.cs
- XamlGridLengthSerializer.cs
- AccessorTable.cs
- CallbackHandler.cs
- XDeferredAxisSource.cs
- AttachmentService.cs
- RawStylusInputCustomDataList.cs
- NullEntityWrapper.cs
- PageBuildProvider.cs
- TypeSystem.cs
- Light.cs