Re: Eureka! I have found it!
> Yes, but the CreateProcessA API can't start (from an "asInvoker"
> manifested and non-elevated running executable) a "requireAdministrator"
> manifested EXE. This is impossible. CreateProcessA will always fail
> with error code 740 or "The requested operation requires elevation" in
> this case. Only ShellExecute(Ex) can handle it.
CreateProcess() always creates a child process with *same* permissions and
execution level. It can't escalate the privileges to a higher execution
level (e.g. from "non-elevated" to "elevated" is impossible).
Friedrich
Re: Eureka! I have found it!
Hi Friedrich,
Not sure I understand really?
This is what I have in the external manifest
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" />
</requestedPrivileges>
</security>
</trustInfo>
RUN uses CreateProcessA to try to start the setup.exe, and the setup
exe then requests UAC elevation.
I don't get any errors from the Clarion end at all.
It's definately using the external manifest because I added
'asAdministrator' instead of 'requireAdministrator' at one point by
mistake and got immediate SxS errors.
Graham
3 Attachment(s)
Re: Eureka! I have found it!
Hi Graham,
> Not sure I understand really?
>
> This is what I have in the external manifest
>
> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
> <security>
> <requestedPrivileges>
> <requestedExecutionLevel level="asInvoker" />
> </requestedPrivileges>
> </security>
> </trustInfo>
Yes, the above in the calling application (e.g. PARENT.EXE) that makes use
of RUN() to launch the CHILD.EXE.
And this in the EXE to be called:
> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
> <security>
> <requestedPrivileges>
> <requestedExecutionLevel level="requireAdministrator" />
> </requestedPrivileges>
> </security>
> </trustInfo>
> RUN uses CreateProcessA to try to start the setup.exe, and the setup
> exe then requests UAC elevation.
> I don't get any errors from the Clarion end at all.
> It's definately using the external manifest because I added
> 'asAdministrator' instead of 'requireAdministrator' at one point by
> mistake and got immediate SxS errors.
CreateProcess() creates a child process with same permissions and execution
level. It can't escalate the privileges to a higher execution
level. See this as an example:
http://www.lindersoft.com/projects/C...cess740_C6.zip
PARENT.EXE and CHILD.EXE are compiled with C6. PARENT.EXE is "asInvoker"
manifested and RUN() makes use of CreateProcessA. CHILD.EXE (displays a
simple "Hello world") is "requireAdministrator" manifested. PARENT.EXE can
NOT launch CHILD.EXE if it is running non-elevated (results in a Error 740).
Friedrich
1 Attachment(s)
Re: Eureka! I have found it!
Okay, and here the same source code compiled with C10. This works as
expected and does not result in Error 740.
http://www.lindersoft.com/projects/C...ess740_C10.zip
Friedrich
Re: Eureka! I have found it!
Hi Friedrich,
OK, this is what I see...
I copied your EXEs to the desktop and ran Parent.EXE - the API trace
shows that CreateProcessA _is_ called and does result in the error
740 = The requested operation requires elevation
but that error is not displayed instead the exe carries on running...
GetLastError retrieves the ERROR_ELEVATION error and the exe then
converts the command-line to WideChar and calls ShellExecuteW with
success.
So I guess that's the change between earlier versions of Clarion and
the later ones.
The later ones detect the 740 error and try to overcome it by running
ShellExecuteW
Graham
Re: Eureka! I have found it!
Hi Graham,
> All seems to be the same whatever the .manifest contains, no errors.
> I even tried using RUN with an actual CCleaner setup.exe file
> It still used CreateProcessA .
I think that is correct. It would call CreateProcessA but if it fails
due to UAC (think the error code is like 740 or something like that -
don't remember) it should then call ShellExecuteEx.
Best regards,
--
Arnor Baldvinsson
Icetips Alta LLC
Re: Eureka! I have found it!
Hi Graham,
> See attached image (if appears as 'part1' just Save As
> 'CreateProcess12104.PNG') nothing in EXE except
What software is that (the one in the screenshot, not being tested;)
Best regards,
--
Arnor Baldvinsson
Icetips Alta LLC
Re: Eureka! I have found it!
Hi Arnor,
It's Rohans API Monitor
http://www.rohitab.com/apimonitor
been using it for years now, really useful (if confusing).
It's a bit like ProcMon etc etc - the trick is getting the filters
correct so you're not swampped with info.
Although for something 'simple' like this turning everything on is a
good place to start.
Graham
Re: Eureka! I have found it!
....and it's free !!!
Graham
Re: Eureka! I have found it!
I am amazed that I've never heard of it. Sweet.
Jeff Slarve
www.jssoftware.com
Twitter free since Jan 11, 2016
I'll search help files & Google for you.
Grammar troll's, are the worse.