Hi,
You shouldn’t set up:
localIrp->Tail.Overlay.OriginalFileObject = current->FileObject;
also where are you setting up the FileObject in the IRP’s “next” stack
location???
-Thanks
-Anu
-----Original Message-----
From: A.Ilamparithi [mailto:xxxxx@msn.com]
Sent: Saturday, July 31, 2004 3:23 AM
To: Windows File Systems Devs Interest List
Subject: Spam:Re:[ntfsd] Problem in calling the
IoBuildAsynchronousFsdRequest.
hi,
Thankz for your answer.We tried not to use the IRPs after
IoCallDriver. But result is the same.
Thanks in Advance,
Ilamparithi.
“Alexei Jelvis” wrote in message
news:xxxxx@ntfsd…
You can’t touch IRP after invoking IoCallDriver - IRP may already be
deleted
by IoFreeIrp in your completion routine.
Alexei.
-----Original Message-----
From: A.Ilamparithi [mailto:xxxxx@msn.com]
Sent: Saturday, July 31, 2004 1:32 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Problem in calling the IoBuildAsynchronousFsdRequest.
Hi,
I am trying to use the IoBuildAsynchronousFsdRequest funtion
inside my
IRP_MJ_READ dispatcher function. When i call the IoCallDriver , i am
getting
BSOD. Can anybody help me out ? i have attached the source code here
with.
------------------------------------------------------------------------
----
—
{
StartingOffset.HighPart = StartingOffset.LowPart = 0;
m_WriteBuffer = ExAllocatePool( NonPagedPool, BUFFER_SIZE );
// Build asynchronous Irp request
localIrp = IoBuildAsynchronousFsdRequest(
IRP_MJ_READ,
deviceExtension->FileSystemDeviceObject,
m_WriteBuffer,
512,
&StartingOffset,
&ioStatusBlock);
if (!localIrp)
{
return STATUS_UNSUCCESSFUL;
}
// Set completion routine to validate finishing request.
KeInitializeEvent(&event,NotificationEvent,FALSE);
localIrp->UserEvent = &event;
localIrp->Tail.Overlay.OriginalFileObject = current->FileObject;
localIrp->RequestorMode = KernelMode;
IoSetCompletionRoutine(
localIrp,
MyComplete,
0,
TRUE,
TRUE,
TRUE);
status = IoCallDriver(deviceExtension->FileSystemDeviceObject,
localIrp);
// Set Irp stack frame to the next loweer one.
localIrp->CurrentLocation–;
localIrp->Tail.Overlay.CurrentStackLocation
= IoGetNextIrpStackLocation(localIrp);
if (status == STATUS_PENDING)
{
KeWaitForSingleObject(&event,
Executive,
KernelMode,
FALSE,
NULL);
}
}
TSTATUS
MyComplete(
PDEVICE_OBJECT DeviceObject,
PIRP Irp,
PVOID Context
)
{
//
*Irp->UserIosb = Irp->IoStatus;
if( !NT_SUCCESS(Irp->IoStatus.Status) ) {
DbgPrint(" ERROR ON IRP: %x\n", Irp->IoStatus.Status );
}
//
// Set the user event - wakes up the mainline code doing this.
//
KeSetEvent(Irp->UserEvent, 0, FALSE);
//
// Free the IRP now that we are done with it.
DbgPrint(“IMP : Inside Completion routine \n”);
//
IoFreeIrp(Irp);
return STATUS_MORE_PROCESSING_REQUIRED;
}
---------------------------------------------------------------------
Thankx in Advance,
Ilamparithi.
—
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: xxxxx@vmware.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
—
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: xxxxx@greenborder.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
This electronic transmission (and any attached documents) is for the sole use of the individual or entity to whom it is addressed. It is confidential and may be privileged. Any further distribution or copying of this message is strictly prohibited. If you received this message in error, please notify GreenBorder immediately by telephone at (650) 625.0601 and destroy the message (and all attached documents), immediately.