C# Class Microsoft.Protocols.TestSuites.MS_OXCRPC.MS_OXCRPCAdapter

Server role and both role Adapter requirements capture code for MS-OXCRPC.
Inheritance: Microsoft.Protocols.TestTools.ManagedAdapterBase, IMS_OXCRPCAdapter
Show file Open project: OfficeDev/Interop-TestSuites

Public Methods

Method Description
EcDoAsyncConnectEx ( IntPtr pcxh, IntPtr &pacxh ) : uint

The method EcDoAsyncConnectEx binds a Session Context Handle (CXH) returned from method EcDoConnectEx to a new Asynchronous Context Handle (ACXH) that can be used in calls to EcDoAsyncWaitEx in interface AsyncEMSMDB.

EcDoAsyncWaitEx ( IntPtr acxh, bool &isNotificationPending ) : uint

The method EcDoAsyncWaitEx is an asynchronous call that will not be completed by server until there are pending events on the Session Context up to a five minute duration.

EcDoConnectEx ( IntPtr &pcxh, uint sessionContextLink, uint &pulTimeStamp, byte rgbAuxIn, string userDN, uint &pcbAuxOut, ushort rgwClientVersion, ushort &rgwBestVersion, ushort &picxr ) : uint

The EcDoConnectEx method establishes a new Session Context with the server.

EcDoConnectEx ( IntPtr &pcxh, uint sessionContextLink, uint &pulTimeStamp, byte rgbAuxIn, string userDN, uint &pcbAuxOut, ushort rgwClientVersion, ushort &rgwServerVersion, ushort &rgwBestVersion, ushort &picxr, uint flags ) : uint

The EcDoConnectEx method establishes a new Session Context with the server.

EcDoConnectEx ( IntPtr &pcxh, uint sessionContextLink, uint &pulTimeStamp, byte rgbAuxIn, string userDN, uint &pcbAuxOut, ushort rgwClientVersion, ushort &rgwServerVersion, ushort &rgwBestVersion, ushort &picxr, uint flags, List &rgbAuxOutValue ) : uint

The EcDoConnectEx method establishes a new Session Context with the server.

EcDoDisconnect ( IntPtr &pcxh ) : uint

The method EcDoDisconnect closes the Session Context with the server.

EcDoRpcExt2 ( IntPtr &pcxh, PulFlags pulFlags, byte rgbIn, byte &rgbOut, uint &pcbOut, byte rgbAuxIn, uint &pcbAuxOut, IDeserializable &response, List &responseSOHTable, uint &payloadCount, byte &rgbAuxOut ) : uint

The method EcDoRpcExt2 passes generic remote operation (ROP) commands to the server for processing within a Session Context. Each call can contain multiple ROP commands.

EcDoRpcExt2 ( IntPtr &pcxh, PulFlags pulFlags, byte rgbIn, uint &pcbOut, byte rgbAuxIn, uint &pcbAuxOut, IDeserializable &response, List &responseSOHTable ) : uint

The method EcDoRpcExt2 passes generic remote operation (ROP) commands to the server for processing within a Session Context. Each call can contain multiple ROP commands.

EcDummyRpc ( ) : uint

This RPC method determines if it can communicate with the server.

EcRRegisterPushNotification ( IntPtr &pcxh, byte rgbContext, Add_Families addType, string ip, uint &notificationHandle ) : uint

The method EcRRegisterPushNotification registers a callback address with the server for a Session Context.

Initialize ( ITestSite testSite ) : void

Initializes adapter

InitializeRPC ( uint encryptionMethod, uint authnSvc, string userName, string password ) : bool

Initializes the client and server, builds the transport tunnel between client and server.

Private Methods

Method Description
EcDoConnectEx_Internal ( IntPtr &pcxh, string userDN, uint flags, uint connectionModulus, uint limit, uint codePageId, uint localIdString, uint localIdSort, uint sessionContextLink, ushort isCanConvertCodePages, uint &pcmsPollsMax, uint &retryTimes, uint &pcmsRetryDelay, ushort &picxr, UIntPtr &valueOfDNPrefix, UIntPtr &displayName, ushort rgwClientVersion, ushort rgwServerVersion, ushort rgwBestVersion, uint &pulTimeStamp, byte rgbAuxIn, uint inputAuxSize, byte rgbAuxOut, uint &pcbAuxOut ) : uint

The EcDoConnectEx_Internal method establishes a new Session Context with the server.

ExtractExtendedBuffer ( byte response ) : Microsoft.Protocols.TestSuites.Common.ExtendedBuffer[]

Extracts the payloads contained in the response buffer.

