mirror of
https://github.com/winfsp/winfsp.git
synced 2025-06-14 15:52:47 -05:00
sys: IRP_MJ_QUERY_VOLUME_INFORMATION: FileFsDeviceInformation: always return FILE_DEVICE_DISK to avoid problem with GetFileType failures
This commit is contained in:
@ -117,7 +117,15 @@ static NTSTATUS FspFsvolQueryFsDeviceInformation(
|
||||
|
||||
PFILE_FS_DEVICE_INFORMATION Info = (PFILE_FS_DEVICE_INFORMATION)*PBuffer;
|
||||
|
||||
Info->DeviceType = FsvolDeviceObject->DeviceType;
|
||||
/*
|
||||
* The following value MUST be FILE_DEVICE_DISK or GetFileType fails,
|
||||
* which has all sorts of interesting consequences (like cmd.exe failing
|
||||
* to redirect to a file when under a network file system).
|
||||
*
|
||||
* See also (which explicitly says to use FILE_DEVICE_DISK for our case):
|
||||
* https://msdn.microsoft.com/en-us/library/cc232109.aspx
|
||||
*/
|
||||
Info->DeviceType = FILE_DEVICE_DISK;
|
||||
Info->Characteristics = FsvolDeviceObject->Characteristics;
|
||||
|
||||
*PBuffer += sizeof(FILE_FS_DEVICE_INFORMATION);
|
||||
|
@ -188,7 +188,8 @@ static NTSTATUS FspVolumeCreateNoLock(
|
||||
|
||||
/* create the volume (and virtual disk) device(s) */
|
||||
Result = FspDeviceCreate(FspFsvolDeviceExtensionKind, 0,
|
||||
FsctlDeviceObject->DeviceType, 0,
|
||||
FsctlDeviceObject->DeviceType,
|
||||
FILE_DEVICE_DISK_FILE_SYSTEM == FsctlDeviceObject->DeviceType ? 0 : FILE_REMOTE_DEVICE,
|
||||
&FsvolDeviceObject);
|
||||
if (!NT_SUCCESS(Result))
|
||||
return Result;
|
||||
|
Reference in New Issue
Block a user