Skip to content

Commit

Permalink
emsmdb: use attachment_object::set_properties when props are set via …
Browse files Browse the repository at this point in the history
…fastupctx

When an attachment is copied from and to the same message using
MFCMAPI, it issues MAPI calls like so:

	// CAttachmentsDlg::HandlePaste()
	srcmsg->OpenAttach(..., &srcatt);
	dstmsg->CreateAttach(..., &dstatt);
	srcatt->CopyTo(..., dstatt, ...);
	dstatt->SaveChanges(...);
	dstmsg->SaveChanges(...);

and EMSMDB.DLL's IAttach::CopyTo issues this set of ROPs:

	ropOpenAttachment
	ropCreateAttachment
	ropFastTransferDestinationConfigure
	ropFastTransferSourceCopyTo
	ropFastTransferSourceGetBuffer
	ropFastTransferDestinationPutBuffer
	ropSaveChangesAttachment
	ropSaveChangesMessage

rop_fasttransferdestputbuffer fails to mark the attachment as
modified (b_touched), and the attachment is not saved.

Fixes: gromox-0~666
  • Loading branch information
jengelh committed Nov 25, 2021
1 parent fe0f7b6 commit 52092e6
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions exch/emsmdb/fastupctx_object.cpp
Expand Up @@ -873,11 +873,14 @@ static gxerr_t fastupctx_object_record_propval(fastupctx_object *pctx,
static_cast<message_object *>(pctx->pobject)->get_instance_id(),
ppropval, &b_result) == TRUE ?
GXERR_SUCCESS : GXERR_CALL_FAILED;
case ROOT_ELEMENT_ATTACHMENTCONTENT:
return exmdb_client_set_instance_property(pctx->pstream->plogon->get_dir(),
static_cast<attachment_object *>(pctx->pobject)->get_instance_id(),
ppropval, &b_result) == TRUE ?
GXERR_SUCCESS : GXERR_CALL_FAILED;
case ROOT_ELEMENT_ATTACHMENTCONTENT: {
auto atx = static_cast<attachment_object *>(pctx->pobject);
TPROPVAL_ARRAY av;
av.count = 1;
av.ppropval = deconst(ppropval);
PROBLEM_ARRAY pa;
return atx->set_properties(&av, &pa) == TRUE ? GXERR_SUCCESS : GXERR_CALL_FAILED;
}
case ROOT_ELEMENT_MESSAGELIST:
case ROOT_ELEMENT_TOPFOLDER:
return GXERR_CALL_FAILED;
Expand Down

0 comments on commit 52092e6

Please sign in to comment.