How can I make IOCTL calls from a driver to another driver (not in the same stack) (on windows)

StackOverflow https://stackoverflow.com/questions/18079610

  •  23-06-2022
  •  | 
  •  

Question

I want to make IOCTL call from a driver to another one which is totally different (not on the same stack)

I have checked on the net, but they only talk about how to send IOCTL to a lower driver, but it's not my case.

p.s : Both drivers are witten by me, so I can create a device object in the second driver, but how can I commmunicate with it (I cannot make DeviceIOControl calls from kernel)

Thanks !

Was it helpful?

Solution

It doesn't differ much from sending IOCTLs from the userland. Just use ZwOpenFile to get a handle to your device and ZwDeviceIoControlFile to send IOCTLs. And don't forget to set OBJ_KERNEL_HANDLE attribute for the handle.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top