为什么Windows不允许在模拟另一个用户时启动WinSock [英] Why does Windows not allow WinSock to be started while impersonating another user
问题描述
使用我自己的程序或其他人,如果使用CreateProcessWithLogonW或CreateProcessAsUserW创建进程,则调用时无法获取winsock运行。在创建套接字时返回此错误:
WSAEPROVIDERFAILEDINIT 10106
$<$ c $> c>无法加载或初始化请求的服务提供程序。
如果
服务提供程序的DLL不能是
, (LoadLibrary失败)或
提供程序的WSPStartup或NSPStartup
函数失败
。 b
$ b
但是,WSAStartup似乎不会出现错误。只需使用WSASocket创建套接字即可返回此套接字。
UPDATE:
错误:
LoadUserProfile:错误代码2.
找不到指定的文件
AdjustTokenPrivs:错误代码5.访问
拒绝
拥有作为运营特权
Using my own program or others I can't get winsock to run when calling if the process is created with CreateProcessWithLogonW or CreateProcessAsUserW. It returns this error when I create the socket:
WSAEPROVIDERFAILEDINIT 10106
Service provider failed to initialize.
The requested service provider could not be loaded or initialized.
This error is returned if either a service provider's DLL could not be loaded (LoadLibrary failed) or the provider's WSPStartup or NSPStartup function failed
.
However, WSAStartup seems to go w/o an error. Just creating the socket with WSASocket returns this.
UPDATE:
Errors:
LoadUserProfile: Error Code 2. Can't find file specified
AdjustTokenPrivs: Error Code 5. Access Denied
You have to have the Act As Operating Priv
这篇关于为什么Windows不允许在模拟另一个用户时启动WinSock的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!