How to show ICredentialProviderCredentialv2 on more than one User tile on the other user tile

自作多情 提交于 2020-06-12 06:00:29

问题


I'm trying to develop a Credentialprovider v2. I'm experimenting around with the samplecredentialproviderv2 provided by Microsoft.After installing the redistributable 2013 and compiling for the right architecture, I'd registered it and it worked.

My Problem is, it works only on the first shown user tile. If I enumerate more than one usertile, it is either shown in only one user tile, or I became an error and destroyed my Logon UI.

I know the question is quite similar to this one. Here I can say I've tried the solution stated in the mentioned Microsoft document. There is a function which indicates if the "other user" tile is shown and this function works quite good. The only thing is, the else if won't work, because if you get a legit tile getSid won't reach the else if. So if you return in getSid a null sid and hr_false the credentialprovider is shown the other user tile, but in this case not shown everywhere else. If this solution is hard coded. I've tried to create more than one ICredentialProviderCredential, so that I have a list of interfaces, but it doesn't worked.

The document, which is provided here, says the following: "• v2 credential providers must implement the ICredentialProviderCredential2 interface and return a valid SID on the GetUserSID function. This tells Windows which user(s) the provider should be associated with."

My problem is, how to return more than one Sid in the GetUserSid function. It would be great if you can help.


回答1:


In ICredentialProvider::GetCredentialCount() you return the number of credential tiles (one per user) that your credential provider will supply (the credential provider can learn how many users there 'are' from the user array given to SetUserArray() ). Return a different ICredentialProviderCredential2 instance in response to each call logon makes to your ICredentialProvider::GetCredentialAt(), and from each of these instances return a different SID in response to GetUserSID(). Each of your credentials should then be associated with a different user at logon.



来源:https://stackoverflow.com/questions/31241665/how-to-show-icredentialprovidercredentialv2-on-more-than-one-user-tile-on-the-ot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!