an issue about ReadDirectoyChangesW

it2022-05-09  39

there are many examples about ReadDirectoyChangesW on Web, but they all have a small bug:

bytesReturned may be zero when ReadDirectoyChangesW()/GetOverlappedResult() return TRUE, in this case,

you will encounter an access violation if read buffer without checking bytesReturned

 

a simple way to reproduce this bug:

   1. host A share a folder, namelly \\hosta\sharefolder

   2. host B map \\hosta\sharefolder to Z:, and start a monitor on Z:

   3. host A rename/delete sharefolder brutely, then ReadDirectoyChangesW()/GetOverlappedResult() will return TRUE with zero bytesReturned

转载于:https://www.cnblogs.com/ellusak/archive/2013/06/09/3129540.html


最新回复(0)