I did the same. But it would crash at IoFreeIrp(Irp). Note that the low
level driver was the serial.sys. I was writing a driver(not a filter
driver) which would issue IRPs for READ and WRITE.
-----Original Message-----
From: Walter Oney [mailto:xxxxx@oneysoft.com]
Sent: Wednesday, October 16, 2002 12:01 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Question about IoBuildDeviceIoControlRequest ;
Please Ignore the first message uncompleted
“Kommuri, Chakradhar” wrote:
Anyway, my point is, when I tried to free the IRP built in
‘Asynchronous’ build, it crashed. So, it is either you cannot free the
IRP or there is something wrong I am doing.
A typical pattern for an asynch IRP would be this:
VOID SomeFunction(…)
{
PIRP Irp = IoAllocateIrp(…);
PIO_STACK_LOCATION stack = IoGetNextIrpStackLocation(Irp);
stack->MajorFunction = …
IoSetCompletionRoutine(Irp, CompletionRoutine, NULL, TRUE, TRUE,
TRUE);
IoCallDriver(…, Irp); // note: no use made of return code, Irp never
touched past this point
}
NTSTATUS CompletionRoutine(PDEVICE_OBJECT junk, PVOID context, PIRP Irp)
{
IoFreeIrp(Irp);
return STATUS_MORE_PROCESSING_REQUIRED;
}
–
Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Now teaming with John Hyde for USB Device Engineering Seminars Check out
our schedule at http://www.oneysoft.com
—
You are currently subscribed to ntdev as: chakradhar.kommuri@hp.com To
unsubscribe send a blank email to %%email.unsub%%