0

CreateProcess has bInheritHandles parameter that allows inheritable handles to be inherited by new process.

Does ShellExecuteEx provides such possibility? Especially with runas verb.

diversenok
  • 103
  • 3
  • in case you use `runas` verb `CreateProcessAsUser` called from `appinfo.AiLaunchProcess` and `bInheritHandles` hardcoded to be `FALSE` unconditionally. so - no way – RbMm Jul 20 '17 at 17:24
  • Maybe try [`CreateProcessElevated()`](https://www.codeproject.com/Articles/19165/Vista-UAC-The-Definitive-Guide) instead – Remy Lebeau Jul 20 '17 at 17:36
  • @RemyLebeau, I have already read this article, but I'm however disappointed with presented solution. Well, I guess it's obviously to create new elevated process and then use `CreateProcess` from it. – diversenok Jul 20 '17 at 18:00
  • Sounds much like an [XY Problem](http://xyproblem.info/). What are you ultimately trying to accomplish? – IInspectable Jul 21 '17 at 19:22

1 Answers1

0

Does ShellExecuteEx provides such possibility?

No, it does not.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • There's very little more to be said given the question. It's a simple yes/no and the answer is no. There will be a solution to your problem, but your current approach isn't going to work out. If you want advice for the underlying problem you'd need to ask a question about that problem. – David Heffernan Jul 20 '17 at 17:39