On Wed Jul 3 16:54:42 2024 +0000, Elizabeth Figura wrote:
I don't think that kernelbase is actually doing anything useful by trying to open the file with GENERIC_READ anymore? It certainly isn't helping it retrieve the label or serial. That used to be the case, but it's not anymore; we always depend on having a mountmgr device.
I had a brief look yesterday and there at least regardless of label and serial NtQueryVolumeInformationFile(FileFsAttributeInformation) in GetVolumeInformationByHandleW(). And NtQueryVolumeInformationFile(FileFsAttributeInformation) has fallback handling.
The other thing is, I am not sure if there is any scenario when opening with GENERIC_READ will fail and without GENERIC_READ will succeed? Both should end up in Unix fd open and there is probably no way (device, or any) file can be opened without read access. Maybe that is the fallback path without GENERIC_READ should be removed instead?