ExtractExtendedHeader ( byte payload, RPC_HEADER_EXT &headerExt ) : bool

Extracts RPC_HEADER_EXT structure from rgbAuxOut buffer.

ParseResponseBuffer ( byte rgbOut, RPC_HEADER_EXT &rpcHeaderExts, byte &rops, uint &serverHandleObjectsTables ) : void

The method parses ROP response buffer.

ParseRgbAuxOut ( byte rgbAuxOut ) : List

Parses the rgbAuxOut field for EcDoConnect and EcDoRpcExt2.

RegisterROPDeserializer ( ) : void

Registers ROPs' deserializer.

VerifyCommonRequirements ( IntPtr bindingHandle ) : void

Verify UUID, little-endian byte order and identity of the caller in this Open Specification.

VerifyCompressionAlgorithm ( bool isUseLz77, bool isExOrExt2, bool isAuxOutOrOut, short flag ) : void

Verify Compression Algorithm

VerifyDIRECT2EncodingAlgorithm ( bool isDirect2Encoding ) : void

Verify DIRECT2 Encoding Algorithm

VerifyEcDoAsyncConnectEx ( uint retValue, IntPtr pacxh ) : void

Verify the data returned from server by calling method EcDoAsyncConnectEx.

VerifyEcDoAsyncWaitEx ( IntPtr acxh, uint retValue ) : void

Verify ACXH and result returned by calling method EcDoAsyncWaitEx.

VerifyEcDoAsyncWaitExpulFlagsOut ( uint pulFlagsOut ) : void

Verify EcDoAsyncWaitEx (opnum 0) pulFlagsOut

VerifyEcDoConnectEx ( IntPtr pcxh, string valueOfszDisplayName, ushort rgwClientVersion, ushort rgwServerVersion, ushort rgwBestVersion, ushort picxr, uint pcbAuxOut, uint pulTimeStamp, uint retValue ) : void

Verify the data returned from server by calling method EcDoConnectEx.

VerifyEcDoDisconnect ( int pcxh, uint retValue ) : void

Verify the Session Context Handle returned from server by calling EcDoDisconnect.

VerifyEcDoRpcExt2 ( int valueOfinPcxh, int outPcxh, uint pcbOut, uint pcbAuxOut, uint inputPcbOut, byte rgbOut, uint inputPcbAuxOut, byte rgbAuxOut, uint retValue, uint inputPulFlags, uint outputPulFlags ) : void

Verify the data returned from server by calling method EcDoRpcExt2.

VerifyEcDummyRpc ( uint retValue ) : void

Verify the result value returned from server by calling method EcDummyRpc.

VerifyEcRRegisterPushNotification ( IntPtr pcxh, uint retValue, IntPtr valueOfinPcxh ) : void

Verify EcRRegisterPushNotification (opnum 4)

VerifyIsRgbSupportedOnEcDoRpcExt2 ( uint pcbAuxOut ) : void

Verify whether server returns auxiliary payload data to the client when calling method EcDoRpcExt2

VerifyIsRopResponse ( bool isDeserialized, int ropCount ) : void

Verify whether the payload in rgbOut contains ROP response

VerifyMultiRPCHeader ( int headerCount ) : void

Verify multiple RPC_HEADER_EXTs in the rgbOut buffer

VerifyNcacnHttp ( IntPtr returnedBindingHandle ) : void

Verify the referenced transport "ncacn_http" in this Open Specification.

VerifyNcacnIpTcp ( IntPtr returnedBindingHandle ) : void

Verify the referenced transport "ncacn_ip_tcp" in this protocol.

VerifyObfuscationAlgorithm ( bool isObfuscation, bool isExOrExt2, bool isAuxOutOrOut, short flag ) : void

Verify obfuscation algorithm

VerifyPayloadLengthResponse ( byte payloadArray ) : void

Verify whether the single payload exceeds 32 KB in size

VerifyRPCHeaderExt ( List flagValues, RPC_HEADER_EXT header, bool isExOrExt2, bool isAuxOutOrOut, bool isLast ) : void

Verify the RPC header structure.

VerifyRgbAuxOutOnEcDoRpcExt2 ( List rgbAuxOutValue ) : void

Verify the auxiliary buffer returned by calling the method EcDoRpcExt2

VerifyRgbAuxOutPayLoadOnEcDoConnectEx ( List rgbAuxOutValue ) : void

Verify the auxiliary buffer returned by calling the method EcDoConnectEx

VerifyRopFastTransferSourceGetBufferResponse ( int ropFastCount ) : void

Verify the response payload by sending command RopFastTransferSourceGetBuffer

