NewProcess and UAC

delphi package - easy access to kernel objects etc.

NewProcess and UAC

Postby djsale » Thu May 24, 2007 9:34 pm

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

Postby djsale » Fri May 25, 2007 9:29 am

solved by myself using CreateProcess(Ex). Nevertheless, what exactly does NewProcess do? (I can't hook that with hooks on CreateProcess)?
djsale
 
Posts: 21
Joined: Wed Dec 27, 2006 4:09 pm

Postby madshi » Thu Jun 07, 2007 8:01 pm

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+}".
madshi
Site Admin
 
Posts: 9414
Joined: Sun Mar 21, 2004 5:25 pm


Return to madKernel

Who is online

Users browsing this forum: No registered users and 1 guest