MCPcopy Create free account
hub / github.com/boostorg/build / reportWindowsError

Function reportWindowsError

v2/engine/execnt.c:1207–1229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1205 */
1206
1207static void reportWindowsError( char const * const apiName )
1208{
1209 char * errorMessage;
1210 DWORD const errorCode = GetLastError();
1211 DWORD apiResult = FormatMessageA(
1212 FORMAT_MESSAGE_ALLOCATE_BUFFER | /* __in DWORD dwFlags */
1213 FORMAT_MESSAGE_FROM_SYSTEM |
1214 FORMAT_MESSAGE_IGNORE_INSERTS,
1215 NULL, /* __in_opt LPCVOID lpSource */
1216 errorCode, /* __in DWORD dwMessageId */
1217 0, /* __in DWORD dwLanguageId */
1218 (LPSTR)&errorMessage, /* __out LPTSTR lpBuffer */
1219 0, /* __in DWORD nSize */
1220 0 ); /* __in_opt va_list * Arguments */
1221 if ( !apiResult )
1222 printf( "%s() Windows API failed: %d.\n", apiName, errorCode );
1223 else
1224 {
1225 printf( "%s() Windows API failed: %d - %s\n", apiName, errorCode,
1226 errorMessage );
1227 LocalFree( errorMessage );
1228 }
1229}
1230
1231
1232#endif /* USE_EXECNT */

Callers 1

invoke_cmdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected