This class is used to deserialize input bytes into an ROP object
Esempio n. 1
0
 /// <summary>
 /// Register other ROPs' deserializer
 /// </summary>
 private void RegisterOtherROPDeserializer()
 {
     #region Other ROPs response register
     RopDeserializer.Register(Convert.ToInt32(RopId.RopBackoff), new RopBackoffResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopBufferTooSmall), new RopBufferTooSmallResponse());
     #endregion
 }
Esempio n. 2
0
 /// <summary>
 /// Register Permission ROPs' deserializer
 /// </summary>
 private void RegisterPermissionROPDeserializer()
 {
     #region Permission ROPs response register
     RopDeserializer.Register(Convert.ToInt32(RopId.RopGetPermissionsTable), new RopGetPermissionsTableResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopModifyPermissions), new RopModifyPermissionsResponse());
     #endregion
 }
Esempio n. 3
0
 /// <summary>
 /// Register Rule ROPs' deserializer
 /// </summary>
 private void RegisterRuleROPDeserializer()
 {
     #region Rule ROPs response register
     RopDeserializer.Register(Convert.ToInt32(RopId.RopGetRulesTable), new RopGetRulesTableResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopModifyRules), new RopModifyRulesResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopUpdateDeferredActionMessages), new RopUpdateDeferredActionMessagesResponse());
     #endregion
 }
Esempio n. 4
0
 /// <summary>
 /// Register Notification ROPs' deserializer
 /// </summary>
 private void RegisterNotificationROPDeserializer()
 {
     #region Notification ROPs response register
     RopDeserializer.Register(Convert.ToInt32(RopId.RopNotify), new RopNotifyResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopPending), new RopPendingResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopRegisterNotification), new RopRegisterNotificationResponse());
     #endregion
 }
Esempio n. 5
0
 /// <summary>
 /// Register Fast Transfer ROPs' deserializer
 /// </summary>
 private void RegisterFastTransferROPDeserializer()
 {
     #region Fast Transfer ROPs response register
     RopDeserializer.Register(Convert.ToInt32(RopId.RopFastTransferDestinationConfigure), new RopFastTransferDestinationConfigureResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopFastTransferDestinationPutBuffer), new RopFastTransferDestinationPutBufferResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopFastTransferSourceCopyFolder), new RopFastTransferSourceCopyFolderResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopFastTransferSourceCopyMessages), new RopFastTransferSourceCopyMessagesResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopFastTransferSourceCopyProperties), new RopFastTransferSourceCopyPropertiesResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopFastTransferSourceCopyTo), new RopFastTransferSourceCopyToResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopFastTransferSourceGetBuffer), new RopFastTransferSourceGetBufferResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopTellVersion), new RopTellVersionResponse());
     #endregion
 }
Esempio n. 6
0
 /// <summary>
 /// Register Transport ROPs' deserializer
 /// </summary>
 private void RegisterTransportROPDeserializer()
 {
     #region Transport ROPs response register
     RopDeserializer.Register(Convert.ToInt32(RopId.RopAbortSubmit), new RopAbortSubmitResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopGetAddressTypes), new RopGetAddressTypesResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopGetTransportFolder), new RopGetTransportFolderResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopOptionsData), new RopOptionsDataResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSetSpooler), new RopSetSpoolerResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSpoolerLockMessage), new RopSpoolerLockMessageResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSubmitMessage), new RopSubmitMessageResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopTransportNewMail), new RopTransportNewMailResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopTransportSend), new RopTransportSendResponse());
     #endregion
 }
Esempio n. 7
0
 /// <summary>
 /// Register Stream ROPs' deserializer
 /// </summary>
 private void RegisterStreamROPDeserializer()
 {
     #region Stream ROPs response register
     RopDeserializer.Register(Convert.ToInt32(RopId.RopCommitStream), new RopCommitStreamResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopCopyToStream), new RopCopyToStreamResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopGetStreamSize), new RopGetStreamSizeResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopLockRegionStream), new RopLockRegionStreamResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopOpenStream), new RopOpenStreamResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopReadStream), new RopReadStreamResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSeekStream), new RopSeekStreamResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSetStreamSize), new RopSetStreamSizeResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopUnlockRegionStream), new RopUnlockRegionStreamResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopWriteStream), new RopWriteStreamResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopCloneStream), new RopCloneStreamResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopWriteAndCommitStream), new RopWriteAndCommitStreamResponse());
     #endregion
 }
