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
- DbFunctionCommandTree.cs
- ReflectTypeDescriptionProvider.cs
- ParallelTimeline.cs
- ExponentialEase.cs
- InboundActivityHelper.cs
- SystemTcpStatistics.cs
- RtfNavigator.cs
- TargetConverter.cs
- SystemIPv6InterfaceProperties.cs
- AnchoredBlock.cs
- EncryptedData.cs
- PostBackTrigger.cs
- MapPathBasedVirtualPathProvider.cs
- NavigationProperty.cs
- OdbcConnectionStringbuilder.cs
- PackagingUtilities.cs
- UIElement3D.cs
- Compensate.cs
- rsa.cs
- NameValueConfigurationCollection.cs
- ConfigurationLocation.cs
- VisualBrush.cs
- SurrogateSelector.cs
- DeviceSpecificChoice.cs
- XhtmlBasicLiteralTextAdapter.cs
- InputMethodStateChangeEventArgs.cs
- AddressAccessDeniedException.cs
- ViewSimplifier.cs
- PropertyRecord.cs
- GatewayIPAddressInformationCollection.cs
- RootAction.cs
- AuditLevel.cs
- HotCommands.cs
- CalendarItem.cs
- FlowLayoutSettings.cs
- Memoizer.cs
- HandleCollector.cs
- GPStream.cs
- SamlConstants.cs
- Inline.cs
- DomainConstraint.cs
- FieldAccessException.cs
- SynchronizedDispatch.cs
- LookupNode.cs
- VectorConverter.cs
- CaseKeyBox.xaml.cs
- FtpRequestCacheValidator.cs
- WindowCollection.cs
- RichTextBox.cs
- PopOutPanel.cs
- WSFederationHttpSecurityMode.cs
- LiteralDesigner.cs
- ContextProperty.cs
- Deflater.cs
- SpeakProgressEventArgs.cs
- AnnotationMap.cs
- XmlQueryContext.cs
- PresentationAppDomainManager.cs
- ISO2022Encoding.cs
- TypeInitializationException.cs
- DefaultSection.cs
- SqlRowUpdatingEvent.cs
- TableNameAttribute.cs
- DynamicHyperLink.cs
- ConsumerConnectionPoint.cs
- ArithmeticException.cs
- FormattedText.cs
- SqlCachedBuffer.cs
- MachineKeyValidationConverter.cs
- SqlBuffer.cs
- XmlArrayAttribute.cs
- _SslStream.cs
- FileLogRecordHeader.cs
- LockCookie.cs
- Int16Converter.cs
- JsonWriter.cs
- EntityDataSourceValidationException.cs
- SoapServerMethod.cs
- MessageBox.cs
- ListViewTableRow.cs
- Native.cs
- HttpHandlerAction.cs
- PageEventArgs.cs
- ContractTypeNameElement.cs
- SerializationInfo.cs
- ImageSource.cs
- IntSecurity.cs
- ProgressBarHighlightConverter.cs
- SiteMapProvider.cs
- TimeSpan.cs
- HwndHost.cs
- CompilerGlobalScopeAttribute.cs
- TableParagraph.cs
- Package.cs
- RuntimeWrappedException.cs
- RadioButtonAutomationPeer.cs
- ExceptionNotification.cs
- DefaultValueAttribute.cs
- SHA1CryptoServiceProvider.cs
- ActivityDesigner.cs