Hi Xavier,
On 1/26/2012 9:52 AM, Xavier Roche wrote:
> Hi folks,
>
> I have a service running as a non-privileged user (a local system
> .\user), and I am using CreateProcessW() to install some MSI executable
> package in "unattended" mode (setup.exe /q), using the local
> Administrator credentials.
>
> When executing the executables, the return code (GetExitCodeProcess())
> is -1073741502 (c0000142, "DLL Initialization Failed"). The failing DLL
> name is unfortunately not given :)
>
This sounds strange. Can you doublecheck with a process of your own, for
example a console app that only links against kernel32.dll and returns
some specific exit code such as 42. It could well be that setup.exe
actually does an exit(0xc0000142) somewhere in its code.
You could also check if you are using default windowstation allocation
policy or specifying a certain winsta\desktop combination. How does the
lpDesktop member of the STARTUPINFO structure look like that you pass to
CreateProcessW? If it is "winsta0\\default" then try passing NULL, which
is default windowstation allocation policy (your service should normally
run in a different windowstation than winsta0).
> However, KB 165194 (
http://support.microsoft.com/kb/165194) suggests
> that CreateProcessAsUser() might fail with a "Initialization of the
> dynamic library <system>\system32\user32.dll failed" error because of
> restricted access to the desktop.
This is the typical scenario if you naively call CreateProcessAsUser
without adjusting the DACL of winsta0 and your desktop.
--
S