Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / infocard / Service / managed / Microsoft / InfoCards / RpcCryptoRequest.cs / 1 / RpcCryptoRequest.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace Microsoft.InfoCards { using System; using System.IO; using System.ComponentModel; using System.Runtime.InteropServices; using Microsoft.InfoCards.Diagnostics; using IDT = Microsoft.InfoCards.Diagnostics.InfoCardTrace; // // Summary: // Abstract client request class for RpcCrypto interface // abstract class RpcCryptoRequest { RpcCryptoContext m_context; // // Summary: // Base request Ctor: // protected RpcCryptoRequest( RpcCryptoContext context ) { m_context = context; } // // Summary: // Implementers request name. // public abstract string Name{get;} // // Summary: // Process the request. // public void Process() { MemoryStream ms = new MemoryStream(); MarshalOutArgs( ms ); byte[] buffer = ms.GetBuffer(); byte[] returnBuffer = null; // // Translate the win32 exceptions into a communication exception, // as if it occurs, // try { returnBuffer = NativeMcppMethods.RpcCryptoDispatchRequest( m_context.InterfaceHandle, m_context.ContextKey, Name, buffer, 0, Convert.ToInt32( ms.Length ) ); } catch( Win32Exception we ) { if( we.NativeErrorCode == (int) EventCode.SCARD_W_CANCELLED_BY_USER ) { throw IDT.ThrowHelperError( new UserCancelledException( null, we ) ); } else { throw IDT.ThrowHelperError( new CommunicationException( null, we ) ); } } ms = new MemoryStream( returnBuffer ); MarshalReturnArgs( ms ); } protected abstract void MarshalOutArgs( Stream stream ); protected abstract void MarshalReturnArgs( Stream stream ); } } // 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
- EntitySetDataBindingList.cs
- CreateDataSourceDialog.cs
- DataGridViewRowsAddedEventArgs.cs
- CollectionBuilder.cs
- WithStatement.cs
- CertificateManager.cs
- TableLayoutSettingsTypeConverter.cs
- SemanticResultValue.cs
- BaseCollection.cs
- SequentialWorkflowRootDesigner.cs
- Stack.cs
- DBPropSet.cs
- ImportCatalogPart.cs
- Activator.cs
- DelegatedStream.cs
- Html32TextWriter.cs
- SafeFreeMibTable.cs
- ClientApiGenerator.cs
- RuntimeArgumentHandle.cs
- SystemIcons.cs
- TypeHelpers.cs
- NGCSerializationManager.cs
- WebResponse.cs
- IUnknownConstantAttribute.cs
- CellLabel.cs
- AnnotationResourceCollection.cs
- LogLogRecord.cs
- SimpleHandlerBuildProvider.cs
- XsltLibrary.cs
- ImageFormatConverter.cs
- SecurityCriticalDataForSet.cs
- BitVector32.cs
- SpotLight.cs
- ConfigurationStrings.cs
- WebBrowserNavigatingEventHandler.cs
- processwaithandle.cs
- StateBag.cs
- ConfigurationFileMap.cs
- XmlParser.cs
- SqlCommandSet.cs
- TableColumn.cs
- EventRoute.cs
- TextBlock.cs
- DataGridViewComboBoxColumn.cs
- Literal.cs
- NavigationWindow.cs
- ProxyElement.cs
- DataGridViewCellStyleConverter.cs
- util.cs
- Peer.cs
- FontCacheLogic.cs
- SafeLocalMemHandle.cs
- ToolboxItemFilterAttribute.cs
- SelectionEditor.cs
- DoubleAnimationUsingPath.cs
- NullReferenceException.cs
- CompositeDataBoundControl.cs
- ListDataHelper.cs
- SafeFreeMibTable.cs
- QilValidationVisitor.cs
- PeerValidationBehavior.cs
- FragmentQueryProcessor.cs
- NetTcpBindingElement.cs
- LineSegment.cs
- Site.cs
- PatternMatcher.cs
- CompositeTypefaceMetrics.cs
- RootProfilePropertySettingsCollection.cs
- Msec.cs
- Transform3DGroup.cs
- PropertyDescriptorCollection.cs
- CmsInterop.cs
- ExclusiveTcpTransportManager.cs
- SmtpNtlmAuthenticationModule.cs
- TableItemProviderWrapper.cs
- ObjectSet.cs
- DoubleConverter.cs
- SoapInteropTypes.cs
- FilteredDataSetHelper.cs
- ListViewTableCell.cs
- ConfigurationPermission.cs
- WorkflowInstanceSuspendedRecord.cs
- DefaultBinder.cs
- PropagatorResult.cs
- InputBuffer.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- ViewStateException.cs
- CellLabel.cs
- MatrixTransform3D.cs
- RuleSettings.cs
- MethodBody.cs
- mda.cs
- PersonalizableTypeEntry.cs
- __Filters.cs
- SerializableAttribute.cs
- DefaultPropertyAttribute.cs
- HttpServerVarsCollection.cs
- GenerateScriptTypeAttribute.cs
- TreeNodeStyle.cs
- SynchronizationContext.cs