/// <summary> /// Open the attachment /// </summary> /// <param name="objectHandle">A Server object handle.</param> /// <param name="openAttachmentResponse">The RopOpenAttachmentResponse value.</param> /// <param name="attachmentId">The ID of an attachment to be opened.</param> /// <param name="openFlags">The OpenModeFlags value.</param> /// <returns>A Server object handle of the opened attachment.</returns> private uint OpenAttachment(uint objectHandle, out RopOpenAttachmentResponse openAttachmentResponse, uint attachmentId, OpenAttachmentFlags openFlags) { RopOpenAttachmentRequest openAttachmentRequest = new RopOpenAttachmentRequest() { RopId = (byte)RopId.RopOpenAttachment, LogonId = CommonLogonId, // The logonId 0x00 is associated with this operation. InputHandleIndex = CommonInputHandleIndex, // This index specifies the location 0x00 in the Server Object Handle Table where the handle for the input Server Object is stored. OutputHandleIndex = CommonOutputHandleIndex, // This index specifies the location 0x01 in the Server Object Handle Table where the handle for the output Server Object is stored. OpenAttachmentFlags = (byte)openFlags, AttachmentID = attachmentId }; this.ResponseSOHs = this.MSOXCMSGAdapter.DoRopCall(openAttachmentRequest, objectHandle, ref this.response, ref this.rawData, GetPropertiesFlags.None); openAttachmentResponse = (RopOpenAttachmentResponse)this.response; return this.ResponseSOHs[0][openAttachmentResponse.OutputHandleIndex]; }
/// <summary> /// Parse the RopOpenAttachmentRequest structure. /// </summary> /// <param name="s">An stream containing RopOpenAttachmentRequest structure</param> public override void Parse(Stream s) { base.Parse(s); this.RopId = (RopIdType)ReadByte(); this.LogonId = ReadByte(); this.InputHandleIndex = ReadByte(); this.OutputHandleIndex = ReadByte(); this.OpenAttachmentFlags = (OpenAttachmentFlags)ReadByte(); this.AttachmentID = ReadUint(); }