You do AssignProcessToJobObject and it fails with ‘access denied’ but only when you are running in the debugger. Why is this?
You do AssignProcessToJobObject and it fails with access denied but only when you are
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This one puzzled me for for about 30 minutes.
First off, you probably need a UAC manifest embedded in your app (as suggested here). Something like this:
Secondly (and this is the bit I got stuck on), when you are running your app under the debugger, it creates your process in a job object. Which your child process needs to be able to breakaway from before you can assign it to your job. So (duh), you need to specify
CREATE_BREAKAWAY_FROM_JOBin the flags forCreateProcess).If you weren’t running under the debugger, or your parent process were in the job, this wouldn’t have happened.