Microsoft.Protocols.TestSuites.MS_OXCPRPT.MS_OXCPRPTAdapter.RopOpenAttachment C# (CSharp) Method

RopOpenAttachment() private method

This ROP opens an attachment of a message.
private RopOpenAttachment ( uint handle, uint attachmentId, RopOpenAttachmentResponse &openAttachmentResponse, bool needVerify ) : uint
handle uint The handle to operate.
attachmentId uint The identifier of the attachment to be opened.
openAttachmentResponse Microsoft.Protocols.TestSuites.Common.RopOpenAttachmentResponse The response of this ROP.
needVerify bool Whether need to verify the response.
return uint
        private uint RopOpenAttachment(uint handle, uint attachmentId, out RopOpenAttachmentResponse openAttachmentResponse, bool needVerify)
        {
            this.rawDataValue = null;
            this.responseValue = null;
            this.responseSOHsValue = null;

            RopOpenAttachmentRequest openAttachmentRequest = new RopOpenAttachmentRequest()
            {
                RopId = (byte)RopId.RopOpenAttachment,
                LogonId = LogonId,
                InputHandleIndex = (byte)HandleIndex.FirstIndex,
                OutputHandleIndex = (byte)HandleIndex.SecondIndex,
                OpenAttachmentFlags = (byte)OpenAttachmentFlags.ReadWrite,
                AttachmentID = attachmentId
            };

            this.responseSOHsValue = this.ProcessSingleRop(openAttachmentRequest, handle, ref this.responseValue, ref this.rawDataValue, RopResponseType.SuccessResponse);
            openAttachmentResponse = (RopOpenAttachmentResponse)this.responseValue;
            if (needVerify)
            {
                this.Site.Assert.AreEqual((uint)RopResponseType.SuccessResponse, openAttachmentResponse.ReturnValue, string.Format("RopOpenAttachment Failed! Error: 0x{0:X8}", openAttachmentResponse.ReturnValue));
            }

            return this.responseSOHsValue[0][openAttachmentResponse.OutputHandleIndex];
        }
MS_OXCPRPTAdapter