VerifyRopQueryRowsResponse ( int rowCount, int secRowCount, int ropQueryCount ) : void

Verify the response payload by sending command RopQueryRowsResponse.

VerifyRopReadStreamResponse ( ushort dataSize, ushort secDataSize, int ropReadCount ) : void

Verify the response payload by sending command RopReadStreamResponse.

VerifySessionContext ( IntPtr pcxh, uint retValue ) : void

Verify Session Context after calling method EcDoConnectEx

VerifySimpleDataBig ( ulong bigRangeUlong ) : void

Verify the BIG_RANGE_ULONG simple data structure

VerifySimpleDataSmall ( ulong smallRangeUlong ) : void

Verify the SMALL_RANGE_ULONG simple data structure

Method Details

EcDoAsyncConnectEx() public method

The method EcDoAsyncConnectEx binds a Session Context Handle (CXH) returned from method EcDoConnectEx to a new Asynchronous Context Handle (ACXH) that can be used in calls to EcDoAsyncWaitEx in interface AsyncEMSMDB.
public EcDoAsyncConnectEx ( IntPtr pcxh, IntPtr &pacxh ) : uint
pcxh System.IntPtr A unique value to be used as a CXH.
pacxh System.IntPtr An ACXH that is associated with the Session Context passed in parameter CXH.
return uint

EcDoAsyncWaitEx() public method

The method EcDoAsyncWaitEx is an asynchronous call that will not be completed by server until there are pending events on the Session Context up to a five minute duration.
public EcDoAsyncWaitEx ( IntPtr acxh, bool &isNotificationPending ) : uint
acxh System.IntPtr The unique value to be used as a CXH.
isNotificationPending bool A Boolean value indicates signals that events are pending for the client on the Session Context on the server.
return uint

EcDoConnectEx() public method

The EcDoConnectEx method establishes a new Session Context with the server.
public EcDoConnectEx ( IntPtr &pcxh, uint sessionContextLink, uint &pulTimeStamp, byte rgbAuxIn, string userDN, uint &pcbAuxOut, ushort rgwClientVersion, ushort &rgwBestVersion, ushort &picxr ) : uint
pcxh System.IntPtr A unique value to be used as a CXH.
sessionContextLink uint This value is used to link the Session Context created by this call with an existing Session Context on the server.
pulTimeStamp uint The server has to return a time stamp in which the new Session Context was created.
rgbAuxIn byte The auxiliary payload data.
userDN string The userDN input by client.
pcbAuxOut uint The maximum length of the rgbAuxOut buffer.
rgwClientVersion ushort The client protocol version.
rgwBestVersion ushort The minimum client protocol version that the server supports.
picxr ushort The session index value that is associated with the CXH returned from this call.
return uint

EcDoConnectEx() public method

The EcDoConnectEx method establishes a new Session Context with the server.
public EcDoConnectEx ( IntPtr &pcxh, uint sessionContextLink, uint &pulTimeStamp, byte rgbAuxIn, string userDN, uint &pcbAuxOut, ushort rgwClientVersion, ushort &rgwServerVersion, ushort &rgwBestVersion, ushort &picxr, uint flags ) : uint
pcxh System.IntPtr A unique value to be used as a CXH.
sessionContextLink uint This value is used to link the Session Context created by this call with an existing Session Context on the server.
pulTimeStamp uint The server has to return a time stamp in which the new Session Context was created.
rgbAuxIn byte The auxiliary payload data.
userDN string The userDN input by client.
pcbAuxOut uint The maximum length of the rgbAuxOut buffer.
rgwClientVersion ushort The client protocol version.
rgwServerVersion ushort The server protocol version returned by Exchange Server.
rgwBestVersion ushort The minimum client protocol version that the server supports.
picxr ushort The session index value that is associated with the CXH returned from this call.
flags uint The ulFlags parameter of EcDoConnectEx
return uint

EcDoConnectEx() public method

The EcDoConnectEx method establishes a new Session Context with the server.
public EcDoConnectEx ( IntPtr &pcxh, uint sessionContextLink, uint &pulTimeStamp, byte rgbAuxIn, string userDN, uint &pcbAuxOut, ushort rgwClientVersion, ushort &rgwServerVersion, ushort &rgwBestVersion, ushort &picxr, uint flags, List &rgbAuxOutValue ) : uint
pcxh System.IntPtr A unique value to be used as a CXH.
sessionContextLink uint This value is used to link the Session Context created by this call with an existing Session Context on the server.
pulTimeStamp uint The server has to return a time stamp in which the new Session Context was created.
rgbAuxIn byte The auxiliary payload data.
userDN string The userDN input by client.
pcbAuxOut uint The maximum length of the rgbAuxOut buffer.
rgwClientVersion ushort The client protocol version.
rgwServerVersion ushort The server protocol version returned by Exchange Server.
rgwBestVersion ushort The minimum client protocol version that the server supports.
picxr ushort The session index value that is associated with the CXH returned from this call.
flags uint The ulFlags parameter of EcDoConnectEx
rgbAuxOutValue List The additional data in the auxiliary buffers of the method.
return uint

