У меня есть процесс, работающий в разделе «Системная учетная запись» в сеансе 1. Я называю CreateProcessAsususer и могу видеть, что создается процесс (я мог бы распечатать новый процесс и идентификаторы потоков и мог видеть процесс в мониторе процесса), но в пользовательском интерфейсе ничего не видимо. Ниже приведен код. < /P>
// usrToken has the following
// Is in session 1
// Obtained by calling LogonUser and then user profile is loaded and user environment is created.
// Has generic read and write access to session 1 winsta0 and default desktop. I added these explicitly by modifying ACLs
// trying to launch notepad.exe in the new user session. I have tried with cmd.exe as well but could not see any UI window
BOOL InjectProcess2(HANDLE usrToken)
{
BOOL ret;
DWORD err;
PROCESS_INFORMATION pi = {};
DWORD sessionId = WTSGetActiveConsoleSessionId();
// i think this may be redundant
if (!SetTokenInformation(usrToken, TokenSessionId,
&sessionId, sizeof(sessionId)))
{
err = GetLastError();
cout
Подробнее здесь: https://stackoverflow.com/questions/796 ... ot-visible