ICredentialProviderCredential::UnAdvise() called immediately following ICredentialProviderCredential::Advise() in Windows 7 RRS feed

  • Question

  • We've got a Credential Provider that works, as far as we can tell, perfectly in Windows 8 and 10.

    On Windows 7 it crashes almost immediately, and after some digging it's because the pointer to the ICredentialProviderCredentialEvents is null, and we attempted to call a method on it without first checking if it was a valid instance (we didn't realize it could ever be null, but still we should have checked).

    The pointer is passed to the Advise(ICredentialProviderCredentialEvents* pcpce) method, but UnAdvise() is called immediately afterward, after which the pointer to ICredentialProviderCredentialEvents is no longer valid and must be released and set to null.

    This effectively means that in Windows 7, ICredentialProviderCredentialEvents is completely useless, and can't be used to update the UI.

    Is this by design or is there a flaw in our code somewhere that is causing UnAdvise() to be called immediately after Advise()?

    • Moved by Shu 2017 Monday, September 28, 2015 7:53 AM from VC++ forum
    Friday, September 25, 2015 10:41 PM