Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: configure.ac
- ===================================================================
- --- configure.ac (revision 3217)
- +++ configure.ac (working copy)
- @@ -11,7 +11,7 @@
- if test -z "$CFLAGS";
- then
- - CFLAGS="-O2 -g";
- + CFLAGS="-g";
- fi
- CFLAGS="-I. $CFLAGS"
- Index: mapiproxy/servers/default/emsmdb/oxcfold.c
- ===================================================================
- --- mapiproxy/servers/default/emsmdb/oxcfold.c (revision 3217)
- +++ mapiproxy/servers/default/emsmdb/oxcfold.c (working copy)
- @@ -961,3 +961,69 @@
- return MAPI_E_SUCCESS;
- }
- +
- +/**
- +
- + */
- +_PUBLIC_ enum MAPISTATUS EcDoRpc_RopMoveCopyMessages(TALLOC_CTX *mem_ctx,
- + struct emsmdbp_context *emsmdbp_ctx,
- + struct EcDoRpc_MAPI_REQ *mapi_req,
- + struct EcDoRpc_MAPI_REPL *mapi_repl,
- + uint32_t *handles, uint16_t *size)
- +{
- + enum MAPISTATUS retval;
- + uint32_t handle;
- + uint32_t contextID;
- + struct mapi_handles *rec = NULL;
- + void *private_data = NULL;
- + struct emsmdbp_object *object;
- + uint64_t mid;
- + uint32_t i;
- +
- + DEBUG(4, ("exchange_emsmdb: [OXCFOLD] RopMoveCopyMessages (0x33)\n"));
- +
- + /* Sanity checks */
- + OPENCHANGE_RETVAL_IF(!emsmdbp_ctx, MAPI_E_NOT_INITIALIZED, NULL);
- + OPENCHANGE_RETVAL_IF(!mapi_req, MAPI_E_INVALID_PARAMETER, NULL);
- + OPENCHANGE_RETVAL_IF(!mapi_repl, MAPI_E_INVALID_PARAMETER, NULL);
- + OPENCHANGE_RETVAL_IF(!handles, MAPI_E_INVALID_PARAMETER, NULL);
- + OPENCHANGE_RETVAL_IF(!size, MAPI_E_INVALID_PARAMETER, NULL);
- +
- + mapi_repl->opnum = mapi_req->opnum;
- + mapi_repl->error_code = MAPI_E_SUCCESS;
- + mapi_repl->handle_idx = mapi_req->handle_idx;
- +
- + mapi_repl->u.mapi_MoveCopyMessages.PartialCompletion = 0;
- +
- + /* Get the destionation information */
- + handle = handles[mapi_req->u.mapi_MoveCopyMessages.handle_idx];
- + retval = mapi_handles_search(emsmdbp_ctx->handles_ctx, handle, &rec);
- + if (retval) {
- + mapi_repl->error_code = MAPI_E_INVALID_OBJECT;
- + DEBUG(5, (" handle (%x) not found: %x\n", handle, mapi_req->handle_idx));
- + goto end;
- + }
- +
- + retval = mapi_handles_get_private_data(rec, &private_data);
- + object = private_data;
- + if (!object) {
- + mapi_repl->error_code = MAPI_E_INVALID_OBJECT;
- + DEBUG(5, (" object (%x) not found: %x\n", handle, mapi_req->handle_idx));
- + goto end;
- + }
- +
- + contextID = emsmdbp_get_contextID(object);
- +
- + for (i = 0; i < mapi_req->u.mapi_MoveCopyMessages.count; i++)
- + {
- + mid = mapi_req->u.mapi_MoveCopyMessages.message_id[i];
- +
- + /* We move the message */
- + mapistore_folder_move_copy_message(emsmdbp_ctx->mstore_ctx, contextID, object->backend_object, mid);
- + }
- +
- + end:
- + *size += libmapiserver_RopMoveCopyMessages_size(mapi_repl);
- +
- + return MAPI_E_SUCCESS;
- +}
- Index: mapiproxy/servers/default/emsmdb/dcesrv_exchange_emsmdb.c
- ===================================================================
- --- mapiproxy/servers/default/emsmdb/dcesrv_exchange_emsmdb.c (revision 3217)
- +++ mapiproxy/servers/default/emsmdb/dcesrv_exchange_emsmdb.c (working copy)
- @@ -884,7 +884,12 @@
- &(mapi_response->mapi_repl[idx]),
- mapi_response->handles, &size);
- break;
- - /* op_MAPI_MoveCopyMessages: 0x33 */
- + case op_MAPI_MoveCopyMessages: /* 0x33 */
- + retval = EcDoRpc_RopMoveCopyMessages(mem_ctx, emsmdbp_ctx,
- + &(mapi_request->mapi_req[i]),
- + &(mapi_response->mapi_repl[idx]),
- + mapi_response->handles, &size);
- + break;
- /* op_MAPI_AbortSubmit: 0x34 */
- /* op_MAPI_MoveFolder: 0x35 */
- /* op_MAPI_CopyFolder: 0x36 */
- Index: mapiproxy/servers/default/emsmdb/oxcprpt.c
- ===================================================================
- --- mapiproxy/servers/default/emsmdb/oxcprpt.c (revision 3217)
- +++ mapiproxy/servers/default/emsmdb/oxcprpt.c (working copy)
- @@ -1226,8 +1226,16 @@
- struct EcDoRpc_MAPI_REPL *mapi_repl,
- uint32_t *handles, uint16_t *size)
- {
- - DEBUG(4, ("exchange_emsmdb: [OXCPRPT] CopyTo (0x39) -- stub\n"));
- + enum MAPISTATUS retval;
- + uint32_t handle;
- + uint32_t contextID;
- + struct mapi_handles *rec = NULL;
- + void *private_data = NULL;
- + struct emsmdbp_object *a_object;
- + struct emsmdbp_object *b_object;
- + DEBUG(4, ("exchange_emsmdb: [OXCPRPT] CopyTo (0x39)\n"));
- +
- /* Sanity checks */
- OPENCHANGE_RETVAL_IF(!emsmdbp_ctx, MAPI_E_NOT_INITIALIZED, NULL);
- OPENCHANGE_RETVAL_IF(!mapi_req, MAPI_E_INVALID_PARAMETER, NULL);
- @@ -1242,6 +1250,53 @@
- mapi_repl->u.mapi_CopyTo.PropertyProblemCount = 0;
- mapi_repl->u.mapi_CopyTo.PropertyProblem = NULL;
- + /* Get the destination information */
- + handle = handles[mapi_req->handle_idx];
- + retval = mapi_handles_search(emsmdbp_ctx->handles_ctx, handle, &rec);
- + if (retval) {
- + mapi_repl->error_code = MAPI_E_INVALID_OBJECT;
- + DEBUG(5, (" handle (%x) not found: %x\n", handle, mapi_req->handle_idx));
- + goto end;
- + }
- +
- + retval = mapi_handles_get_private_data(rec, &private_data);
- + a_object = private_data;
- + if (!a_object) {
- + mapi_repl->error_code = MAPI_E_INVALID_OBJECT;
- + DEBUG(5, (" object (%x) not found: %x\n", handle, mapi_req->handle_idx));
- + goto end;
- + }
- +
- + /* Get the source information - this is the information we get from the CreateMessage */
- + handle = handles[mapi_req->u.mapi_CopyTo.handle_idx];
- + retval = mapi_handles_search(emsmdbp_ctx->handles_ctx, handle, &rec);
- + if (retval) {
- + mapi_repl->error_code = MAPI_E_INVALID_OBJECT;
- + DEBUG(5, (" handle (%x) not found: %x\n", handle, mapi_req->handle_idx));
- + goto end;
- + }
- +
- + retval = mapi_handles_get_private_data(rec, &private_data);
- + b_object = private_data;
- + if (!b_object) {
- + mapi_repl->error_code = MAPI_E_INVALID_OBJECT;
- + DEBUG(5, (" object (%x) not found: %x\n", handle, mapi_req->handle_idx));
- + goto end;
- + }
- +
- + /*
- + a_object->backend_object is the 'source object' - the message to be copied
- + b_object->backend_objectD is the 'destination folder'
- + b_object->object.message->messageID is the destination MID - the MID generated during the CreateMessage call
- + */
- + contextID = emsmdbp_get_contextID(a_object);
- +
- + mapistore_properties_copy_to(emsmdbp_ctx->mstore_ctx, contextID, a_object->backend_object, b_object->backend_object, b_object->object.message->messageID);
- +
- + /* The backend might do this for us. In any case, we try to add it ourselves */
- + mapistore_indexing_record_add_mid(emsmdbp_ctx->mstore_ctx, contextID, b_object->object.message->messageID);
- +
- + end:
- *size += libmapiserver_RopCopyTo_size(mapi_repl);
- return MAPI_E_SUCCESS;
- Index: mapiproxy/servers/default/emsmdb/dcesrv_exchange_emsmdb.h
- ===================================================================
- --- mapiproxy/servers/default/emsmdb/dcesrv_exchange_emsmdb.h (revision 3217)
- +++ mapiproxy/servers/default/emsmdb/dcesrv_exchange_emsmdb.h (working copy)
- @@ -325,7 +325,9 @@
- enum MAPISTATUS EcDoRpc_RopSetSearchCriteria(TALLOC_CTX *, struct emsmdbp_context *, struct EcDoRpc_MAPI_REQ *, struct EcDoRpc_MAPI_REPL *, uint32_t *, uint16_t *);
- enum MAPISTATUS EcDoRpc_RopGetSearchCriteria(TALLOC_CTX *, struct emsmdbp_context *, struct EcDoRpc_MAPI_REQ *, struct EcDoRpc_MAPI_REPL *, uint32_t *, uint16_t *);
- enum MAPISTATUS EcDoRpc_RopEmptyFolder(TALLOC_CTX *, struct emsmdbp_context *, struct EcDoRpc_MAPI_REQ *, struct EcDoRpc_MAPI_REPL *, uint32_t *, uint16_t *);
- +enum MAPISTATUS EcDoRpc_RopMoveCopyMessages(TALLOC_CTX *, struct emsmdbp_context *, struct EcDoRpc_MAPI_REQ *, struct EcDoRpc_MAPI_REPL *, uint32_t *, uint16_t *);
- +
- /* definitions from oxcmsg.c */
- enum MAPISTATUS EcDoRpc_RopOpenMessage(TALLOC_CTX *, struct emsmdbp_context *, struct EcDoRpc_MAPI_REQ *, struct EcDoRpc_MAPI_REPL *, uint32_t *, uint16_t *);
- enum MAPISTATUS EcDoRpc_RopCreateMessage(TALLOC_CTX *, struct emsmdbp_context *, struct EcDoRpc_MAPI_REQ *, struct EcDoRpc_MAPI_REPL *, uint32_t *, uint16_t *);
- Index: mapiproxy/servers/default/emsmdb/oxcfxics.c
- ===================================================================
- --- mapiproxy/servers/default/emsmdb/oxcfxics.c (revision 3217)
- +++ mapiproxy/servers/default/emsmdb/oxcfxics.c (working copy)
- @@ -33,14 +33,74 @@
- #define oc_version_time 0x4dbb2dbe
- /** notes:
- +
- + * Structures (taken from OXCFXICS) :
- +
- + - CN structure: A CN structure contains a change number that identifies a version of a messaging object. CNs are identical in format to FID structures
- + ([MS-OXCDATA] section 2.2.1.1) and MID structures ([MS- OXCDATA] section 2.2.1.2), except the GlobalCounter field represents a change
- + to a messaging object rather than a messaging object itself.
- +
- + - XID structure: An XID structure contains an external identifier for an entity within a store.
- +
- + - PredecessorChangeList structure: The PredecessorChangeList structure contains a set of XID structures, as specified in section 2.2.2.2, that identify
- + change numbers of messaging objects in different replicas (1). The order of the XIDs does not have significance for
- + interpretation, but is significant for serialization and deserialization.
- +
- +
- + * Properties (taken from OXCFXICS) :
- +
- + - PR_CHANGE_KEY / PidTagChangeKey: The PidTagChangeKey property ([MS-OXPROPS] section 2.690) contains a serialized XID structure,
- + as specified in section 2.2.2.2, that identifies the last change to the messaging object.
- +
- + VERY IMPORTANT NOTE FOR SYNCHRONIZATION IN ORDER TO AVOID SIMPLE CONFLICTS:
- +
- + If the last change to the messaging object was imported from the client by using the RopSynchronizationImportMessageChange
- + ROP (section 2.2.3.2.4.2), the value of the PidTagChangeKey property that is saved to the store by the server contains the
- + value for the PidTagChangeKey property that was passed in the PropertyValues field of the RopSynchronizationImportMessageChange
- + ROP request buffer.
- +
- + If the last change to a messaging object was made by the server, the value of the PidTagChangeKey property that is saved to the
- + store by the server contains an XID generated from the PidTagChangeNumber property (section 2.2.1.2.3). For more details about
- + generating XIDs based on internal identifiers (2), see section 3.1.5.1.
- +
- + - PR_PREDECESSOR_CHANGE_LIST / PidTagPredecessorChangeList: The PidTagPredecessorChangeList property ([MS-OXPROPS] section 2.922) contains PredecessorChangeList
- + structures, as specified in section 2.2.2.3. The PidTagPredecessorChangeList property contains all the XID
- + structures, as specified in section 2.2.2.2, from all replicas (1) that have been integrated into the
- + current version of the messaging object. This property is used in conflict detection by all protocol roles.
- +
- + - {Meta,Pid}TagIdsetGiven: The MetaTagIdsetGiven property contains a serialization of REPLGUID-based IDSET structures, as specified in section 2.2.2.4.2. The IDSETs contain
- + FID structures ([MS-OXCDATA] section 2.2.1.1) for hierarchy synchronization operations, or MID structures for content synchronization operations,
- + that exist in the local replica of the client. The IDSETs MUST NOT include any IDs that are not in the local replica of the client.
- +
- + - {Meta,Pid}TagCnsetSeen: The MetaTagCnsetSeen property contains a serialization of REPLGUID-based CNSET structures, as specified in section 2.2.2.4. The CN structures, as
- + specified in section 2.2.2.1, in the CNSET track changes to folders (for hierarchy synchronization operations) or normal messages (for content synchronization
- + operations) in the current synchronization scope that have been previously communicated to a client, and are reflected in its local replica.
- +
- + - {Meta,Pid}TagCnsetSeenFAI: The MetaTagCnsetSeenFAI property contains a serialization of REPLGUID-based IDSET structures, as specified in section 2.2.2.4. The semantics of
- + this property are identical to the MetaTagCnsetSeen property (section 2.2.1.1.2), except that this property contains IDs for folder associated information
- + (FAI) messages and is therefore only used in content synchronization operations.
- +
- + - {Meta,Pid}TagCnsetRead: The MetaTagCnsetRead property contains a serialization of REPLGUID-based CNSET structures, as specified in section 2.2.2.4. The CN structures, as specified
- + in section 2.2.2.1, in the CNSET track changes to the read state for messages in the current synchronization scope that have been previously communicated to
- + the client and are reflected in its local replica. This property does not track whether messages have been read, it only tracks changes to the read state of a
- + message. For more details about tracking read state changes, see section 3.2.5.6.
- +
- +
- +
- * conventions:
- - binary data must be returned as Binary_r
- - PR_CHANGE_NUM is computed
- - - PR_CHANGE_KEY, PR_SOURCE_KEY, PR_PARENT_SOURCE_KEY are deduced automatically from PR_CHANGE_NUM, PR_MID/PR_FID and PR_PARENT_FID
- + - PR_CHANGE_KEY (PidTagChangeKey), PR_SOURCE_KEY, PR_PARENT_SOURCE_KEY are deduced automatically from PR_CHANGE_NUM, PR_MID/PR_FID and PR_PARENT_FID
- * PR_*KEY should be computed in the same manner in oxcprpt and oxctabl
- - - PR_PREDECESSOR_CHANGE_LIST is only a copy or PR_CHANGE_KEY for now
- + - PR_PREDECESSOR_CHANGE_LIST (PidTagPredecessorChangeList) is only a copy or PR_CHANGE_KEY for now
- - all string properties are fetched via their _UNICODE version
- +
- - "PR_LAST_MODIFICATION_TIME" is left to the backend, maybe setprops operations could provide an optional one, for reference...
- + Note that the doc (OXCFXICS) says:
- +
- + "Using this mechanism prevents the client from controlling certain internal properties, such as the PidTagLastModificationTime property ([MS-OXPROPS] section 2.825), as this property is controlled by the server. This is different than full item upload, which accepts the client's value of this property."
- +
- +
- ? idea: getprops on tables and objects without property array = get all props
- * no deletions yet
- * no conflict resolution
- @@ -638,13 +698,13 @@
- /* The "cnset_seen" range is going to be merged later with the one from synccontext since the ids are not sorted */
- RAWIDSET_push_guid_glob(sync_data->cnset_seen, &sync_data->replica_guid, cn);
- - /* change key */
- + /* PidTagChangeKey / change key */
- bin_data = oxcfxics_make_gid(header_data_pointers, &sync_data->replica_guid, cn);
- query_props.aulPropTag[j] = PR_CHANGE_KEY;
- header_data_pointers[j] = bin_data;
- j++;
- - /* predecessor... (already computed) */
- + /* PidTagPredecessorChangeList / predecessor... (already computed) */
- predecessors_data.cb = bin_data->cb + 1;
- predecessors_data.lpb = talloc_array(header_data_pointers, uint8_t, predecessors_data.cb);
- *predecessors_data.lpb = bin_data->cb & 0xff;
- @@ -784,9 +844,9 @@
- oxcfxics_push_messageChange(mem_ctx, emsmdbp_ctx, synccontext, sync_data, synccontext_object->parent_object);
- new_idset = RAWIDSET_convert_to_idset(NULL, sync_data->cnset_seen);
- old_idset = synccontext->cnset_seen;
- - /* IDSET_dump (synccontext->cnset_seen, "initial cnset_seen"); */
- + IDSET_dump (synccontext->cnset_seen, "initial cnset_seen");
- synccontext->cnset_seen = IDSET_merge_idsets(synccontext, old_idset, new_idset);
- - /* IDSET_dump (synccontext->cnset_seen, "merged cnset_seen"); */
- + IDSET_dump (synccontext->cnset_seen, "merged cnset_seen");
- talloc_free(old_idset);
- talloc_free(new_idset);
- talloc_free(sync_data->cnset_seen);
- @@ -799,9 +859,9 @@
- oxcfxics_push_messageChange(mem_ctx, emsmdbp_ctx, synccontext, sync_data, synccontext_object->parent_object);
- new_idset = RAWIDSET_convert_to_idset(NULL, sync_data->cnset_seen);
- old_idset = synccontext->cnset_seen_fai;
- - /* IDSET_dump (synccontext->cnset_seen, "initial cnset_seen_fai"); */
- + IDSET_dump (synccontext->cnset_seen, "initial cnset_seen_fai");
- synccontext->cnset_seen_fai = IDSET_merge_idsets(synccontext, old_idset, new_idset);
- - /* IDSET_dump (synccontext->cnset_seen, "merged cnset_seen_fai"); */
- + IDSET_dump (synccontext->cnset_seen, "merged cnset_seen_fai");
- talloc_free(old_idset);
- talloc_free(new_idset);
- talloc_free(sync_data->cnset_seen);
- @@ -820,7 +880,7 @@
- ndr_push_uint32(sync_data->cutmarks_ndr, NDR_SCALARS, sync_data->ndr->offset);
- ndr_push_idset(sync_data->ndr, new_idset);
- ndr_push_uint32(sync_data->cutmarks_ndr, NDR_SCALARS, sync_data->ndr->offset);
- - /* IDSET_dump (new_idset, "cnset_deleted"); */
- + IDSET_dump (new_idset, "cnset_deleted");
- talloc_free(new_idset);
- }
- @@ -830,9 +890,9 @@
- new_idset = RAWIDSET_convert_to_idset(NULL, sync_data->eid_set);
- old_idset = synccontext->idset_given;
- - /* IDSET_dump (synccontext->idset_given, "initial idset_given"); */
- + IDSET_dump (synccontext->idset_given, "initial idset_given");
- synccontext->idset_given = IDSET_merge_idsets(synccontext, old_idset, new_idset);
- - /* IDSET_dump (synccontext->idset_given, "merged idset_given"); */
- + IDSET_dump (synccontext->idset_given, "merged idset_given");
- talloc_free(old_idset);
- talloc_free(new_idset);
- @@ -1091,9 +1151,9 @@
- new_idset = RAWIDSET_convert_to_idset(NULL, sync_data->cnset_seen);
- old_idset = synccontext->cnset_seen;
- - /* IDSET_dump (synccontext->cnset_seen, "initial cnset_seen (folder change)"); */
- + IDSET_dump (synccontext->cnset_seen, "initial cnset_seen (folder change)");
- synccontext->cnset_seen = IDSET_merge_idsets(synccontext, old_idset, new_idset);
- - /* IDSET_dump (synccontext->cnset_seen, "merged cnset_seen (folder change)"); */
- + IDSET_dump (synccontext->cnset_seen, "merged cnset_seen (folder change)");
- talloc_free(old_idset);
- talloc_free(new_idset);
- @@ -1104,9 +1164,9 @@
- new_idset = RAWIDSET_convert_to_idset(NULL, sync_data->eid_set);
- old_idset = synccontext->idset_given;
- - /* IDSET_dump (synccontext->idset_given, "initial idset_given (folder change)"); */
- + IDSET_dump (synccontext->idset_given, "initial idset_given (folder change)");
- synccontext->idset_given = IDSET_merge_idsets(synccontext, old_idset, new_idset);
- - /* IDSET_dump (synccontext->idset_given, "merged idset_given (folder change)"); */
- + IDSET_dump (synccontext->idset_given, "merged idset_given (folder change)");
- talloc_free(old_idset);
- talloc_free(new_idset);
- Index: mapiproxy/libmapistore/mapistore_private.h
- ===================================================================
- --- mapiproxy/libmapistore/mapistore_private.h (revision 3217)
- +++ mapiproxy/libmapistore/mapistore_private.h (working copy)
- @@ -165,6 +165,7 @@
- int mapistore_backend_folder_open_message(struct backend_context *, void *, TALLOC_CTX *, uint64_t, void **, struct mapistore_message **);
- int mapistore_backend_folder_create_message(struct backend_context *, void *, TALLOC_CTX *, uint64_t, uint8_t, void **);
- int mapistore_backend_folder_delete_message(struct backend_context *, void *, uint64_t, uint8_t);
- +int mapistore_backend_folder_move_copy_message(struct backend_context *, void *, uint64_t);
- int mapistore_backend_folder_get_deleted_fmids(struct backend_context *, void *, TALLOC_CTX *, uint8_t, uint64_t, struct I8Array_r **, uint64_t *);
- int mapistore_backend_folder_get_child_count(struct backend_context *, void *, uint8_t, uint32_t *);
- int mapistore_backend_folder_get_child_fid_by_name(struct backend_context *, void *, const char *, uint64_t *);
- @@ -189,6 +190,7 @@
- int mapistore_backend_properties_get_available_properties(struct backend_context *, void *, TALLOC_CTX *, struct SPropTagArray **);
- int mapistore_backend_properties_get_properties(struct backend_context *, void *, TALLOC_CTX *, uint16_t, enum MAPITAGS *, struct mapistore_property_data *);
- int mapistore_backend_properties_set_properties(struct backend_context *, void *, struct SRow *);
- +int mapistore_backend_properties_copy_to(struct backend_context *, void *, void *, uint64_t);
- /* definitions from mapistore_tdb_wrap.c */
- struct tdb_wrap *tdb_wrap_open(TALLOC_CTX *, const char *, int, int, int, mode_t);
- Index: mapiproxy/libmapistore/mapistore_interface.c
- ===================================================================
- --- mapiproxy/libmapistore/mapistore_interface.c (revision 3217)
- +++ mapiproxy/libmapistore/mapistore_interface.c (working copy)
- @@ -567,6 +567,29 @@
- }
- /**
- +
- + */
- +_PUBLIC_ int mapistore_folder_move_copy_message(struct mapistore_context *mstore_ctx, uint32_t context_id,
- + void *folder, uint64_t mid)
- +{
- + struct backend_context *backend_ctx;
- + int ret;
- +
- + /* Sanity checks */
- + MAPISTORE_SANITY_CHECKS(mstore_ctx, NULL);
- +
- + /* Step 1. Search the context */
- + backend_ctx = mapistore_backend_lookup(mstore_ctx->context_list, context_id);
- + MAPISTORE_RETVAL_IF(!backend_ctx, MAPISTORE_ERR_INVALID_PARAMETER, NULL);
- +
- + /* Step 2. Call backend operation */
- + ret = mapistore_backend_folder_move_copy_message(backend_ctx, folder, mid);
- +
- + return !ret ? MAPISTORE_SUCCESS : MAPISTORE_ERROR;
- +}
- +
- +
- +/**
- \details Get the array of deleted items following a specific change number
- \param mstore_ctx pointer to the mapistore context
- @@ -1098,3 +1121,25 @@
- return !ret ? MAPISTORE_SUCCESS : MAPISTORE_ERROR;
- }
- +
- +_PUBLIC_ int mapistore_properties_copy_to(struct mapistore_context
- + *mstore_ctx, uint32_t context_id,
- + void *object,
- + void *destination,
- + uint64_t mid)
- +{
- + struct backend_context *backend_ctx;
- + int ret;
- +
- + /* Sanity checks */
- + MAPISTORE_SANITY_CHECKS(mstore_ctx, NULL);
- +
- + /* Step 1. Search the context */
- + backend_ctx = mapistore_backend_lookup(mstore_ctx->context_list, context_id);
- + MAPISTORE_RETVAL_IF(!backend_ctx, MAPISTORE_ERR_INVALID_PARAMETER, NULL);
- +
- + /* Step 2. Call backend operation */
- + ret = mapistore_backend_properties_copy_to(backend_ctx, object, destination, mid);
- +
- + return !ret ? MAPISTORE_SUCCESS : MAPISTORE_ERROR;
- +}
- Index: mapiproxy/libmapistore/mapistore.h
- ===================================================================
- --- mapiproxy/libmapistore/mapistore.h (revision 3217)
- +++ mapiproxy/libmapistore/mapistore.h (working copy)
- @@ -126,6 +126,7 @@
- int (*open_message)(void *, TALLOC_CTX *, uint64_t, void **, struct mapistore_message **);
- int (*create_message)(void *, TALLOC_CTX *, uint64_t, uint8_t, void **);
- int (*delete_message)(void *, uint64_t, uint8_t flags);
- + int (*move_copy_message)(void *, uint64_t);
- int (*get_deleted_fmids)(void *, TALLOC_CTX *, uint8_t, uint64_t, struct I8Array_r **, uint64_t *);
- int (*get_child_count)(void *, uint8_t, uint32_t *);
- @@ -162,6 +163,7 @@
- int (*get_available_properties)(void *, TALLOC_CTX *, struct SPropTagArray **);
- int (*get_properties)(void *, TALLOC_CTX *, uint16_t, enum MAPITAGS *, struct mapistore_property_data *);
- int (*set_properties)(void *, struct SRow *);
- + int (*copy_to)(void *, void *, uint64_t);
- } properties;
- };
- @@ -228,6 +230,7 @@
- int mapistore_folder_open_message(struct mapistore_context *, uint32_t, void *, TALLOC_CTX *, uint64_t, void **, struct mapistore_message **);
- int mapistore_folder_create_message(struct mapistore_context *, uint32_t, void *, TALLOC_CTX *, uint64_t, uint8_t, void **);
- int mapistore_folder_delete_message(struct mapistore_context *, uint32_t, void *, uint64_t, uint8_t);
- +int mapistore_folder_move_copy_message(struct mapistore_context *, uint32_t, void *, uint64_t);
- int mapistore_folder_get_deleted_fmids(struct mapistore_context *, uint32_t, void *, TALLOC_CTX *, uint8_t, uint64_t, struct I8Array_r **, uint64_t *);
- int mapistore_folder_get_folder_count(struct mapistore_context *, uint32_t, void *, uint32_t *);
- int mapistore_folder_get_message_count(struct mapistore_context *, uint32_t, void *, uint8_t, uint32_t *);
- @@ -254,7 +257,9 @@
- int mapistore_properties_get_available_properties(struct mapistore_context *, uint32_t, void *, TALLOC_CTX *, struct SPropTagArray **);
- int mapistore_properties_get_properties(struct mapistore_context *, uint32_t, void *, TALLOC_CTX *, uint16_t, enum MAPITAGS *, struct mapistore_property_data *);
- int mapistore_properties_set_properties(struct mapistore_context *, uint32_t, void *, struct SRow *);
- +int mapistore_properties_copy_to(struct mapistore_context *, uint32_t, void *, void *, uint64_t);
- +
- /* definitions from mapistore_processing.c */
- int mapistore_set_mapping_path(const char *);
- Index: mapiproxy/libmapistore/mapistore_backend.c
- ===================================================================
- --- mapiproxy/libmapistore/mapistore_backend.c (revision 3217)
- +++ mapiproxy/libmapistore/mapistore_backend.c (working copy)
- @@ -450,6 +450,11 @@
- return bctx->backend->folder.delete_message(folder, mid, flags);
- }
- +int mapistore_backend_folder_move_copy_message(struct backend_context *bctx, void *folder, uint64_t mid)
- +{
- + return bctx->backend->folder.move_copy_message(folder, mid);
- +}
- +
- int mapistore_backend_folder_get_deleted_fmids(struct backend_context *bctx, void *folder, TALLOC_CTX *mem_ctx, uint8_t table_type, uint64_t change_num, struct I8Array_r **fmidsp, uint64_t *cnp)
- {
- return bctx->backend->folder.get_deleted_fmids(folder, mem_ctx, table_type, change_num, fmidsp, cnp);
- @@ -602,3 +607,8 @@
- {
- return bctx->backend->properties.set_properties(object, aRow);
- }
- +
- +int mapistore_backend_properties_copy_to(struct backend_context *bctx, void *object, void *destination, uint64_t mid)
- +{
- + return bctx->backend->properties.copy_to(object, destination, mid);
- +}
- Index: mapiproxy/libmapiserver/libmapiserver_oxcfold.c
- ===================================================================
- --- mapiproxy/libmapiserver/libmapiserver_oxcfold.c (revision 3217)
- +++ mapiproxy/libmapiserver/libmapiserver_oxcfold.c (working copy)
- @@ -225,3 +225,23 @@
- size += SIZE_DFLT_ROPEMPTYFOLDER;
- return size;
- }
- +
- +/**
- + \details Calculate MoveCopyMessages rop size
- +
- + \param response pointer to the MoveCopyMessags EcDoRpc_MAPI_REPL
- + structure
- +
- + \return Size of MoveCopyMessages response
- + */
- +_PUBLIC_ uint16_t libmapiserver_RopMoveCopyMessages_size(struct EcDoRpc_MAPI_REPL *response)
- +{
- + uint16_t size = SIZE_DFLT_MAPI_RESPONSE;
- +
- + if (!response || response->error_code) {
- + return size;
- + }
- +
- + size += SIZE_DFLT_ROPMOVECOPYMESSAGES;
- + return size;
- +}
- Index: mapiproxy/libmapiserver/libmapiserver.h
- ===================================================================
- --- mapiproxy/libmapiserver/libmapiserver.h (revision 3217)
- +++ mapiproxy/libmapiserver/libmapiserver.h (working copy)
- @@ -308,6 +308,13 @@
- #define SIZE_DFLT_ROPEMPTYFOLDER 1
- /**
- + \details MoveCopyMessages Rop has fixed response size for:
- + -#: PartialCompletion: uint8_t
- +
- +*/
- +#define SIZE_DFLT_ROPMOVECOPYMESSAGES 1
- +
- +/**
- \details DeleteMessage Rop has fixed response size for:
- -# PartialCompletion: uint8_t
- */
- @@ -460,7 +467,9 @@
- uint16_t libmapiserver_RopSetSearchCriteria_size(struct EcDoRpc_MAPI_REPL *);
- uint16_t libmapiserver_RopGetSearchCriteria_size(struct EcDoRpc_MAPI_REPL *);
- uint16_t libmapiserver_RopEmptyFolder_size(struct EcDoRpc_MAPI_REPL *);
- +uint16_t libmapiserver_RopMoveCopyMessages_size(struct EcDoRpc_MAPI_REPL *);
- +
- /* definitions from libmapiserver_oxcmsg.c */
- uint16_t libmapiserver_OpenRecipientRow_size(struct OpenRecipientRow *);
- uint16_t libmapiserver_RopOpenMessage_size(struct EcDoRpc_MAPI_REPL *);
Add Comment
Please, Sign In to add comment