please check the below code.
I open the device from the application using "\\\\.\\%c:" as the input
parameter to createfile.
called deviceiocontrol with IOCTL_DISK_GET_DRIVE_LAYOUT ioctl
I received this IOCTL in my lower file system filter driver
below is the code,
if ((pReceivedIrpStack->MajorFunction == IRP_MJ_DEVICE_CONTROL) &&
(pReceivedIrpStack->Parameters.DeviceIoControl.IoControlCode ==
IOCTL_DISK_GET_DRIVE_LAYOUT))
{
KeInitializeEvent(&Event, NotificationEvent,FALSE);
IoSkipCurrentIrpStackLocation(pReceivedIrp);
status = IoCallDriver(pFilterDeviceExtension->pPartitionDeviceObject,
pReceivedIrp);
if (status == STATUS_PENDING)
{
status = KeWaitForSingleObject(&Event,
Suspended,
KernelMode,
FALSE,
NULL);
status = pReceivedIrp->IoStatus.Status;
}
if(!NT_SUCCESS(status))
{
debug statement
}
pReceivedIrp->IoStatus.Status = status;
return(status);
}
problem : The status of IoCallDriver is status_pending and the
KeWaitForSingleObject never returns.I am not sure why it doesnt return.
can anybody help me.
Thanks in advance