EcDoDisconnect() public method

The method EcDoDisconnect closes the Session Context with the server.
public EcDoDisconnect ( IntPtr &pcxh ) : uint
pcxh System.IntPtr The unique value points to a CXH.
return uint

EcDoRpcExt2() public method

The method EcDoRpcExt2 passes generic remote operation (ROP) commands to the server for processing within a Session Context. Each call can contain multiple ROP commands.
public EcDoRpcExt2 ( IntPtr &pcxh, PulFlags pulFlags, byte rgbIn, byte &rgbOut, uint &pcbOut, byte rgbAuxIn, uint &pcbAuxOut, IDeserializable &response, List &responseSOHTable, uint &payloadCount, byte &rgbAuxOut ) : uint
pcxh System.IntPtr The unique value to be used as a CXH
pulFlags PulFlags Flags that tell the server how to build the rgbOut parameter.
rgbIn byte This buffer contains the ROP request payload.
rgbOut byte On Output, this parameter contains the response payload.
pcbOut uint On Output, this parameter contains the size of response payload.
rgbAuxIn byte This parameter contains an auxiliary payload buffer.
pcbAuxOut uint On input, this parameter contains the maximum length of the rgbAuxOut buffer. On output, this parameter contains the size of the data to be returned in the rgbAuxOut buffer.
response IDeserializable The ROP response returned in this RPC method and parsed by adapter.
responseSOHTable List The Response SOH Table returned by ROP call, provides information like object handle.
payloadCount uint The count of payload that ROP response contains.
rgbAuxOut byte The data of the output buffer rgbAuxOut.
return uint

EcDoRpcExt2() public method

The method EcDoRpcExt2 passes generic remote operation (ROP) commands to the server for processing within a Session Context. Each call can contain multiple ROP commands.
public EcDoRpcExt2 ( IntPtr &pcxh, PulFlags pulFlags, byte rgbIn, uint &pcbOut, byte rgbAuxIn, uint &pcbAuxOut, IDeserializable &response, List &responseSOHTable ) : uint
pcxh System.IntPtr The unique value points to a CXH.
pulFlags PulFlags Flags that tell the server how to build the rgbOut parameter.
rgbIn byte This buffer contains the ROP request payload.
pcbOut uint On input, this parameter contains the maximum size of the rgbOut buffer. On output, this parameter contains the size of the ROP response payload.
rgbAuxIn byte This parameter contains an auxiliary payload buffer.
pcbAuxOut uint On input, this parameter contains the maximum length of the rgbAuxOut buffer. On output, this parameter contains the size of the data to be returned in the rgbAuxOut buffer.
response IDeserializable The ROP response returned in this RPC method and parsed by adapter.
responseSOHTable List The Response SOH Table returned by ROP call, provides information like object handle.
return uint

EcDummyRpc() public method

This RPC method determines if it can communicate with the server.
public EcDummyRpc ( ) : uint
return uint

EcRRegisterPushNotification() public method

The method EcRRegisterPushNotification registers a callback address with the server for a Session Context.
public EcRRegisterPushNotification ( IntPtr &pcxh, byte rgbContext, Add_Families addType, string ip, uint &notificationHandle ) : uint
pcxh System.IntPtr A unique value to be used as a CXH.
rgbContext byte This parameter contains opaque client-generated context data that is sent back to the client at the callback address.
addType Add_Families The type of the cbCallbackAddress.
ip string The client IP used in this method.
notificationHandle uint If the call completes successfully, this output parameter will contain a handle to the notification callback on the server.
return uint

Initialize() public method

Initializes adapter
public Initialize ( ITestSite testSite ) : void
testSite ITestSite The instance of the ITestSite.
return void

InitializeRPC() public method

Initializes the client and server, builds the transport tunnel between client and server.
public InitializeRPC ( uint encryptionMethod, uint authnSvc, string userName, string password ) : bool
encryptionMethod uint An unsigned integer indicates the authentication level for creating RPC binding
authnSvc uint An unsigned integer indicates authentication services.
userName string Define user name which can be used by client to access SUT.
password string Define user password which can be used by client to access SUT.
return bool