Esempio n. 8
0
 /// <summary>
 /// Register Incremental Change Synchronization ROPs' deserializer
 /// </summary>
 private void RegisterIncrementalChangeSynchronizationROPDeserializer()
 {
     #region Incremental Change Synchronization ROPs response register
     RopDeserializer.Register(Convert.ToInt32(RopId.RopGetLocalReplicaIds), new RopGetLocalReplicaIdsResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSetLocalReplicaMidsetDeleted), new RopSetLocalReplicaMidsetDeletedResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSynchronizationConfigure), new RopSynchronizationConfigureResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSynchronizationGetTransferState), new RopSynchronizationGetTransferStateResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSynchronizationImportDeletes), new RopSynchronizationImportDeletesResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSynchronizationImportHierarchyChange), new RopSynchronizationImportHierarchyChangeResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSynchronizationImportMessageChange), new RopSynchronizationImportMessageChangeResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSynchronizationImportMessageMove), new RopSynchronizationImportMessageMoveResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSynchronizationImportReadStateChanges), new RopSynchronizationImportReadStateChangesResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSynchronizationOpenCollector), new RopSynchronizationOpenCollectorResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSynchronizationUploadStateStreamBegin), new RopSynchronizationUploadStateStreamBeginResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSynchronizationUploadStateStreamContinue), new RopSynchronizationUploadStateStreamContinueResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSynchronizationUploadStateStreamEnd), new RopSynchronizationUploadStateStreamEndResponse());
     #endregion
 }
Esempio n. 9
0
 /// <summary>
 /// Register Property ROPs' deserializer
 /// </summary>
 private void RegisterPropertyROPDeserializer()
 {
     #region Property ROPs
     RopDeserializer.Register(Convert.ToInt32(RopId.RopOpenAttachment), new RopOpenAttachmentResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopCopyProperties), new RopCopyPropertiesResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopCopyTo), new RopCopyToResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopDeleteProperties), new RopDeletePropertiesResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopDeletePropertiesNoReplicate), new RopDeletePropertiesNoReplicateResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopGetNamesFromPropertyIds), new RopGetNamesFromPropertyIdsResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopGetPropertiesAll), new RopGetPropertiesAllResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopGetPropertiesList), new RopGetPropertiesListResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopGetPropertiesSpecific), new RopGetPropertiesSpecificResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopGetPropertyIdsFromNames), new RopGetPropertyIdsFromNamesResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopProgress), new RopProgressResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopQueryNamedProperties), new RopQueryNamedPropertiesResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSetProperties), new RopSetPropertiesResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSetPropertiesNoReplicate), new RopSetPropertiesNoReplicateResponse());
     #endregion
 }
Esempio n. 10
0
 /// <summary>
 /// Register Folder ROPs' deserializer
 /// </summary>
 private void RegisterFolderROPDeserializer()
 {
     #region Folder ROPs response register
     RopDeserializer.Register(Convert.ToInt32(RopId.RopCopyFolder), new RopCopyFolderResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopCreateFolder), new RopCreateFolderResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopDeleteFolder), new RopDeleteFolderResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopDeleteMessages), new RopDeleteMessagesResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopEmptyFolder), new RopEmptyFolderResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopGetContentsTable), new RopGetContentsTableResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopGetHierarchyTable), new RopGetHierarchyTableResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopGetSearchCriteria), new RopGetSearchCriteriaResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopHardDeleteMessages), new RopHardDeleteMessagesResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopHardDeleteMessagesAndSubfolders), new RopHardDeleteMessagesAndSubfoldersResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopMoveCopyMessages), new RopMoveCopyMessagesResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopMoveFolder), new RopMoveFolderResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopOpenFolder), new RopOpenFolderResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSetSearchCriteria), new RopSetSearchCriteriaResponse());
     #endregion
 }
