【发布时间】:2017-03-16 12:21:28
【问题描述】:
我正在尝试启动一个程序,该程序在 Windows 7 系统上使用 Win32 函数 CreateProcessWithLogon 作为另一个用户启动另一个程序,但它返回错误 120,代表 function not supported。
如果我在命令中运行程序,它可以正常工作。另一方面,如果我使用 ShellExecute 启动程序,则会收到错误消息。
Cmd Line -> 启动程序 A -> 程序 A 执行 CreateProcessWithLogon。好的 32位程序->启动程序A->程序A执行CreateProcessWithLogn。错误
if (!CreateProcessWithLogonW(L"username", L"domain", L"password",
LOGON_NETCREDENTIALS_ONLY, L"C:\\Program Files (x86)\\Internet Explorer\\iexplore.exe", L"iexplore",
NULL, NULL, NULL,
&si, &pi))
DisplayError(L"CreateProcessWithLogonW");
【问题讨论】:
标签: c++ windows winapi process