title: CryptGenRandom is giving same value while calling in loop
body: <p>Sorry, I cant use separate class for this and I tried to build following code and getting same output when calling from out side in loop.                               </p>
  
  <pre><code>unsigned int crypt_rand()
  {
      HCRYPTPROV hProvider = 0;
      const DWORD dwLength = sizeof(unsigned int);
      unsigned int pbBuffer[dwLength] = {};
  
      if (!::CryptAcquireContext(&amp;hProvider, 0, 0, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT))
          return 1;
      if (!::CryptGenRandom(hProvider, sizeof(unsigned int), reinterpret_cast&lt;PBYTE&gt;(&amp;pbBuffer)))
      {
          ::CryptReleaseContext(hProvider, 0);
          return 1;
      }
      if (!::CryptReleaseContext(hProvider, 0))
          return 1;
      return (unsigned int)pbBuffer;
  
  }                                      
  </code></pre>
  
  <p>If I am calling this function from loop getting same output every time.Is it anything I can give like input as time in this method.Can you plz help me on this?</p>
  
  <pre><code>for (DWORD i = 0; i &lt; 5; ++i)
      {
          rand_no = crypt_rand();
          std::cout &lt;&lt; "windows::"&lt;&lt;i&lt;&lt;"::"&lt;&lt;rand_no&lt;&lt; std::endl;
      }
  </code></pre>
  
  <p>Output is</p>
  
  <pre><code>windows::0::4519964
  windows::1::4519964
  windows::2::4519964
  windows::3::4519964
  windows::4::4519964
  </code></pre>