Esempio n. 11
0
 /// <summary>
 /// Register Logon ROPs' deserializer
 /// </summary>
 private void RegisterLogonROPDeserializer()
 {
     #region Logon ROPs response register
     RopDeserializer.Register(Convert.ToInt32(RopId.RopGetOwningServers), new RopGetOwningServersResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopGetPerUserGuid), new RopGetPerUserGuidResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopGetPerUserLongTermIds), new RopGetPerUserLongTermIdsResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopGetReceiveFolder), new RopGetReceiveFolderResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopGetReceiveFolderTable), new RopGetReceiveFolderTableResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopGetStoreState), new RopGetStoreStateResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopIdFromLongTermId), new RopIdFromLongTermIdResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopLogon), new RopLogonResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopLongTermIdFromId), new RopLongTermIdFromIdResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopOpenAttachment), new RopOpenAttachmentResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopPublicFolderIsGhosted), new RopPublicFolderIsGhostedResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopReadPerUserInformation), new RopReadPerUserInformationResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSetReceiveFolder), new RopSetReceiveFolderResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopWritePerUserInformation), new RopWritePerUserInformationResponse());
     #endregion
 }
Esempio n. 12
0
        /// <summary>
        /// Register ROPs' deserializer
        /// </summary>
        public void RegisterROPDeserializer()
        {
            RopDeserializer.Init();

            // Logon ROPs response register
            this.RegisterLogonROPDeserializer();

            // Fast Transfer ROPs response register
            this.RegisterFastTransferROPDeserializer();

            // Folder ROPs response register
            this.RegisterFolderROPDeserializer();

            // Incremental Change Synchronization ROPs response register
            this.RegisterIncrementalChangeSynchronizationROPDeserializer();

            // Message ROPs response register
            this.RegisterMessageROPDeserializer();

            // Notification ROPs response register
            this.RegisterNotificationROPDeserializer();

            // Other ROPs response register
            this.RegisterOtherROPDeserializer();

            // Permission ROPs response register
            this.RegisterPermissionROPDeserializer();

            // Property ROPs
            this.RegisterPropertyROPDeserializer();

            // Rule ROPs response register
            this.RegisterRuleROPDeserializer();

            // Stream ROPs response register
            this.RegisterStreamROPDeserializer();

            // Table ROPs response register
            this.RegisterTableROPDeserializer();

            // Transport ROPs response register
            this.RegisterTransportROPDeserializer();
        }
Esempio n. 13
0
 /// <summary>
 /// Register Message ROPs' deserializer
 /// </summary>
 private void RegisterMessageROPDeserializer()
 {
     #region Message ROPs response register
     RopDeserializer.Register(Convert.ToInt32(RopId.RopCreateAttachment), new RopCreateAttachmentResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopCreateMessage), new RopCreateMessageResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopDeleteAttachment), new RopDeleteAttachmentResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopGetAttachmentTable), new RopGetAttachmentTableResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopGetMessageStatus), new RopGetMessageStatusResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopModifyRecipients), new RopModifyRecipientsResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopOpenEmbeddedMessage), new RopOpenEmbeddedMessageResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopOpenMessage), new RopOpenMessageResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopReadRecipients), new RopReadRecipientsResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopReloadCachedInformation), new RopReloadCachedInformationResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopRemoveAllRecipients), new RopRemoveAllRecipientsResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSaveChangesAttachment), new RopSaveChangesAttachmentResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSaveChangesMessage), new RopSaveChangesMessageResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSetMessageReadFlag), new RopSetMessageReadFlagResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSetMessageStatus), new RopSetMessageStatusResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSetReadFlags), new RopSetReadFlagsResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopGetValidAttachments), new RopGetValidAttachmentsResponse());
     #endregion
 }
