I tried to start a process in service session ( session 0 : window 2008 server (session 0 isolation)) with user account. then I use LogonUser and createProcessAsUser api.....
but, user account('frank') //session id :0 //process name: notepad.exe
when interactive service and desktop is checked, Interactive desktop Detection popup -> notepad.exe' process in service session(0)can draw well, crack!!! Am I doing something wrong?
part of source below
--------------------------------------------------------------------------------------------
result = LogonUser(username, domain, password, (int)LOGON_TYPE.LOGON32_LOGON_NETWORK, (int)LOGON_PROVIDER.LOGON32_PROVIDER_DEFAULT, out token);
result = DuplicateTokenEx(token, (TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES | TOKEN_ADJUST_SESSIONID | TOKEN_ADJUST_DEFAULT | TOKEN_ASSIGN_PRIMARY | TOKEN_DUPLICATE), ref processAttributes, SECURITY_IMPERSONATION_LEVEL.SecurityImpersonation, TOKEN_TYPE.TokenPrimary, out primaryToken);
result = CreateProcessAsUser(primaryToken, applicationName, commandLine, ref processAttributes, ref threadAttributes, inheritHandles, 0, environment, currentDirectory, ref startupInfo, out processInformation);