How to use CreateProcessAsUserW() for the user other then Administrator
Hi all
I am using CreateProcessAsUserW() in my code to create a process. The code is working fine if the user is the Administrator or a member of Administrator group. But when I try to create the process as a user which is not a member of Administrator it is giving the error 1307 which means (This security ID may not be assigned as the owner of this object).
So should I have to set some priviledges for the user.
And if yes then which one and what will be the procedure to do so.
Thanks a lot in advance
Re: How to use CreateProcessAsUserW() for the user other then Administrator
Re: How to use CreateProcessAsUserW() for the user other then Administrator
@EINSTEIN
The thread you have mentioned talks about the same error code. But my problem is different. He is just copying a batch file and I am writing a function in visual c++ to create a proces as particular user.
Re: How to use CreateProcessAsUserW() for the user other then Administrator
If you use the CreateProcessAsUser function, you can specify the CREATE_BREAKAWAY_FROM_JOB bit in the creation flags.
Re: How to use CreateProcessAsUserW() for the user other then Administrator
@Rkhon
I have tried this but still the same problem....
I like to mention the sequence of functions I am using for better understanding of the problem.
LogonUserW()
LoadUserProfileW()
CreateEnvironment Block()
CreateProcessAsUserW()
Re: How to use CreateProcessAsUserW() for the user other then Administrator
Quote:
Originally Posted by
rajeevsandil
So should I have to set some priviledges for the user.
And if yes then which one and what will be the procedure to do so.
For this purpose, I think this sample will better help you to add a privilege to an account.
http://www.mvps.org/win32/lsa/lsa_laar.cpp
Re: How to use CreateProcessAsUserW() for the user other then Administrator
Hi all
can you plz help me out.