| 189 | |
| 190 | #if defined(__WIN__) |
| 191 | static my_bool print_win_error_msg(DWORD error, my_bool verbose) |
| 192 | { |
| 193 | LPTSTR s; |
| 194 | if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | |
| 195 | FORMAT_MESSAGE_FROM_SYSTEM, |
| 196 | NULL, error, 0, (LPTSTR)&s, 0, |
| 197 | NULL)) |
| 198 | { |
| 199 | if (verbose) |
| 200 | printf("Win32 error code %d: %s", error, s); |
| 201 | else |
| 202 | puts(s); |
| 203 | LocalFree(s); |
| 204 | return 0; |
| 205 | } |
| 206 | return 1; |
| 207 | } |
| 208 | #endif |
| 209 | |
| 210 | /* |