mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 00:14:11 +09:00
[channels,drive] Prefer using handle from IRP_CREATE when possible
Windows can query information on a file recently renamed using a handle created before the rename
This commit is contained in:
committed by
akallabeth
parent
f450b30aed
commit
f301e2b222
@@ -587,6 +587,11 @@ BOOL drive_file_query_information(DRIVE_FILE* file, UINT32 FsInformationClass, w
|
||||
if (!file || !output)
|
||||
return FALSE;
|
||||
|
||||
if ((file->file_handle != INVALID_HANDLE_VALUE) &&
|
||||
GetFileInformationByHandle(file->file_handle, &fileInformation))
|
||||
return drive_file_query_from_handle_information(file, &fileInformation, FsInformationClass,
|
||||
output);
|
||||
|
||||
hFile = CreateFileW(file->fullpath, 0, FILE_SHARE_DELETE, NULL, OPEN_EXISTING,
|
||||
FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if (hFile != INVALID_HANDLE_VALUE)
|
||||
|
||||
Reference in New Issue
Block a user