RE: page fault from synchronous FSD request in Create Com pletion routine

Thanks very much for the reply.

<< Given that this is a page fault, is it possible that maybe you have the
address on which it is faulting? >>

The address is an invalid one, usually something like 000000A4h. All the
other pointer values seem valid. I have included the stripped down code
below.

<< Best of luck - trying to debug problems like this via general descriptions
is (in my experience) a tough thing for this group (or anyone, really) to
accomplish. >>

Understandable. I was just wondering if it struck any familiar note.

The stripped down code is shown below. The file object and device object are
extracted from the appropriate parameters of the Create Completion routine.
The routine below works fine, but then crashes after a number of iterations,
usually at the time of a process change.

Again, many thanks.

Neil

NTSTATUS ReadFile( PDEVICE_OBJECT DeviceObject,
PFILE_OBJECT FileObject,
PUCHAR Buffer,
ULONG Length,
PLARGE_INTEGER Offset )
{
NTSTATUS ntStatus = STATUS_INSUFFICIENT_RESOURCES;
PIRP irp;
KEVENT event;
IO_STATUS_BLOCK ioStatus;
PIO_STACK_LOCATION irpSp;
KeInitializeEvent(&event, NotificationEvent, FALSE);
irp = IoBuildSynchronousFsdRequest (
IRP_MJ_READ, DeviceObject, Buffer, Length, Offset, &event,
&ioStatus );
);
if (irp != NULL)
{
irpSp = IoGetNextIrpStackLocation(irp);
irpSp->FileObject = FileObject;
if ((ntStatus = IoCallDriver(DeviceObject, irp)) == STATUS_PENDING)
{
KeWaitForSingleObject(&event, Suspended, KernelMode, FALSE, NULL);
ntStatus = ioStatus.Status;
}
}
return (ntStatus);
}

> The address is an invalid one, usually something like 000000A4h. All the

Maybe you mixed handles and pointers?

Max