CreateAndInject Security Level

Feb 12, 2009 at 10:10 PM
If I launch my application as an administrator and then use CreateAndInject to create a process, that process isn't launched with administrative privilages.  This is causing problems because I wanted to create an IPC server on the launched process but that requires administrative rights.

Looking at CreateAndInject, it doesn't appear there is an easy way to set the security level to that of the calling application (this seems like the most reasonable solution).  Alternatively, perhaps there is a way I could give the user a UAC (vista x64) prompt when CreateAndInject is called to elevate it to administrator?
Feb 17, 2009 at 6:51 PM
Edited Feb 17, 2009 at 6:52 PM
The final process creation is done in unmanaged code.

Maybe you will find more information in the MSDN looking for CreateProcess().

I think this is just an issue of special flags that need to be set in the unmanaged call. But it is weird though... If you create a process as admin, it should inherit the privileges. I think I set the "InheritHandles" property to FALSE. Maybe this also degrades privileges.