Esempio n. 14
0
 /// <summary>
 /// Register Table ROPs' deserializer
 /// </summary>
 private void RegisterTableROPDeserializer()
 {
     #region Table ROPs response register
     RopDeserializer.Register(Convert.ToInt32(RopId.RopAbort), new RopAbortResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopCollapseRow), new RopCollapseRowResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopCreateBookmark), new RopCreateBookmarkResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopExpandRow), new RopExpandRowResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopFindRow), new RopFindRowResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopFreeBookmark), new RopFreeBookmarkResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopGetCollapseState), new RopGetCollapseStateResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopGetStatus), new RopGetStatusResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopQueryColumnsAll), new RopQueryColumnsAllResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopQueryPosition), new RopQueryPositionResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopQueryRows), new RopQueryRowsResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopResetTable), new RopResetTableResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopRestrict), new RopRestrictResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSeekRow), new RopSeekRowResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSeekRowBookmark), new RopSeekRowBookmarkResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSeekRowFractional), new RopSeekRowFractionalResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSetCollapseState), new RopSetCollapseStateResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSetColumns), new RopSetColumnsResponse());
     RopDeserializer.Register(Convert.ToInt32(RopId.RopSortTable), new RopSortTableResponse());
     #endregion
 }
