Peter Dons Tychsen wrote:
Hi Vitaliy.
Thanks for your comments,
My first question: what will you do with that pointer if that driver is loaded in the separate instance of ntoskrnl? Driver that calls IoGetDeviceObjectPointer will most likely try to dereference the pointer it got back.
You are right. Something is not right here. I will investigate it further. Maybe i need to take a copy of the handle which is suitable for the context.
Well I'm not sure what good will it be? The caller asks for the pointer to the DEVICE_OBJECT to do something with that structure. You can't just give it some handle. It needs to be complete structure. And not just any structure but the one for that device.
But that's where it all starts. When another driver will ask to add itself to the chain of this device what will happen? Wine needs to modify this object, so that means passing it through the server back? What about actually calling this chain?
But Alexandre does it the same way i did it. That is why i did it. Look at this: http://source.winehq.org/git/wine.git/?a=commitdiff;h=05b4181cac1f567f786a0c...
Alexandre is a special case :) He is the maintainer and keeps the tree in the proper state. When you submit patches, they go through his hands. So you need to do what's required for Alexandre to process your patch without making his work any more difficult.
In short - just don't include automatically generated pieces in your patches.
Vitaliy