G
Guest
Hi,
I have a problem in launching an application through my service. I am
trying to launch e. g. update.exe through my service. The update.exe has a
UI. The UI should displayed on the current desktop. But the update.exe has to
run
with admin rights. Therefore a UserAccount exits.
I´m trying this stuff with using the "CreateProcessAsUser" API function.
Here my code (pieces):
if (LogonUser(szUserName, _T("."), szPwd, LOGON32_LOGON_INTERACTIVE,
LOGON32_PROVIDER_DEFAULT, &hUser) == FALSE)
{ //error
}
else
{
if (CreateProcessAsUser(hUser, NULL, szComLine, NULL, NULL, FALSE,
CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi) == 0)
{ //error
}
}
CreateProcessAsUser failed. GetLastError is 740. And the error msgbox is
displayed in session0 (Service session on VISTA!).
What make I wrong?
Maybe there is another possibility to start my update.exe. Without using a
admin account. Perhaps I can impersonate the current launching process
(update.exe) from User Rights to admin rights. Is there a possibility?
Many thanks for your answer.
I have a problem in launching an application through my service. I am
trying to launch e. g. update.exe through my service. The update.exe has a
UI. The UI should displayed on the current desktop. But the update.exe has to
run
with admin rights. Therefore a UserAccount exits.
I´m trying this stuff with using the "CreateProcessAsUser" API function.
Here my code (pieces):
if (LogonUser(szUserName, _T("."), szPwd, LOGON32_LOGON_INTERACTIVE,
LOGON32_PROVIDER_DEFAULT, &hUser) == FALSE)
{ //error
}
else
{
if (CreateProcessAsUser(hUser, NULL, szComLine, NULL, NULL, FALSE,
CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi) == 0)
{ //error
}
}
CreateProcessAsUser failed. GetLastError is 740. And the error msgbox is
displayed in session0 (Service session on VISTA!).
What make I wrong?
Maybe there is another possibility to start my update.exe. Without using a
admin account. Perhaps I can impersonate the current launching process
(update.exe) from User Rights to admin rights. Is there a possibility?
Many thanks for your answer.