locked
Windows 8 Credential Provider Samples RRS feed

  • Question

  • Dear All,

    Sorry to bother you!

    i'm study windows 8 credentail provider now.

    According "Credential Provider Framework Changes in Windows 8"'s information ICredentialProviderCredential2::GetUserSid should be implemented.

    But it seems GetUserSid not be called when i debug even i implemented it.

    i aready got Sid from ICredentialProviderUser ::getSid.

    So i think it will help me study if i can download Windows 8 Credential Provider  Samples.

    Thanks!

    Monday, June 11, 2012 3:18 AM

Answers

  • Hi All,

    I found the root cause is:

    i changed provider interface from  ICredentialProviderCredential to ICredentialProviderCredential2.

    But forget change the QueryInterface function(We return derectly if not query unknow and ICredentialProviderCredential ).

    after modified QueryInterface ,ICredentialProviderUser ::getSid will be called.

    • Marked as answer by Reik.Hua Tuesday, June 12, 2012 11:24 AM
    Tuesday, June 12, 2012 11:24 AM

All replies

  • Hi All,

    I found the root cause is:

    i changed provider interface from  ICredentialProviderCredential to ICredentialProviderCredential2.

    But forget change the QueryInterface function(We return derectly if not query unknow and ICredentialProviderCredential ).

    after modified QueryInterface ,ICredentialProviderUser ::getSid will be called.

    • Marked as answer by Reik.Hua Tuesday, June 12, 2012 11:24 AM
    Tuesday, June 12, 2012 11:24 AM
  • Hi Reik.Hua,

    I'm studying windows 8 credentail provider too.

    I want improve the display of v1 Crendential Providers(the tile of  image from 126x126 px to 200x200 px)

    According "Credential Provider Framework Changes in Windows 8"'s information, I changed provider interface from  ICredentialProviderCredential to ICredentialProviderCredential2 and implemented  ICredentialProviderCredential2::GetUserSid,  but there is no change.

    Could you providing me additional information of migrating v1 Crendential Providersto v2 Crendential Providers? Or give me a small Windows 8 Credential Provider  Samples you have done?

    Thanks a lot!

    Monday, July 9, 2012 7:03 AM
  • Hi Reik.Hua :

          I study credentialprovider on win 8 .

           I meet a problem to call ICredentialProviderUserArry::SetUserArray. 

          My provider can't call SetUserArray after SetScenario ...

           Can you provide any idea?

    Thx.


    • Edited by karcher Friday, July 20, 2012 6:20 AM
    Friday, July 20, 2012 5:49 AM
  •  I have implemented QueryInteface as follows, But GetUserSid will NOT be called, WHY???  

    if (IsEqualIID(IID_IUnknown, riid) ||
        IsEqualIID(IID_ICredentialProviderCredential, riid))
       {
        TRACE(TEXT("IID_ICredentialProviderCredential\n"));
        *ppv = this;
        reinterpret_cast<IUnknown*>(*ppv)->AddRef();
        hr = S_OK;
       }
       else if (IsEqualIID(IID_ICredentialProviderCredential2, riid))
       {
        TRACE(TEXT("IID_ICredentialProviderCredential2\n"));
        *ppv = this;
        reinterpret_cast<ICredentialProviderCredential2*>(*ppv)->AddRef();
        hr = S_OK;
       }
       else
       {
        HWTRACE(TEXT("others %x %x %x %x\n"), riid.Data1, riid.Data2, riid.Data3, riid.Data4[0]);
        *ppv = NULL;
        hr = E_NOINTERFACE;
       }


    张瑞森

    Thursday, June 20, 2013 2:15 AM
  •  even if the follow can't reached

    else if (IsEqualIID(IID_ICredentialProviderCredential2, riid))
       {
    TRACE(TEXT("IID_ICredentialProviderCredential2\n"));
        *ppv = this;
        reinterpret_cast<ICredentialProviderCredential2*>(*ppv)->AddRef();
        hr = S_OK;
       }

        

    张瑞森

    Thursday, June 20, 2013 2:19 AM
  • what modification did you make to “QueryInterface”, mine is made as follows

      if (IsEqualIID(IID_IUnknown, riid) ||
       IsEqualIID(IID_ICredentialProviderCredential, riid) ||
       IsEqualIID(IID_ICredentialProviderCredential2, riid))
      {
       HWTRACE(TEXT("IID_ICredentialProviderCredential\n"));
       *ppv = static_cast<ICredentialProviderCredential2*>(this) ;
      }

    It can't work. Can you help me?


    张瑞森

    Thursday, June 20, 2013 6:32 AM
  • Hi,

    use this .this is working for me

    STDMETHOD (QueryInterface)(REFIID riid, void** ppv)
        {
            HRESULT hr;
            if (ppv != NULL)
            {
                if (IID_IUnknown == riid ||
                    IID_ICredentialProviderCredential == riid|| IID_ICredentialProviderCredential2 == riid)
                {
                    *ppv = static_cast<IUnknown*>(this);
                    reinterpret_cast<IUnknown*>(*ppv)->AddRef();
                    hr = S_OK;
                }
                else
                {
                    *ppv = NULL;
                    hr = E_NOINTERFACE;
                }
            }
            else
            {
                hr = E_INVALIDARG;
            }
            return hr;
        }

    Thursday, June 20, 2013 10:35 AM
  • Hi,

    use this .this is working for me

    STDMETHOD (QueryInterface)(REFIID riid, void** ppv)
        {
            HRESULT hr;
            if (ppv != NULL)
            {
                if (IID_IUnknown == riid ||
                    IID_ICredentialProviderCredential == riid|| IID_ICredentialProviderCredential2 == riid)
                {
                    *ppv = static_cast<IUnknown*>(this);
                    reinterpret_cast<IUnknown*>(*ppv)->AddRef();
                    hr = S_OK;
                }
                else
                {
                    *ppv = NULL;
                    hr = E_NOINTERFACE;
                }
            }
            else
            {
                hr = E_INVALIDARG;
            }
            return hr;
        }


    mine can't work still,can you send me an example? thanks! Email muchforest@126.com

    张瑞森

    Wednesday, June 26, 2013 3:55 AM