 |
 |
 |
|
|  |  |
 |
CreateProcessAsUser ..msdn Add comment W32 Constants Translate this page |
 |
 |
|
The CreateProcessAsUser function creates a new process and its primary thread. The new process then runs the specified executable file. The CreateProcessAsUser function is similar to the CreateProcess function, except that the new process runs in the security context of the user represented by the hToken parameter. |
 |  | | Code examples: |  | |
|
 |  | | Declaration: |  |  |
BOOL CreateProcessAsUser(
HANDLE hToken,
LPCTSTR lpApplicationName,
LPTSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
DWORD dwCreationFlags,
LPVOID lpEnvironment,
LPCTSTR lpCurrentDirectory,
LPSTARTUPINFO lpStartupInfo,
LPPROCESS_INFORMATION lpProcessInformation
);
|
 |  |  | | FoxPro declaration: |  |  |
DECLARE INTEGER CreateProcessAsUser IN advapi32;
INTEGER hToken,;
STRING lpApplicationName,;
STRING lpCommandLine,;
INTEGER lpProcessAttributes,;
INTEGER lpThreadAttributes,;
INTEGER bInheritHandles,;
INTEGER dwCreationFlags,;
INTEGER lpEnvironment,;
STRING lpCurrentDirectory,;
STRING @ lpStartupInfo,;
STRING @ lpProcessInformation
|
 |  |  | | Parameters: |  | hToken
[in] Handle to a primary token that represents a user. The handle must have the TOKEN_QUERY, TOKEN_DUPLICATE, and TOKEN_ASSIGN_PRIMARY access rights.
lpApplicationName
[in] Pointer to a null-terminated string that specifies the module to execute.
lpCommandLine
[in] Pointer to a null-terminated string that specifies the command line to execute.
lpProcessAttributes
[in] Pointer to a SECURITY_ATTRIBUTES structure that specifies a security descriptor for the new process and determines whether child processes can inherit the returned handle.
lpThreadAttributes
[in] Pointer to a SECURITY_ATTRIBUTES structure that specifies a security descriptor for the new process and determines whether child processes can inherit the returned handle.
bInheritHandles
[in] If this parameter is TRUE, each inheritable handle in the calling process is inherited by the new process.
dwCreationFlags
[in] Flags that control the priority class and the creation of the process.
lpEnvironment
[in] Pointer to an environment block for the new process.
lpCurrentDirectory
[in] Pointer to a null-terminated string that specifies the current drive and directory for the new process.
lpStartupInfo
[in] Pointer to a STARTUPINFO structure that specifies the window station, desktop, standard handles, and appearance of the main window for the new process.
lpProcessInformation
[out] Pointer to a PROCESS_INFORMATION structure that receives identification information about the new process. |
 |  | | Return value: |  | | If the function succeeds, the return value is nonzero. |
 |  | | My comment: |  | The CreateProcessWithLogonW and CreateProcessWithTokenW functions are similar to CreateProcessAsUser, except that the caller does not need to call the LogonUser function to authenticate the user and get a token.
This function is also similar to the SHCreateProcessAsUserW function.
Handles in PROCESS_INFORMATION must be closed with CloseHandle when they are no longer needed. |
 |  | | Word Index links for the CreateProcessAsUser : |  | |
|
 |  | | Translate this page: |  | |  |  | | • |  | | Created: | 2003-10-30 14:59:46 | | Modified: | 2003-10-30 15:03:51 | Visited in last 7 days: 31 |
|
 |
 |
 |
 |
Copyright © 2001-2013
News2News, Inc.
Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use.
The information on this page is presented AS IS, meaning that you may use it at your own risk.
Microsoft Visual FoxPro
and Windows are trade marks
of Microsoft Corp.
All other trademarks are the property of their respective owners.
Privacy policy
|
 |
 |
 |
Credits: PHP (4.4.9), an HTML-embedded scripting language,
MySQL (5.1.55-log), the Open Source standard SQL database,
AceHTML Freeware
Version 4, freeware HTML Editor of choice. Hosted by Korax Online Inc. |
 |
 |
|
 |
 |
|
|