WTSQueryUserToken返回1314
The WTSQueryUserToken function obtains the primary access token of the logged-on user specified by the session ID. To call this function successfully, the calling application must be running within the context of theLocalSystem account and have the SE_TCB_NAME privilege.
MSDN明确指出调用该函数必须使用LocalSystem账户,并且拥有SE_TCB_NAME权限。
普通用户或者LocalService的服务,调用均会返回1314。
在创建服务时,指定参数为NULL,即使用默认的LocalSystem账户。
时间: 2024-10-07 08:00:41