NewProcess and UAC

delphi package - easy access to kernel objects etc.
Post Reply
djsale
Posts: 21
Joined: Wed Dec 27, 2006 4:09 pm

NewProcess and UAC

Post 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!
djsale
Posts: 21
Joined: Wed Dec 27, 2006 4:09 pm

Solved

Post by djsale »

solved by myself using CreateProcess(Ex). Nevertheless, what exactly does NewProcess do? (I can't hook that with hooks on CreateProcess)?
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Post 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+}".
Post Reply