|
|
От: | j0t | |
| Дата: | 10.05.06 20:45 | ||
| Оценка: | |||
PROCESS_INFORMATION pi;
memset( &pi, 0, sizeof( PROCESS_INFORMATION ) );
STARTUPINFOW si;
memset( &si, 0, sizeof( STARTUPINFOW ) );
si.cb = sizeof(si);
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_HIDE;
BOOL Result = CreateProcessWithLogonW(
admName, // username
L".", // domain
admPwd, // password
LOGON_NETCREDENTIALS_ONLY,
ServerExecutableUNC, // UNC path to application
NULL, // command line
CREATE_DEFAULT_ERROR_MODE, // CreationFlags
NULL, // Environment
NULL, // CurrentDirectory
&si, &pi );CreateProcessWithLogonW accesses the specified directory and executable image in the security context of the target user. If the executable image is on a network and a network drive letter is specified in the path, the network drive letter is not available to the target user, as network drive letters can be assigned for each logon. If a network drive letter is specified, this function fails. If the executable image is on a network, use the UNC path.
By default, CreateProcessAsUser accesses the directory and executable image in the security context of the caller.