morlac
February 14th, 2001, 22:50
Hi everyone,
It seems that im asking alot these days.
All asm problems now solved and link correctly. My problem lies in something that i couldnt get from the DDK or the books that i have access to.
Let me explain the problem:
1- I made this filter driver and it attaches itself perfectly and detaches as well.
2- it intercepts all the calls that I want it to.
3- Depending on what I want, I either pass the request along to the next driver on the heirarchy or I do some processing.
4- Sometimes when im processing I need to call the target driver/lower on the stack ( the one am attached to) to do some work for me.
5- passing the requst down directly works fine.
6- Completing the request myself after some processing works fine.
7- The problem is that sometimes when im processing i need to call the attachd driver to do somework for me. And i need it to return to where i called it, not through a completion routine. The target driver does invoke IoCompleteRequest on the IRP. This doesnt work for me and i dont know why as the machine resets before emitting any bugcheck or telling that there was a problem.
8- i did try almost everything that i can think of but no luck.
Im using Driver::Works to do the coding and here is the psoudo code for what im doing.
--------------------------------------------
request is started as ReadFile operation(passes a buffer)
In the filter driver:
1 - get pointer to buffer supplied by the originator of request.(Lock buffer and map it to user space)
2 - decrypt buffer.
3 - if need to call target device(Im attached to it)
UnMap buffer and unlock it.
ValidateStackLocation(CURRENT);
ValidateStackLocation(NEXT);
*IoGetNextIrpStackLocation(m_Irp) =
*IoGetCurrentIrpStackLocation(m_Irp);
call target device(target will invoke IoCompleteRequest())
Lock/Map again.
else
.............
This doesnt work, It causes the machine to reset.
Why does it do that? The problem doesnt occur if i dont call target device. Is the I/O manager deleting the whole IRP? I need the buffer after the changes that should have been done at the target device
Please help if you can understand my problem.
Morlac,
PS - Im willing to show the actuall code that i wrote.
It seems that im asking alot these days.
All asm problems now solved and link correctly. My problem lies in something that i couldnt get from the DDK or the books that i have access to.
Let me explain the problem:
1- I made this filter driver and it attaches itself perfectly and detaches as well.
2- it intercepts all the calls that I want it to.
3- Depending on what I want, I either pass the request along to the next driver on the heirarchy or I do some processing.
4- Sometimes when im processing I need to call the target driver/lower on the stack ( the one am attached to) to do some work for me.
5- passing the requst down directly works fine.
6- Completing the request myself after some processing works fine.
7- The problem is that sometimes when im processing i need to call the attachd driver to do somework for me. And i need it to return to where i called it, not through a completion routine. The target driver does invoke IoCompleteRequest on the IRP. This doesnt work for me and i dont know why as the machine resets before emitting any bugcheck or telling that there was a problem.
8- i did try almost everything that i can think of but no luck.
Im using Driver::Works to do the coding and here is the psoudo code for what im doing.
--------------------------------------------
request is started as ReadFile operation(passes a buffer)
In the filter driver:
1 - get pointer to buffer supplied by the originator of request.(Lock buffer and map it to user space)
2 - decrypt buffer.
3 - if need to call target device(Im attached to it)
UnMap buffer and unlock it.
ValidateStackLocation(CURRENT);
ValidateStackLocation(NEXT);
*IoGetNextIrpStackLocation(m_Irp) =
*IoGetCurrentIrpStackLocation(m_Irp);
call target device(target will invoke IoCompleteRequest())
Lock/Map again.
else
.............
This doesnt work, It causes the machine to reset.
Why does it do that? The problem doesnt occur if i dont call target device. Is the I/O manager deleting the whole IRP? I need the buffer after the changes that should have been done at the target device
Please help if you can understand my problem.
Morlac,
PS - Im willing to show the actuall code that i wrote.