title: Executing a user-mode executable from kernel-mode
body: <p>I'm building a HW-simulator for our driver team. Now, the simulator is devided in to 2 modules:
  First module runs inside the driver, in kernel mode and  that's where the main interface between the driver and the HW-Simulator.
  Second module is an executable user-mode code which generates data for the simulator and transports it to the simulator via calls to <code>DeviceIOControl</code> (under windows API)</p>
  
  <p>My need is this: I want to be able to execute the user-mode executable from within the kernel-mode. And I need to be able to do this in a relatively portable way. Currently I'm only running on Windows, but that should change soon.
  Further more, I need to be able to communicate with the user-mode code via it's<code>stdin</code> pipe, in order to reconfigure it and eventually close it.</p>
  
  <p>I found this:
  <a href="https://stackoverflow.com/questions/5246636/executing-a-user-space-function-from-the-kernel-space">Executing a user-space function from the kernel space</a></p>
  
  <p>but it's only relevant for the linux-kernel. Is there a more portable alternative? Or a windows alternative?</p>
  
  <p>Can I do this in Windows by simply using the ShellExecute/RunAs API functions?</p>
  
  <p>Note: We are aware of the security risks involved in invoking user-mode code from the kernel-space. But as this is only meant to be used as a test-environment and will not ever reach our release code, then we are not concerned.</p>