0

I have a driver (kernel mode)(KMDF) and i have a user preferences form. i need to start the activity from the driver code and get the preferences. so how do i start that user mode program from kernel in windows operating system ?

Eswar Yaganti
  • 2,536
  • 1
  • 20
  • 22
  • This looks a bit strange. Why do you need to start preferences form from driver? User-mode program should start by standard way, when user executes it. – Alex F Mar 19 '15 at 09:20
  • @AlexFarber i want to show a pop up in driver entry and get the result back. – Eswar Yaganti Mar 19 '15 at 10:00
  • DriverEntry may be executed at boot time, or before user logon. Anyway, I have never seen such implementation. I think you need to write user-mode program which listens for driver events and shows some UI if necessary. – Alex F Mar 19 '15 at 10:23

2 Answers2

3

The best way to get a driver to do something in user mode is to have it communicate with a user mode component that can do the work. So you do something like have a user mode service, that opens a channel to the driver, then when the driver needs to do something (e.g., launch a process), it can send a message to the service.

Search osronline for the inverted call model for more information, or look at the FltSendMessage API documentation if you're building a mini-filter.

As other posters have noted, doing this in DriverEntry is probably not going to work since there is likely not even a user session to communicate to.

lordjeb
  • 1,286
  • 9
  • 14
1

Simply you can't unless you use weird undocumented tricks like APC, that could cause many many incompatibility problems; just place your application as automatic startup (CurrentVersion\Run for example) and send an IRP to the driver with the data you need to send.