mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Implemented IRP_MJ_QUERY_VOLUME_INFORMATION/FileFsDeviceInformation. Msvcrt needs to detect the device type.
svn path=/trunk/; revision=17292
This commit is contained in:
parent
77b9c0a70d
commit
2acde8450d
1 changed files with 137 additions and 114 deletions
|
@ -100,6 +100,35 @@ NullDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
|||
break;
|
||||
}
|
||||
|
||||
case IRP_MJ_QUERY_VOLUME_INFORMATION:
|
||||
switch(piosStack->Parameters.QueryVolume.FsInformationClass)
|
||||
{
|
||||
case FileFsDeviceInformation:
|
||||
{
|
||||
ULONG BufferLength = piosStack->Parameters.QueryVolume.Length;
|
||||
PFILE_FS_DEVICE_INFORMATION FsDeviceInfo = (PFILE_FS_DEVICE_INFORMATION)Irp->AssociatedIrp.SystemBuffer;
|
||||
|
||||
if (BufferLength >= sizeof(FILE_FS_DEVICE_INFORMATION))
|
||||
{
|
||||
FsDeviceInfo->DeviceType = FILE_DEVICE_NULL;
|
||||
FsDeviceInfo->Characteristics = 0; /* FIXME: fix this !! */
|
||||
Irp->IoStatus.Information = sizeof(FILE_FS_DEVICE_INFORMATION);
|
||||
nErrCode = STATUS_SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
Irp->IoStatus.Information = 0;
|
||||
nErrCode = STATUS_BUFFER_OVERFLOW;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
Irp->IoStatus.Information = 0;
|
||||
nErrCode = STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
Irp->IoStatus.Information = 0;
|
||||
nErrCode = STATUS_NOT_IMPLEMENTED;
|
||||
|
@ -135,16 +164,13 @@ DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
|
|||
DriverObject->DriverUnload = NullUnload;
|
||||
|
||||
/* create null device */
|
||||
nErrCode = IoCreateDevice
|
||||
(
|
||||
DriverObject,
|
||||
nErrCode = IoCreateDevice(DriverObject,
|
||||
sizeof(NULL_EXTENSION),
|
||||
&wstrNullDeviceName,
|
||||
FILE_DEVICE_NULL,
|
||||
0,
|
||||
FALSE,
|
||||
&pdoNullDevice
|
||||
);
|
||||
&pdoNullDevice);
|
||||
|
||||
/* failure */
|
||||
if(!NT_SUCCESS(nErrCode))
|
||||
|
@ -155,16 +181,13 @@ DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
|
|||
pdoNullDevice->DeviceExtension = (PVOID)&nxNull;
|
||||
|
||||
/* create zero device */
|
||||
nErrCode = IoCreateDevice
|
||||
(
|
||||
DriverObject,
|
||||
nErrCode = IoCreateDevice(DriverObject,
|
||||
sizeof(NULL_EXTENSION),
|
||||
&wstrZeroDeviceName,
|
||||
FILE_DEVICE_NULL,
|
||||
FILE_READ_ONLY_DEVICE, /* zero device is read-only */
|
||||
FALSE,
|
||||
&pdoZeroDevice
|
||||
);
|
||||
&pdoZeroDevice);
|
||||
|
||||
/* failure */
|
||||
if(!NT_SUCCESS(nErrCode))
|
||||
|
|
Loading…
Reference in a new issue