The file is open for reading and writing, system caching is disabled:
::CreateFile(file_name, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_NO_BUFFERING, NULL); Opened correctly, he was assigned some kind of handle. Something recorded there. The file is not closed, but we know that it will not be guaranteed to change. Is it possible to re-open this file, but only for reading?
FILE_FLAG_OVERLAPPEDis generally from another opera, it doesn’t have anything to do with what you think. The name of this flag is very unfortunate. In addition, WinAPI does not throw exceptions, and if you have an exception somewhere (SEH?), The problem is not in the API call, but in some parameters. - ixSci