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账户。

转载于:https://www.cnblogs.com/huangyong9527/archive/2012/07/10/2583970.html

你可能感兴趣的:(WTSQueryUserToken返回1314)