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
- FilteredSchemaElementLookUpTable.cs
- MgmtConfigurationRecord.cs
- ViewManager.cs
- TextBoxRenderer.cs
- HMACMD5.cs
- DeleteMemberBinder.cs
- VideoDrawing.cs
- Stroke.cs
- ShimAsPublicXamlType.cs
- WindowsTab.cs
- HtmlInputHidden.cs
- SchemaCollectionPreprocessor.cs
- TraceData.cs
- DocumentViewerConstants.cs
- VisualCollection.cs
- EntityTransaction.cs
- OdbcHandle.cs
- HttpWriter.cs
- QilExpression.cs
- WmiInstallComponent.cs
- EditorPart.cs
- ProtocolInformationReader.cs
- securitycriticaldataformultiplegetandset.cs
- ProfileEventArgs.cs
- XmlNamespaceMappingCollection.cs
- brushes.cs
- BindingExpressionUncommonField.cs
- GC.cs
- HtmlInputHidden.cs
- FileSystemWatcher.cs
- Collection.cs
- ModifierKeysConverter.cs
- AttributeEmitter.cs
- XmlIlGenerator.cs
- TemplateColumn.cs
- DiagnosticsConfiguration.cs
- AsymmetricAlgorithm.cs
- CompareInfo.cs
- DiscreteKeyFrames.cs
- DataGridViewSortCompareEventArgs.cs
- GridViewEditEventArgs.cs
- ListViewItemSelectionChangedEvent.cs
- DataObjectSettingDataEventArgs.cs
- ScaleTransform3D.cs
- TransformerInfoCollection.cs
- DispatcherObject.cs
- BinaryReader.cs
- DataStorage.cs
- TemplatePartAttribute.cs
- XmlRootAttribute.cs
- StringConcat.cs
- WinFormsComponentEditor.cs
- RSAPKCS1KeyExchangeFormatter.cs
- PostBackOptions.cs
- Policy.cs
- Console.cs
- StaticContext.cs
- FactorySettingsElement.cs
- entityreference_tresulttype.cs
- PrintPreviewGraphics.cs
- KeyConverter.cs
- ComplexLine.cs
- DetailsViewDesigner.cs
- FixedSOMElement.cs
- SimpleBitVector32.cs
- NameSpaceExtractor.cs
- RewritingPass.cs
- ActivityExecutionContext.cs
- EventLogTraceListener.cs
- InternalControlCollection.cs
- FacetDescription.cs
- FileVersion.cs
- DefaultSection.cs
- Viewport2DVisual3D.cs
- AsyncResult.cs
- AssemblyBuilder.cs
- ManagedWndProcTracker.cs
- srgsitem.cs
- BatchServiceHost.cs
- SQLDouble.cs
- UserControlCodeDomTreeGenerator.cs
- PolyBezierSegment.cs
- ComplexBindingPropertiesAttribute.cs
- InvalidOperationException.cs
- XmlSchemaImport.cs
- SoapCodeExporter.cs
- HttpConfigurationContext.cs
- SoapFormatterSinks.cs
- FieldMetadata.cs
- XmlCharType.cs
- CommonProperties.cs
- RemoteHelper.cs
- RadioButtonFlatAdapter.cs
- DropDownButton.cs
- BackgroundWorker.cs
- ValidatorCollection.cs
- XmlnsPrefixAttribute.cs
- XmlSchemaGroup.cs
- exports.cs
- ObjectComplexPropertyMapping.cs