Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

I get Access Denied when I try to assign a process to a Job Object

143 views
Skip to first unread message

Fabio

unread,
May 12, 2006, 9:29:02 AM5/12/06
to
I'm trying to spawn a process as a different user (either by
CreateProcessWithLogonW() or CreateProcessWithTokenW()) and add the new
process to a Job object.
However, when I call AssigneProcessToJobObject(), it returns ACCESS_DENIED.

Investigating a little further, it looks like the newly created process (child
of svchost) is already part of another job object and thus it cannot be
reassigned to mine.

Does anybody have an idea how to do what I need?

Thanks,
Fabio

Bruno van Dooren

unread,
May 12, 2006, 10:18:34 AM5/12/06
to

Hi,

If you use the CreateProcessAsUser function, you can specify the
CREATE_BREAKAWAY_FROM_JOB bit in the creation flags.
that will cause the child process to not be made a job member.

I don't know why the CreateProcessWithTokenW and CreateProcessWithLogonW
documentation do not mention this flag.
either it is an oversight and the documentation is wrong, or those functions
do not support that flag.

In that case you could try using the function I mentioned. you could also
try asking in one of the platform sdk groups. maybe there someone will know
the rationale behind this behavior.

--

Kind regards,
Bruno van Dooren
bruno_nos_pa...@hotmail.com
Remove only "_nos_pam"


0 new messages