diff -rub boost_1_53_0.org/libs/random/src/random_device.cpp boost_1_53_0/libs/random/src/random_device.cpp
|
old
|
new
|
|
| 68 | 68 | char buffer[80]; |
| 69 | 69 | DWORD type; |
| 70 | 70 | DWORD len; |
| | 71 | bool found (false); |
| 71 | 72 | |
| 72 | | // Find the type of the provider |
| | 73 | // Find the type of a specific provider |
| 73 | 74 | for(DWORD i = 0; ; ++i) { |
| 74 | 75 | len = sizeof(buffer); |
| 75 | 76 | if(!CryptEnumProvidersA(i, NULL, 0, &type, buffer, &len)) { |
| 76 | | error("Could not find provider name"); |
| | 77 | if (GetLastError() == ERROR_NO_MORE_ITEMS) break; |
| | 78 | continue; |
| 77 | 79 | } |
| 78 | 80 | if(buffer == provider) { |
| | 81 | found = true; |
| 79 | 82 | break; |
| 80 | 83 | } |
| 81 | 84 | } |
| | 85 | if (!found) { |
| | 86 | error("Could not find provider name"); |
| | 87 | } |
| 82 | 88 | |
| 83 | 89 | if(!CryptAcquireContextA(&hProv, NULL, provider.c_str(), type, |
| 84 | 90 | CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) { |