(Visual Studio 2010 - C++) Hello,
I'm trying to set a JOB to a process, but AssignProcessToJobObject returns ACCESS_DENIED and IsProcessInJob returns TRUE.
I call IsProcessInJob to a process immediately after call CreateProcess (Suspended) end tried call IsProcessInJob with my process (a few lines after main entry point) and it returns true.
void main()
{
BOOL bIsInJob;
IsProcessInJob( GetCurrentProcess(), NULL, &bIsInJob );
printf( "IsProcessInJob (me): %s\n", bIsInJob ? "true" : "false" );
// RET True ! inside and outside IDE
...
Someone saw it before?
Thanks for any help. Sources: Kill child process when parent process is killed How do I automatically destroy child processes in Windows?