Why is the callback given to ReadFileEx() not receiving the correct OVERLAPPED structure?

后端 未结 2 1285
北海茫月
北海茫月 2021-01-24 15:08

For some reason, my callback isn\'t receiving the address of the correct OVERLAPPED structure after a call to ReadFileEx. What can cause this?

2条回答
  •  灰色年华
    2021-01-24 15:48

    Also, it's also quite possible that ownership of the original OVL struct was not relinquished when the callback was set up, and so overwritten between the setup and the callback.

    Or even possible that an inexperienced developer might allocate it on the stack of the thread setting it up - not a good move :)

提交回复
热议问题