I am writing a program that will open a job object present in BaseNamedObjects
namespace using OpenJobObjectA
. Below is snippet of code:
hJob = OpenJobObjectA(JOB_OBJECT_QUERY, FALSE, "\BaseNamedObjects\SAC10680");
if (hJob == NULL) {
fprintf(stderr, "Failed to open job object. Error code: %dn", GetLastError());
return 1;
}
Now, even though the job object is present(which I verify using winobj) I am not able to open the object. And getting below error:
Failed to open job object. Error code: 161
I know error 161 means path is invalid. But that’s not true!!
The code should open the job object.