Could someone please help me? I'm trying to create a jobobject with JOB_OBJECT_SECURITY_ONLY_TOKEN
but SetInformationJobObject
always fails with error code 6 ( Invalid handle ).
Here is my code:
HANDLE Job( CreateJobObject( NULL, NULL ) );
if( !Job )
{
wprintf( L"Could not create job object, error %d\n", GetLastError() );
return 1;
}
JOBOBJECT_SECURITY_LIMIT_INFORMATION SecLimit = { 0 };
SecLimit.SecurityLimitFlags = JOB_OBJECT_SECURITY_ONLY_TOKEN;
if ( !SetInformationJobObject( Job, JobObjectSecurityLimitInformation, &SecLimit, sizeof( SecLimit ) ) )
{
wprintf( L"Could not associate job with IO completion port, error %d\n", GetLastError() );
return 1;
}
I am trying to run this app on XP! Thanks!