Page 1 of 1

NewProcess and UAC

Posted: Thu May 24, 2007 9:34 pm
by djsale
Hello,

i tried to launch a process in Vista with NewProcess(myproc.exe). Everything works fine, except one thing:
If myproc.exe requires an elevated run, means UAC is coming up and I press Cancel i am in an endless/recursive loop. The UAC dialog is coming up again and again. What's wrong?

thanks a lot in advance!

Solved

Posted: Fri May 25, 2007 9:29 am
by djsale
solved by myself using CreateProcess(Ex). Nevertheless, what exactly does NewProcess do? (I can't hook that with hooks on CreateProcess)?

Posted: Thu Jun 07, 2007 8:01 pm
by madshi
Hmmmm... NewProcess calls CreateProcessA first. If that fails, it tries ShellExecuteExA. So you may see the UAC complaint twice. But in end endless loop? That sounds strange to me. Can't explain that when looking at the source code.

Anyway, if you install the latest madCollection version, you should have the madKernel source code on your harddisk. If you want, you can check the source code out and debug it. If you want to set breakpoints in madKernel.pas, you need to copy madKernel.pas and mad.inc to your project folder. Then you need to edit mad.inc to change "{$D-}{$L-}" to "{$D+}{$L+}".