Im am trying this difficult way, i 'd like to launch a process from service with reateProcessAsUser API, with 2 simple rows i have the process Loaded in RAM with corrent User, but i don't see nothing, becouse i understood that process run in another context, now i am trying from two week, but i cannot understand as do.
Cam you complete this code with me ?
Thanks in advance
HANDLE hUserToken = INVALID_HANDLE_VALUE;
BOOL bResult = FALSE;
DWORD dwCreationFlags = CREATE_NEW_CONSOLE;
LPVOID pEnv = NULL;
si.cb = sizeof(STARTUPINFO);
si.lpDesktop = _T("winsta0\\default");
if (!LogonUser(Settings.szUserName, NULL, Settings.szPassword, LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT, &hUserToken))
bResult = CreateProcessAsUser(hUserToken, NULL, Settings.szCommandLine, NULL, NULL, FALSE, dwCreationFlags, pEnv, NULL, &si, &pi);
What I have tried:
i have tried DuplicateTokenEX and SetokenInformation but always fail i don't know what do, really :(