C++/Win32: How to wait for a pending delete to complete

前端 未结 13 1086
不思量自难忘°
不思量自难忘° 2020-11-30 03:20

Solved:

  • Workable solution: sbi\'s answer
  • Explanation for what really happens: Hans\'s answer
  • Explanation for why OpenFile do
13条回答
  •  隐瞒了意图╮
    2020-11-30 03:36

    According to [1], you could use NtDeleteFile to avoid the asynchronous nature of DeleteFile. Also [1] gives some details on how DeleteFile works.

    Unfortunately the official documentation on NtDeleteFile [2] doesn't mention any particular details on this issue.

    [1] Undocumented functions of NTDLL

    [2] ZwDeleteFile function

提交回复
热议问题