From: qwert on
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

From: Don Burn on
Where are you setting up a completion routine to signal the event? This
looks like half of a common implementation of a sychronous call to a lower
driver.

--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply




"qwert" <qwert(a)discussions.microsoft.com> wrote in message
news:BA011AD1-01E2-4695-B32D-F046A499286D(a)microsoft.com...
> 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
>


From: qwert on
I used IoSkipCurrentIrpStackLocation.
I thought that I need not provide completion routine.
I wnated to implement synchronous call only.
completion routine gets executed when the kewait.... gets signalled,if I am
right.
but here the signalling itself is not happening.

"Don Burn" wrote:

> Where are you setting up a completion routine to signal the event? This
> looks like half of a common implementation of a sychronous call to a lower
> driver.
>
> --
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
> Remove StopSpam to reply
>
>
>
>
> "qwert" <qwert(a)discussions.microsoft.com> wrote in message
> news:BA011AD1-01E2-4695-B32D-F046A499286D(a)microsoft.com...
> > 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
> >
>
>
>
From: Vetzak on
On May 7, 1:57 pm, qwert <qw...(a)discussions.microsoft.com> wrote:
> I used IoSkipCurrentIrpStackLocation.
> I thought that I need not provide completion routine.
> I wnated to implement synchronous call only.
> completion routine gets executed when the kewait.... gets signalled,if I am
> right.
> but here the signalling itself is not happening.
>
> "Don Burn" wrote:
> > Where are you setting up a completion routine to signal the event? This
> > looks like half of a common implementation of a sychronous call to a lower
> > driver.
>
> > --
> > Don Burn (MVP, Windows DDK)
> > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> > Website:http://www.windrvr.com
> > Blog:http://msmvps.com/blogs/WinDrvr
> > Remove StopSpam to reply
>
> > "qwert" <qw...(a)discussions.microsoft.com> wrote in message
> >news:BA011AD1-01E2-4695-B32D-F046A499286D(a)microsoft.com...
> > > 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

Besides your driver's code, no other code in the universe knows about
the event you're waiting for. You have to implement a completion
routine that sets the event.
From: Maxim S. Shatskih on
I cannot see how Event is associated with the IRP.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim(a)storagecraft.com
http://www.storagecraft.com

"qwert" <qwert(a)discussions.microsoft.com> wrote in message
news:BA011AD1-01E2-4695-B32D-F046A499286D(a)microsoft.com...
> 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
>