Implemented IRP_MJ_QUERY_VOLUME_INFORMATION/FileFsDeviceInformation. Msvcrt needs to detect the device type.

svn path=/trunk/; revision=17292
This commit is contained in:
Hartmut Birr 2005-08-11 19:07:11 +00:00
parent 77b9c0a70d
commit 2acde8450d

View file

@ -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))