IoBuildSynchronousFsdRequest

Hi all,

in my storage upper filter driver I’m filtering read/write requests and
complete Read/Write IRPs in my
read/write dispatch routine as follows:

if (I think I should not allow this read/write)
{
pIrp->IoStatus.Information = 0;
pIrp->IoStatus.Status = STATUS_XY;
IoCompleteRequest(pIrp,IO_NO_INCREMENT)
return STATUS_XY;
}

Another driver writer whose driver is above mine sets up a read request and
complains about a hang.
The code fragment he sent me looks like

KeInitializeEvent(&Event, NotificationEvent, FALSE);
Irp = IoBuildSynchronousFsdRequest
(
irp_mj_read_or_write,
DeviceObject,
ReadBuffer,
readsize,
&ByteOffset,
&Event,
pIoStatusBlock
);
IoCallDriver( DeviceObject, Irp);
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE,0);

He says that normally this works fine, only in case of my cancellation the
result is a hang.

I think he KeWaitsForever, but I’m not using IoBuildSynchronousFsdRequest
anywhere, shouldn’t he only KeWait
if returned STATUS_PENDING is returned ?

Thanks
Else

Yes he should wait only if status pending is returned. This is a chronic
coding error.

=====================
Mark Roddy
Windows .NET/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Else Kluger
Sent: Friday, May 20, 2005 5:57 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] IoBuildSynchronousFsdRequest

Hi all,

in my storage upper filter driver I’m filtering read/write
requests and complete Read/Write IRPs in my read/write
dispatch routine as follows:

if (I think I should not allow this read/write) {
pIrp->IoStatus.Information = 0;
pIrp->IoStatus.Status = STATUS_XY;
IoCompleteRequest(pIrp,IO_NO_INCREMENT)
return STATUS_XY;
}

Another driver writer whose driver is above mine sets up a
read request and complains about a hang.
The code fragment he sent me looks like

KeInitializeEvent(&Event, NotificationEvent, FALSE); Irp =
IoBuildSynchronousFsdRequest (
irp_mj_read_or_write,
DeviceObject,
ReadBuffer,
readsize,
&ByteOffset,
&Event,
pIoStatusBlock
);
IoCallDriver( DeviceObject, Irp);
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE,0);

He says that normally this works fine, only in case of my
cancellation the result is a hang.

I think he KeWaitsForever, but I’m not using
IoBuildSynchronousFsdRequest anywhere, shouldn’t he only
KeWait if returned STATUS_PENDING is returned ?

Thanks
Else


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@hollistech.com To unsubscribe send a blank email to
xxxxx@lists.osr.com

And I wonder if driver verifier catches this?

=====================
Mark Roddy
Windows .NET/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Else Kluger
Sent: Friday, May 20, 2005 5:57 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] IoBuildSynchronousFsdRequest

Hi all,

in my storage upper filter driver I’m filtering read/write
requests and complete Read/Write IRPs in my read/write
dispatch routine as follows:

if (I think I should not allow this read/write) {
pIrp->IoStatus.Information = 0;
pIrp->IoStatus.Status = STATUS_XY;
IoCompleteRequest(pIrp,IO_NO_INCREMENT)
return STATUS_XY;
}

Another driver writer whose driver is above mine sets up a
read request and complains about a hang.
The code fragment he sent me looks like

KeInitializeEvent(&Event, NotificationEvent, FALSE); Irp =
IoBuildSynchronousFsdRequest (
irp_mj_read_or_write,
DeviceObject,
ReadBuffer,
readsize,
&ByteOffset,
&Event,
pIoStatusBlock
);
IoCallDriver( DeviceObject, Irp);
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE,0);

He says that normally this works fine, only in case of my
cancellation the result is a hang.

I think he KeWaitsForever, but I’m not using
IoBuildSynchronousFsdRequest anywhere, shouldn’t he only
KeWait if returned STATUS_PENDING is returned ?

Thanks
Else


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@hollistech.com To unsubscribe send a blank email to
xxxxx@lists.osr.com