+ /* acquire default encryption context */
+ if( CryptAcquireContext(
+ &hProv, // Variable to hold returned handle.
+ NULL, // Use default key container.
+ MS_DEF_PROV, // Use default CSP.
+ PROV_RSA_FULL, // Type of provider to acquire.
+ 0) )
+ {
+ /* fill buffer with pseudo-random data, intial buffer content
+ is used as auxillary random seed */
+ CryptGenRandom(hProv, len, buf);
+ CryptReleaseContext(hProv, 0);