|
From: Fabio on 12 May 2006 09:29 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
From: Bruno van Dooren on 12 May 2006 10:18 > 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? 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_pam_van_dooren(a)hotmail.com Remove only "_nos_pam"
|
Pages: 1 Prev: DLL project and static linking of CRT (/MT or /MTd) Next: CListCtrl memory leak? |