Sorry for late reply. Before that, I used a win10 virtual machine to use cfapi, but when I used a physical windows, this problem no longer appeared.So I think the problem should be caused by the virtual machine.
The AckRename callback of Windows cfapi blocks when move multiple files at the same time
hello,
I'm using the cfapi of Windows. Now I registered a rename callback by the flag of CF_CALLBACK_TYPE_NOTIFY_RENAME. The callback is normal when I only rename or move one file, but it will block when I move multi-files. It seems that it blocks when calling the CfExecute function. The rename callback like below:
static void rename_cb(CF_CALLBACK_INFO *info, CF_CALLBACK_PARAMETERS *params)
{
CF_OPERATION_INFO op_info = {0};
CF_OPERATION_PARAMETERS op_params = {0};
op_info.StructSize = sizeof(op_info);
op_info.Type = CF_OPERATION_TYPE_ACK_RENAME;
op_info.ConnectionKey = info->conn_key;
op_info.TransferKey = info->transfer_key;
op_info.RequestKey = info->request_key;
op_params.ParamSize = CF_SIZE_OF_OP_PARAM(AckRename);
op_params.AckRename.CompletionStatus = STATUS_SUCCESS;
CfExecute (&op_info, &op_params)
}
Any advice is greatly appreciated. Thanks
4 answers
Sort by: Most helpful
-
-
Nayuta 6 Reputation points
2020-11-10T03:59:16.56+00:00 Can anyone give me some advices?
Thanks a lot! -
Nayuta 6 Reputation points
2020-11-10T07:41:27.137+00:00 The following snapshots show my steps to reproduce this problem.
select and cut all files in folder A:
paste these files in folder B:
Then exploer will block here because the rename callback block.
Thanks.
-
Rita Han - MSFT 2,161 Reputation points
2020-11-12T07:25:01.057+00:00 Hello @Nayuta ,
Summarize this issue and hope it will help others in the future:
- After following the same steps and doing the same tests on my local machine and a VM, I failed to reproduce this issue because it always works for me.
- Thanks @Nayuta 's update and it turns out to be a specific environment related issue.
- Environment issue may be caused by many factors like changes applied to the system, corrupt system files etc. But if we can narrow down it is an environment related issue, it will be a great help to solve the issue. One suggestion is doing the same test on a new and clean set-up environment, or on multiple machines, to exclude other factors.
Open to any possible cause for this issue and will update here if I can find more.
Thank you!
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.