Tengo una llamada a CreateProcessWithTokenW que está fallando con acceso denegado. ¿Alguna idea de cómo depurar esto?por qué está fallando CreateProcessWithTokenW con ERROR_ACCESS_DENIED
La llamada a CreateProcessWithTokenW está aquí: https://github.com/fschwiet/PShochu/blob/master/PShochu/PInvoke/NetWrappers/ProcessUtil.cs
Por ahora estoy usando un token de acceso para el proceso actual, con el tiempo voy a utilizar una ficha de otro usuario. Por ahora, estoy usando https://github.com/fschwiet/PShochu/blob/master/PShochu/PInvoke/NetWrappers/AccessToken.cs para obtener el token de acceso.
Si desea depurar, despliegue el código fuente y ejecute build_and_test.ps1. La pila de errores es:
1) Test Error : PShochu.Tests.can_run_remote_interactive_tasks, given a psake script which writes the current process id to output, when that script is invoked interactively, then the script succeeds
System.ComponentModel.Win32Exception : Access is denied
at PShochu.PInvoke.NetWrappers.ProcessUtil.CreateProcessWithToken(IntPtr userPrincipalToken, String applicationName,
String applicationCommand, Boolean dontCreateWindow, Boolean createWithProfile, StreamReader& consoleOutput, StreamReader& errorOutput) in c:\src\PShochu\PShochu\PInvoke\NetWrappers\ProcessUtil.cs:line 52
at PShochu.ProcessHandling.RunNoninteractiveConsoleProcessForStreams2(String command, String commandArguments, String& newLine) in c:\src\PShochu\PShochu\ProcessHandling.cs:line 36
at PShochu.ProcessHandling.RunNoninteractiveConsoleProcess(String command, String commandArguments) in c:\src\PShochu\PShochu\ProcessHandling.cs:line 20
at PShochu.Tests.can_run_remote_interactive_tasks.<>c__DisplayClass16.<>c__DisplayClass18.<Specify>b__2() in c:\src\PShochu\PShochu.Tests\can_run_remote_interactive_tasks.cs:line 27
at NJasmine.Core.Execution.DescribeState.<>c__DisplayClass7`1.<visitBeforeEach>b__3() in c:\src\NJasmine\NJasmine\Core\Execution\DescribeState.cs:line 62
Posteriormente actualización: Vi en algunos documentos que se necesitan privilegios adicionales (http://msdn.microsoft.com/en-us/library/aa374905%28v=vs.85%29.aspx). Estoy teniendo problemas para conseguir pruebas para verificar tengo estos valores individuales (que se establecen en secpol.msc pre-reinicio)
SE_ASSIGNPRIMARYTOKEN_NAME "Replace a process level token"
SE_TCB_NAME "Act as part of the operatin system"
SE_INCREASE_QUOTA_NAME "Adjust memory quotas for a process"
Estas pruebas me sigo diciendo que no tienen los permisos Me he fijado en el IU, https://github.com/fschwiet/PShochu/blob/master/PShochu.Tests/verify_privileges.cs
no se necesita? Sí, tampoco quería tocarlo. : P –
¿Qué sistema operativo es? Podría intentar ejecutar Process Monitor y ver si se trata de algo relacionado con el acceso a archivos o registros (parece poco probable teniendo en cuenta que es el mismo usuario). – Luke
Windows 7. No estoy seguro de cómo lo vería en el explorador de procesos, ya que, como entiendo el error, el proceso no se inicia. –