valaiden

New Member
Joined
Oct 14, 2010
Messages
2
Hello,

I am a software developer and I encounter a LogonUI problem on Windows 7 when I use a credential provider in particular conditions.
I have modified the SampleHardwareEventCredentialProvider sample of the RTMCredentialProviderSamples__FINAL archive (Link Removed).
The original sample creates one credential at a time.
My credential provider creates a list of credentials.
This list is cleared and created each time that one calls the OnConnectStatusChanged method below.
My program has a loop that send a message to the CommandWindow.
When the CommandWindow receives this message it calls OnConnectStatusChanged.
The loop is the following:

Code:
while (1) {
    ::PostMessage(pCommandWindow->_hWnd, WM_TOGGLE_CONNECTED_STATUS, 0, 0);
    Sleep(100);
}

This way each 100 milliseconds, the credentials list will be destroyed and created again.

We use here 100 milliseconds to reproduce quickly the problem that we entounter in our credential.
Of course, the loop above do something more useful in our final credential.
Here we want just to illustrate that we change the credentials list dynamically.

If we click many times very quickly on one of the displayed credentials during this loop, at some point, LogonUI freezes: there is no more credential displayed and the restart/stop button do not respond.
The only choice we have at this point is to either hard reboot the computer or reboot it remotely.
Notice that when we do remote reboot LogonUI diplays correctly the reboot message when make me think it is not totally frozen...

To reproduce the problem:
- Download the base source package at Link Removed
- Replace the following files with the source code attached:
CommandWindow.cpp, CommandWindow.h, CSampleCredential.cpp, CSampleCredential.h, CSampleProvider.cpp, CSampleProvider.h

Is it justified to reset the list of credentials in this way (I mean asynchronously at any time)? If not, how should we do?
Is there a mechanism to be notified by LogonUI when it finished displaying the list of credentials?

Thank you in advance for your help.
 

Attachments

Last edited by a moderator:
Solution
It seems like you are encountering a LogonUI issue on Windows 7 when using a credential provider in specific conditions. Here are some insights and suggestions to address your concerns:

Resetting Credentials List Asynchronously:​

Resetting the credentials list dynamically while the LogonUI is displaying credentials can lead to freezing issues, as you mentioned. Doing this asynchronously at any time may disrupt the stability of the credential provider. To avoid freezing and instability, it's recommended to handle credential list updates more cautiously.

Suggestions for Managing the Credential List:​

  1. Synchronize Updates: Instead of dynamically resetting the credentials list, consider synchronizing the updates to...
It seems like you are encountering a LogonUI issue on Windows 7 when using a credential provider in specific conditions. Here are some insights and suggestions to address your concerns:

Resetting Credentials List Asynchronously:​

Resetting the credentials list dynamically while the LogonUI is displaying credentials can lead to freezing issues, as you mentioned. Doing this asynchronously at any time may disrupt the stability of the credential provider. To avoid freezing and instability, it's recommended to handle credential list updates more cautiously.

Suggestions for Managing the Credential List:​

  1. Synchronize Updates: Instead of dynamically resetting the credentials list, consider synchronizing the updates to avoid conflicts. You could implement a mechanism to update the list in a controlled manner to prevent freezing issues.
  2. Queueing Updates: Create a queue for credential updates and process them in an orderly fashion. This way, updates won't interfere with each other and the LogonUI display.
  3. Thread Safety: Ensure that the operations on the credentials list are thread-safe to prevent race conditions and unexpected behavior.

    Mechanism for Notification After Display:​

    Unfortunately, there isn't a direct mechanism to be notified by LogonUI when it finishes displaying the list of credentials. However, you can implement some workarounds:
  4. Timed Updates: Consider updating the credentials list at specific intervals rather than dynamically. This can reduce the chances of freezing during the display.
  5. Callback System: Implement a callback mechanism where LogonUI notifies your credential provider when it finishes displaying the credentials. This can help you manage the list updates more effectively.
  6. Event Handling: Utilize event handling to trigger updates in response to specific events rather than constant updates, reducing the risk of freezing.

    Testing and Debugging:​

    • Testing: Ensure thorough testing of the credential provider in different scenarios to identify and address potential issues.
    • Debugging Tools: Use debugging tools to analyze the behavior of the credential provider and LogonUI during the freezing issue to pinpoint the root cause.
    By following these suggestions and implementing a more controlled approach to updating the credentials list, you can enhance the stability and performance of your credential provider on Windows 7. If you encounter further issues or need more specific guidance, feel free to provide additional details for tailored assistance.
 
Solution