Reputation: 29
There are multiple flags and attributes (dwFlagsAndAttributes
) that can be used while a file is opened with CreateFile()
call. One of such flags is FILE_FLAG_SEQUENTIAL_SCAN
. I am wondering, is it possible to somehow detect/guess whether a file handle has been created using this flag if the only thing you have is the handle itself and no information about its CreateFile
parameters is available?
Upvotes: 1
Views: 361
Reputation: 51489
You can call NtQueryInformationFile
(or ZwQueryInformationFile from kernel mode) to retrieve a FILE_OBJECT structure. Its Flags member provides the information you are looking for.
Upvotes: 3