/// <summary> /// Initializes a FastTransfer operation for uploading content encoded in a client-provided FastTransfer stream into a mailbox /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="sourceHandleIndex">A fast transfer stream object handle index.</param> /// <param name="option">Defines the parameters of a download operation.</param> /// <param name="copyFlag">Defines parameters of the FastTransfer download operation.</param> /// <param name="configHandleIndex">Configure handle's index.</param> /// <returns>Indicate the result of this ROP operation.</returns> public RopResult FastTransferDestinationConfigure(int serverId, int sourceHandleIndex, SourceOperation option, FastTransferDestinationConfigureCopyFlags copyFlag, out int configHandleIndex) { // Initialize ROP data. RopResult result = RopResult.InvalidParameter; RopFastTransferDestinationConfigureRequest fastTransferDestinationConfigureRequest; uint fastTransferDestinationConfigureHandle = this.handleContainer[sourceHandleIndex]; configHandleIndex = -1; // Construct ROP request. fastTransferDestinationConfigureRequest.RopId = 0x53; fastTransferDestinationConfigureRequest.LogonId = 0x00; fastTransferDestinationConfigureRequest.InputHandleIndex = 0x00; fastTransferDestinationConfigureRequest.OutputHandleIndex = 0x01; fastTransferDestinationConfigureRequest.SourceOperation = (byte)option; fastTransferDestinationConfigureRequest.CopyFlags = (byte)copyFlag; // Send request and get response. RopFastTransferDestinationConfigureResponse fastTransferDestinationConfigureResponse = (RopFastTransferDestinationConfigureResponse)this.Process(serverId, fastTransferDestinationConfigureRequest, fastTransferDestinationConfigureHandle); result = (RopResult)fastTransferDestinationConfigureResponse.ReturnValue; if (result == RopResult.Success) { configHandleIndex = AdapterHelper.GetHandleIndex(); this.handleContainer.Add(configHandleIndex, this.responseSOHs[fastTransferDestinationConfigureResponse.OutputHandleIndex]); // Verify ROP FastTransferDestinationConfigure this.VerifyRopFastTransferDestinationConfigure(fastTransferDestinationConfigureResponse); } return result; }
public static RopResult FastTransferDestinationConfigure(int serverId, int objHandleIndex, SourceOperation option, FastTransferDestinationConfigureCopyFlags copyFlag, out int uploadContextHandleIndex) { // The construction conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); // Initialize return value. RopResult result = RopResult.InvalidParameter; if (requirementContainer.ContainsKey(3492001)) { if ((copyFlag == FastTransferDestinationConfigureCopyFlags.Invalid) && requirementContainer[3492001] == true) { // FastTransferDestinationConfigureCopyFlags is invalid parameter and exchange server version is not ExchangeServer2007 . uploadContextHandleIndex = -1; ModelHelper.CaptureRequirement( 3492001, @"[In Appendix A: Product Behavior] If unknown flags in the CopyFlags field are set, implementation does fail the operation. <36> Section 3.2.5.8.2.1: Exchange 2010, Exchange 2013 and Exchange 2016 fail the ROP [RopFastTransferDestinationConfigure ROP] if unknown bit flags in the CopyFlags field are set."); return result; } } if (option == SourceOperation.CopyProperties || option == SourceOperation.CopyTo || option == SourceOperation.CopyFolder || option == SourceOperation.CopyMessages) { priorOperation = MS_OXCFXICS.PriorOperation.RopFastTransferDestinationConfigure; } sourOperation = option; // Create a new Upload context. AbstractUploadInfo uploadInfo = new AbstractUploadInfo(); // Set value for upload context. uploadContextHandleIndex = AdapterHelper.GetHandleIndex(); uploadInfo.UploadHandleIndex = uploadContextHandleIndex; ConnectionData changeConnection = connections[serverId]; connections.Remove(serverId); // Add the new Upload context to UploadContextContainer. changeConnection.UploadContextContainer = changeConnection.UploadContextContainer.Add(uploadInfo); connections.Add(serverId, changeConnection); result = RopResult.Success; ModelHelper.CaptureRequirement( 581, @"[In RopFastTransferDestinationConfigure ROP] The RopFastTransferDestinationConfigure ROP ([MS-OXCROPS] section 2.2.12.1) initializes a FastTransfer operation for uploading content encoded in a client-provided FastTransfer stream into a mailbox."); if (requirementContainer.ContainsKey(3492002)) { if ((copyFlag == FastTransferDestinationConfigureCopyFlags.Invalid) && requirementContainer[3492002] == true) { // Exchange 2007 ignore unknown values of the CopyFlags field. ModelHelper.CaptureRequirement( 3492002, @"[In Appendix A: Product Behavior] If unknown flags in the CopyFlags field are set, implementation does not fail the operation. <37> Section 3.2.5.8.2.1: Exchange 2007 ignore unknown values of the CopyFlags field."); return result; } } return result; }