The AckRename callback of Windows cfapi blocks when move multiple files at the same time

Nayuta 6 Reputation points
2020-11-10T03:50:45.223+00:00

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

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,575 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,681 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Nayuta 6 Reputation points
    2020-11-12T02:12:33.317+00:00

    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.

    1 person found this answer helpful.

  2. Nayuta 6 Reputation points
    2020-11-10T03:59:16.56+00:00

    Can anyone give me some advices?
    Thanks a lot!

    0 comments No comments

  3. 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:

    38666-image.png
    paste these files in folder B:
    38675-image.png

    Then exploer will block here because the rename callback block.

    Thanks.


  4. 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:

    1. 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.
    2. Thanks @Nayuta 's update and it turns out to be a specific environment related issue.
    3. 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.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.