hbirr@svn.reactos.com wrote:
The share disposition isn't necessary for FILE_READ_ATTRIBUTES.
Actually this prevents opening the file during the operation. A better candidate for GetFileAttributesEx is NtQueryFullAttributesFile which accepts a OBJECT_ATTRIBUTES structure instead of a handle, so there's no need to even open the file at all.
Best Regards,
Thomas
Thomas Weidenmueller wrote:
hbirr@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