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

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-21
  • 2021-09-13
  • 2021-11-26
  • 2022-01-28
  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
相关资源
相似解决方案