title: Credential Providers V2 Active for All users(Tiles)
body: <p>I use sample code of "Credential Providers in Windows 10". I develop my code and change it very good.</p>
  
  <p>But I have some problem with it:</p>
  
  <p>It is not enable (Show tile) for all users in my windows. (Show for one user only)</p>
  
  <p><a href="https://i.stack.imgur.com/CGc1j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CGc1j.png" alt="enter image description here"></a></p>
  
  <p>I See this questions:</p>
  
  <p><a href="https://stackoverflow.com/a/31247811/3477587">https://stackoverflow.com/a/31247811/3477587</a></p>
  
  <p><a href="https://stackoverflow.com/q/55967533/3477587">Credential provider not displayed for all users (Other user included)</a></p>
  
  <p>So I change my code but when use from my DLL win-login don't load and I must delete in in safe-mode to I can enter to my windows without Credential Providers.</p>
  
  <p>I change my code as follow:</p>
  
  <pre><code>std::vector&lt;CSamanCredential*&gt;          _pCredential;    // SampleV2Credential
  
  HRESULT CSamanProvider::GetCredentialAt(
      DWORD dwIndex,
      _Outptr_result_nullonfailure_ ICredentialProviderCredential** ppcpc)
  {
      HRESULT hr = E_INVALIDARG;
      *ppcpc = nullptr;
  
      hr = _pCredential[dwIndex]-&gt;QueryInterface(IID_PPV_ARGS(ppcpc));
  
      return hr;
  }
  
  
  HRESULT CSamanProvider::GetCredentialCount(
      _Out_ DWORD* pdwCount,
      _Out_ DWORD* pdwDefault,
      _Out_ BOOL* pbAutoLogonWithDefault)
  {
      *pdwDefault = CREDENTIAL_PROVIDER_NO_DEFAULT;
      *pbAutoLogonWithDefault = FALSE;
  
      if (_fRecreateEnumeratedCredentials)
      {
          _fRecreateEnumeratedCredentials = false;
          _ReleaseEnumeratedCredentials();
          _CreateEnumeratedCredentials();
      }
  
      DWORD dwUserCount = 0;
      HRESULT hr;
  
      if (_pCredProviderUserArray != nullptr) {
          hr = _pCredProviderUserArray-&gt;GetCount(&amp;dwUserCount);
      }
  
      if ((dwUserCount == 0) || (IsOS(OS_DOMAINMEMBER) == 1)) {
          dwUserCount += 1;//display additional empty tile
      }
      *pdwCount = dwUserCount;
  
      return S_OK;
  }
  
  
  void CSamanProvider::_ReleaseEnumeratedCredentials()
  {
      DWORD dwUserCount;
      _pCredProviderUserArray-&gt;GetCount(&amp;dwUserCount);
      for (DWORD i = 0; i &lt; dwUserCount; i++) {
          if (_pCredential[i] != nullptr)
          {
              _pCredential[i]-&gt;Release();
              _pCredential[i] = nullptr;
          }
      }
  }
  </code></pre>
  
  <p>So I change other place in my code but I don't get result. </p>