在CreateProcessWithLogonW之后,第二个应用程序没有获取凭据

时间:2017-07-19 21:36:35

标签: windows security winapi

如何使用实时的CreateProcessWithLogonW创建进程(a.exe)(请注意,我不是管理员用户,而是我与CreateProcessWithLogonW一起使用的是admin)并启动另一个进程( b.exe)来自使用CreateProcess的a.exe并实时实现吗?

以下是启动a.exe的代码:

PROCESS_INFORMATION pi = { 0 };
STARTUPINFO         si = { 0 };
if (!CreateProcessWithLogonW(argv[1], argv[2], argv[3], LOGON_NETCREDENTIALS_ONLY, NULL, _T("a.exe"),
REALTIME_PRIORITY_CLASS, NULL, NULL,
&si, &pi))
{
    cout << "Error!!!!\n";
}

以下是从a.exe启动b.exe的代码:

SECURITY_ATTRIBUTES   security_att;
STARTUPINFO           si;
PROCESS_INFORMATION   pi;
ZeroMemory(&security_att, sizeof(security_att));
security_att.nLength        = sizeof (SECURITY_ATTRIBUTES);
security_att.bInheritHandle = TRUE;

ZeroMemory(&si, sizeof(si));
si.cb          = sizeof(si);
si.dwFlags     = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_NORMAL;

if(!CreateProcess(NULL, "b.exe", &security_att, &security_att, FALSE, REALTIME_PRIORITY_CLASS, NULL, NULL, &si, &pi))
{
            cout << "Error!!!!\n";
}

目前,a.exe将是实时优先级,但b.exe只是高优先级。

0 个答案:

没有答案