Private Declare Auto Function CreateProcessAsUser Lib "advapi32" ( _
.
Private Shared Function CreateProcessAsUser( _
.
The Unicode version of this function, CreateProcessAsUserW, can modify the contents of this string. Therefore, this parameter cannot be a pointer to read-only memory (such as a const variable or a literal string). If this parameter is a constant string, the function may cause an access violation.
.
if (!CreateProcessAsUser(hToken, String.Empty, commandLine,
.
throw new Exception("Failed to CreateProcessAsUser");
.
If Not CreateProcessAsUser(hToken, "", strCmdLine, Nothing, _
Creates a new process, using the creditials supplied by hToken. The application opened is running under the credentials and authority for the user supplied to LogonUser.
4/21/2013 11:21:50 PM - -203.19.158.31
Starts a new process, opens an application in that process, and uses a passed UserID and Password. The application opened is running under the credentials and authority of the UserID passed.
Note that it is your responsibility to load the user's registry hive into the HKEY_USERS registry key with the LoadUserProfile function before calling CreateProcessAsUser. This is because CreateProcessAsUser does not load the specified user's profile into HKEY_USERS. This means that access to information in the HKEY_CURRENT_USER registry key may not produce results consistent with a normal interactive logon.
TODO - a short description
6/20/2007 4:00:29 AM - -24.118.142.62
Creates a new process, using the creditials supplied by hToken. The application opened is running under the credentials and authority for the user supplied to LogonUser.
4/21/2013 11:21:50 PM - -203.19.158.31
Creates a new process, using the creditials supplied by hToken. The application opened is running under the credentials and authority for the user supplied to LogonUser.
Creates a new process, using the creditials supplied by hToken. The application opened is running under the credentials and authority for the user supplied to LogonUser.
4/21/2013 11:21:50 PM - -203.19.158.31
Starts a new process, opens an application in that process, and uses a passed UserID and Password. The application opened is running under the credentials and authority of the UserID passed.