Hi V.
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.
Sorry. I did not mean the handle, but the device pointer.
I have done some more research on this function. The implementation i made was totally off track!
IoGetDeviceObjectPointer is allot like calling NtOpenFile(), except it does not return the handle. Instead it return a file-pointer, which is of type FILE_OBJECT. A list of these would probably have to be kept for each process, with some kind of map to the handle. We will also need it when implementing ObReferenceObjectByHandle().
Apart from that i am not totally sure how to get the process-dependent device pointer. Maybe it should be copied... needs more investigation.
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.
Roger.
I guess my patch was a bit premature... not to mention totally nuts!
/pedro