我写了一个小函数,可以加载一个的多个实例 使用 CreateProcessWithLogonW 可执行
伪代码:
for ( i=0;i<100;i++)
{
sprintf(user,"user%i",i);
sprintf(pass,"pass%i",i);
if(NetUserGetInfo(user,pass)==NOT_FOUND) { NetUserAdd(user,pass); }
aaProcessCreateWithLogin("prog.exe",user,pass);
}
它工作正常,除了 ,它被限制为 32 个实例 - 其他实例失败 -
是否有可以启动的用户数量限制 同时处理 ?
谢谢
灰
最佳答案
来自documentation for CreateProcessWithLogonW :
There is a limit to the number of child processes that can be created by this function and run simultaneously. For example, on Windows XP, this limit is
MAXIMUM_WAIT_OBJECTS*4
. On Windows 2000, this limit isMAXIMUM_WAIT_OBJECTS
. However, you may not be able to create this many processes due to system-wide quota limits.
我已经在 Windows XP 上测试了 MAXIMUM_WAIT_OBJECTS
,它是 64,所以你可能达到了“系统范围的配额限制”。
This post建议使用 LogonUser 的组合和 CreateProcessAsUser而不是避免达到这些限制。
关于c - 最大 CreateProcessWithLogonW 和 NetUserAdd,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/820794/