gpt4 book ai didi

c - 最大 CreateProcessWithLogonW 和 NetUserAdd

转载 作者:太空宇宙 更新时间:2023-11-04 04:09:29 31 4
gpt4 key购买 nike

我写了一个小函数,可以加载一个的多个实例使用 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 is MAXIMUM_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/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com