我在哪里可以得到ULONG为LoginID值传递给WTSConnectSession?我在、可以得到、ULONG、LoginID

2023-09-04 23:05:09 作者:厄久

我在哪里可以得到ULONG为LoginID值传递给 WTSConnectSession 的?我既需要一个ULONG LogonID的和ULONG TargetLogonId。

Where do I get the ULONG LoginID values to pass to WTSConnectSession? I need both a ULONG LogonId and a ULONG TargetLogonId.

这是一样的SessionID我会回来的的 WTSQuerySessionInformation 当我通过在WTSSessionId?我怀疑不是(我尝试过了,WTSConnectSession没有奏效。)

Is this the same as the SessionID I'll get back from WTSQuerySessionInformation when I pass in WTSSessionId? I suspect not (I tried it and WTSConnectSession did not work.)

在MSDN glossay说,一个​​登录标识符是一个LUID,我可以通过的 GetTokenInformation 但是这是一个结构,而不是一个ULONG。是否有一个API来从LUID得到ULONG登录ID?

The MSDN glossay says a logon identifier is a LUID which I can get via GetTokenInformation but that is a structure, not a ULONG. Is there an API to get a ULONG loginId from an LUID?

推荐答案

您正在寻找从会话ID WTSEnumerateSessions WTSGetActiveConsoleSessionId ProcessIdToSessionId 等。从一个 WTSQuerySessionInformation 也是一个会话ID,当然。

You're looking for the session ID from WTSEnumerateSessions, WTSGetActiveConsoleSessionId, ProcessIdToSessionId and so on. The one from WTSQuerySessionInformation is also a session ID, of course.

记住,你需要两个会话ID此功能。

Remember that you need two session IDs for this function.