| 1330 | */ |
| 1331 | |
| 1332 | static void wf_report_error(char* wszMessage, DWORD dwErrCode) |
| 1333 | { |
| 1334 | LPSTR pwszMsgBuf = NULL; |
| 1335 | |
| 1336 | if (NULL != wszMessage && 0 != *wszMessage) |
| 1337 | { |
| 1338 | WLog_ERR(TAG, "%s", wszMessage); |
| 1339 | } |
| 1340 | |
| 1341 | FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, |
| 1342 | NULL, // Location of message |
| 1343 | // definition ignored |
| 1344 | dwErrCode, // Message identifier for |
| 1345 | // the requested message |
| 1346 | MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Language identifier for |
| 1347 | // the requested message |
| 1348 | (LPSTR)&pwszMsgBuf, // Buffer that receives |
| 1349 | // the formatted message |
| 1350 | 0, // Size of output buffer |
| 1351 | // not needed as allocate |
| 1352 | // buffer flag is set |
| 1353 | NULL // Array of insert values |
| 1354 | ); |
| 1355 | |
| 1356 | if (NULL != pwszMsgBuf) |
| 1357 | { |
| 1358 | WLog_ERR(TAG, "Error: 0x%08x (%d) %s", dwErrCode, dwErrCode, pwszMsgBuf); |
| 1359 | LocalFree(pwszMsgBuf); |
| 1360 | } |
| 1361 | else |
| 1362 | { |
| 1363 | WLog_ERR(TAG, "Error: 0x%08x (%d)", dwErrCode, dwErrCode); |
| 1364 | } |
| 1365 | } |
| 1366 | |
| 1367 | static DWORD wf_is_x509_certificate_trusted(const char* common_name, const char* subject, |
| 1368 | const char* issuer, const char* fingerprint) |
no outgoing calls
no test coverage detected