gpt4 book ai didi

c++ - 凭证提供者使用场景 : CPUS_UNLOCK_WORKSTATION removed from Windows 10

转载 作者:可可西里 更新时间:2023-11-01 13:23:38 28 4
gpt4 key购买 nike

我正在开发一个自定义凭证提供程序,需要在运行时知道该场景是登录还是解锁 session 。为此,我检查了 CREDENTIAL_PROVIDER_USAGE_SCENARIOSetUsageScenario 返回ICredentialProvider 接口(interface)。

在 Windows 10 上,独立地,如果我在登录时或 session 被锁定时,我总是将 CPUS_LOGON 作为使用场景,而在以前版本的 Windows 上,当 session 被锁定时返回 CPUS_UNLOCK_WORKSTATION,在登录时返回 CPUS_LOGON。

因此,似乎自 Windows 10 以来出现的更改未在 MSDN 上报告。

有没有其他方法可以检测使用场景是否为session locked?

最佳答案

我目前正在调查相同的问题,并且在 Microsoft 更新文档之前可能有解决方法。

虽然我仍然收到 CPUS_LOGON,但我们仍处于与锁定用户相同的 session 中。通过使用函数 WTSQuerySessionInformationW ,您可以验证当前是否有用户登录到当前 session 。从那里,您可以像在 CPUS_UNLOCK_WORKSTATION 使用场景中一样继续。

更新(2016 年 1 月 18 日): 看来 Microsoft 终于更新了有关此问题的文档。请参阅以下来自 CREDENTIAL_PROVIDER_USAGE_SCENARIO 的摘录文档:

Starting in Windows 10, the CPUS_LOGON and CPUS_UNLOCK_WORKSTATION user scenarios have been combined. This enables the system to support multiple users logging into a machine without creating and switching sessions unnecessarily. Any user on the machine can log into it once it has been locked without needing to back out of a current session and create a new one. Because of this, CPUS_LOGON can be used both for logging onto a system or when a workstation is unlocked. However, CPUS_LOGON cannot be used in all cases. Because of policy restrictions imposed by various systems, sometimes it is necessary for the user scenario to be CPUS_UNLOCK_WORKSTATION. Your credential provider should be robust enough to create the appropriate credential structure based on the scenario given to it. Windows will request the appropriate user scenario based on the situation. Some of the factors that impact whether or not a CPUS_UNLOCK_WORKSTATION scenario must be used include the following. Note that this is just a subset of possibilities.

  • The operating system of the device.
  • Whether this is a console or remote session.
  • Group policies such as hiding entry points for fast user switching, or interactive logon that does not display the user's last name.

Credential providers that need to enumerate the currently user logged into the system as the default tile can keep track of the current user or leverage APIs such as WTSQuerySessionInformation to obtain that information

关于c++ - 凭证提供者使用场景 : CPUS_UNLOCK_WORKSTATION removed from Windows 10,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32188454/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com