Re: Question about IoBuildDeviceIoControlRequest ; Please Ignore the first message uncompleted

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%%

and what was the crash?

-----Original Message-----
From: Kommuri, Chakradhar [mailto:Chakradhar.Kommuri@hp.com]
Sent: Wednesday, October 16, 2002 10:01 AM
To: NT Developers Interest List
Subject: [ntdev] Re: Question about IoBuildDeviceIoControlRequest ;
Please Ignore the first message uncompleted

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%%


You are currently subscribed to ntdev as: xxxxx@microsoft.com To
unsubscribe send a blank email to %%email.unsub%%

It was BAD_POOL_CALLER. If I remove the IoFreeIrp, it works just fine.

-----Original Message-----
From: Peter Wieland [mailto:xxxxx@windows.microsoft.com]
Sent: Wednesday, October 16, 2002 12:45 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Question about IoBuildDeviceIoControlRequest ;
Please Ignore the first message uncompleted

and what was the crash?

-----Original Message-----
From: Kommuri, Chakradhar [mailto:Chakradhar.Kommuri@hp.com]
Sent: Wednesday, October 16, 2002 10:01 AM
To: NT Developers Interest List
Subject: [ntdev] Re: Question about IoBuildDeviceIoControlRequest ;
Please Ignore the first message uncompleted

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%%


You are currently subscribed to ntdev as: xxxxx@microsoft.com To
unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntdev as: chakradhar.kommuri@hp.com To
unsubscribe send a blank email to %%email.unsub%%