Esempio n. 15
0
        /// <summary>
        /// Send ROP request to the server.
        /// </summary>
        /// <param name="requestROPs">ROP request objects.</param>
        /// <param name="requestSOHTable">ROP request server object handle table.</param>
        /// <param name="responseROPs">ROP response objects.</param>
        /// <param name="responseSOHTable">ROP response server object handle table.</param>
        /// <param name="rgbRopOut">The response payload bytes.</param>
        /// <param name="pcbOut">The maximum size of the rgbOut buffer to place Response in.</param>
        /// <param name="mailBoxUserName">Autodiscover find the mailbox according to this username.</param>
        /// <returns>0 indicates success, other values indicate failure. </returns>
        public uint RopCall(
            List <ISerializable> requestROPs,
            List <uint> requestSOHTable,
            ref List <IDeserializable> responseROPs,
            ref List <List <uint> > responseSOHTable,
            ref byte[] rgbRopOut,
            uint pcbOut,
            string mailBoxUserName = null)
        {
            // Log the rop requests
            if (requestROPs != null)
            {
                foreach (ISerializable requestROP in requestROPs)
                {
                    byte[] ropData = requestROP.Serialize();
                    this.site.Log.Add(LogEntryKind.Comment, "Request: {0}", requestROP.GetType().Name);
                    this.site.Log.Add(LogEntryKind.Comment, Common.FormatBinaryDate(ropData));
                }
            }

            // Construct request buffer
            byte[] rgbIn = this.BuildRequestBuffer(requestROPs, requestSOHTable);

            uint ret = 0;

            switch (this.MapiContext.TransportSequence.ToLower())
            {
            case "mapi_http":
                ret = this.mapiHttpAdapter.Execute(rgbIn, pcbOut, out rgbRopOut);
                break;

            case "ncacn_ip_tcp":
            case "ncacn_http":
                ret = this.rpcAdapter.RpcExt2(ref this.cxh, rgbIn, out rgbRopOut, ref pcbOut);
                break;

            default:
                this.site.Assert.Fail("TransportSeq \"{0}\" is not supported by the test suite.");
                break;
            }

            RPC_HEADER_EXT[] rpcHeaderExts;
            byte[][]         rops;
            uint[][]         serverHandleObjectsTables;

            if (ret == OxcRpcErrorCode.ECNone)
            {
                this.ParseResponseBuffer(rgbRopOut, out rpcHeaderExts, out rops, out serverHandleObjectsTables);

                // Deserialize rops
                if (rops != null)
                {
                    foreach (byte[] rop in rops)
                    {
                        List <IDeserializable> ropResponses = new List <IDeserializable>();
                        RopDeserializer.Deserialize(rop, ref ropResponses);
                        foreach (IDeserializable ropResponse in ropResponses)
                        {
                            responseROPs.Add(ropResponse);
                            Type type = ropResponse.GetType();
                            this.site.Log.Add(LogEntryKind.Comment, "Response: {0}", type.Name);
                        }

                        this.site.Log.Add(LogEntryKind.Comment, Common.FormatBinaryDate(rop));
                    }
                }

                // Deserialize serverHandleObjectsTables
                if (serverHandleObjectsTables != null)
                {
                    foreach (uint[] serverHandleObjectsTable in serverHandleObjectsTables)
                    {
                        List <uint> serverHandleObjectList = new List <uint>();
                        foreach (uint serverHandleObject in serverHandleObjectsTable)
                        {
                            serverHandleObjectList.Add(serverHandleObject);
                        }

                        responseSOHTable.Add(serverHandleObjectList);
                    }
                }

                // The return value 0x478 means that the client needs to reconnect server with server name in response
                if (this.MapiContext.AutoRedirect && rops.Length > 0 && rops[0][0] == 0xfe && ((RopLogonResponse)responseROPs[0]).ReturnValue == 0x478)
                {
                    // Reconnect server with returned server name
                    string serverName = Encoding.ASCII.GetString(((RopLogonResponse)responseROPs[0]).ServerName);
                    serverName = serverName.Substring(serverName.LastIndexOf("=") + 1);

                    responseROPs.Clear();
                    responseSOHTable.Clear();

                    bool disconnectReturnValue = this.Disconnect();
                    this.site.Assert.IsTrue(disconnectReturnValue, "Disconnect should be successful here.");

                    string rpcProxyOptions = null;
                    if (string.Compare(this.MapiContext.TransportSequence, "ncacn_http", true) == 0)
                    {
                        rpcProxyOptions = "RpcProxy=" + this.originalServerName + "." + this.domainName;

                        bool connectionReturnValue = this.RpcConnect(serverName, this.userDN, this.domainName, this.userName, this.userPassword, rpcProxyOptions);
                        this.site.Assert.IsTrue(connectionReturnValue, "RpcConnect_Internal should be successful here.");
                    }
                    else if (string.Compare(this.MapiContext.TransportSequence, "mapi_http", true) == 0)
                    {
                        if (mailBoxUserName == null)
                        {
                            mailBoxUserName = Common.GetConfigurationPropertyValue("AdminUserName", this.site);
                            if (mailBoxUserName == null || mailBoxUserName == "")
                            {
                                this.site.Assert.Fail(@"There must be ""AdminUserName"" configure item in the ptfconfig file.");
                            }
                        }

                        string requestURL = Common.GetConfigurationPropertyValue("AutoDiscoverUrlFormat", this.site);
                        requestURL = Regex.Replace(requestURL, @"\[ServerName\]", this.originalServerName, RegexOptions.IgnoreCase);
                        string publicFolderMailbox = Common.GetConfigurationPropertyValue("PublicFolderMailbox", this.site);
                        AutoDiscoverProperties autoDiscoverProperties = AutoDiscover.GetAutoDiscoverProperties(this.site, this.originalServerName, mailBoxUserName, this.domainName, requestURL, this.MapiContext.TransportSequence.ToLower(), publicFolderMailbox);

                        this.privateMailboxServer      = autoDiscoverProperties.PrivateMailboxServer;
                        this.privateMailboxProxyServer = autoDiscoverProperties.PrivateMailboxProxy;
                        this.publicFolderServer        = autoDiscoverProperties.PublicMailboxServer;
                        this.publicFolderProxyServer   = autoDiscoverProperties.PublicMailboxProxy;
                        this.privateMailStoreUrl       = autoDiscoverProperties.PrivateMailStoreUrl;
                        this.publicFolderUrl           = autoDiscoverProperties.PublicMailStoreUrl;

                        bool connectionReturnValue = this.MapiConnect(this.privateMailStoreUrl, this.userDN, this.domainName, this.userName, this.userPassword);
                        this.site.Assert.IsTrue(connectionReturnValue, "RpcConnect_Internal should be successful here.");
                    }

                    ret = this.RopCall(
                        requestROPs,
                        requestSOHTable,
                        ref responseROPs,
                        ref responseSOHTable,
                        ref rgbRopOut,
                        0x10008);
                }
            }

            return(ret);
        }