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

posted @ 2012-07-10 08:45  友学友  阅读(4491)  评论(1编辑  收藏  举报