Thomas Weidenmueller wrote:
hbirr(a)svn.reactos.com wrote:
The share disposition isn't necessary for
FILE_READ_ATTRIBUTES.
Actually this prevents opening the file during the operation.
Usually, it isn't possible. The share disposition is checked inside the
FSD with IoCheckShareAccess. IoCheckShareAccess can only return an
error, if one of the attributes FILE_READ_DATA, FILE_EXECUTE,
FILE_WRITE_DATA, FILE_APPEND_DATA or DELETE is set and some other
conditions are TRUE. For the single attribute FILE_READ_ATTRIBUTES, the
share disposition has no effect and IoCheckShareAccess does always
return STATUS_SUCCESS.
A better
candidate for GetFileAttributesEx is NtQueryFullAttributesFile
NtQueryFullAttributesFile does also set the share disposition, which isn't necessary.
- Hartmut