问题描述
我在哪里可以得到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我会回来的的当我通过在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,我可以通过的但是这是一个结构,而不是一个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.
这篇关于我在哪里可以得到ULONG为LoginID值传递给WTSConnectSession?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!