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
|
|
104 | 110 | private: |
105 | 111 | void error(const std::string & msg) { |
106 | 112 | char buf[80]; |
| 113 | DWORD error_code (GetLastError()); |
107 | 114 | DWORD num = FormatMessageA( |
108 | 115 | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, |
109 | 116 | NULL, |
110 | | GetLastError(), |
| 117 | error_code, |
111 | 118 | 0, |
112 | 119 | buf, |
113 | 120 | sizeof(buf), |
114 | 121 | NULL); |
| 122 | char hex_error[9]; |
| 123 | hex_error[8] = 0; |
| 124 | _snprintf (hex_error, sizeof (hex_error), "%08x", error_code); |
115 | 125 | |
116 | 126 | throw std::invalid_argument("boost::random_device: " + msg + |
117 | | " Cryptopraphic Service Provider " + provider + |
118 | | ": " + std::string(&buf[0], &buf[0] + num)); |
| 127 | ": " + hex_error + " " + std::string(&buf[0], &buf[0] + num) + |
| 128 | " (Cryptographic Service Provider: " + provider + ")"); |
119 | 129 | } |
120 | 130 | const std::string provider; |
121 | 131 | HCRYPTPROV hProv; |