10 #if defined( INC_ALL )
36 DEBUG_DIAG((
"Error exit was passed argError status" ));
60 memset( errorInfoPtr, 0,
sizeof(
ERROR_INFO ) );
73 errorInfoPtr->errorStringLength = \
76 if( errorInfoPtr->errorStringLength <= 0 || \
82 "(Couldn't record error information)", 35 );
99 const char *extErrorString,
101 const int extErrorStringLength )
104 assert(
isReadPtr( extErrorString, extErrorStringLength ) );
106 REQUIRES_V( errorInfoPtr->errorStringLength > 0 && \
111 if( errorInfoPtr->errorStringLength + \
116 memcpy( errorInfoPtr->errorString + errorInfoPtr->errorStringLength,
117 extErrorString, extErrorStringLength );
118 errorInfoPtr->errorStringLength += extErrorStringLength;
136 memset( errorInfoPtr, 0,
sizeof(
ERROR_INFO ) );
149 memset( errorInfoPtr, 0,
sizeof(
ERROR_INFO ) );
158 string =
"(Couldn't record error information)";
162 memcpy( errorInfoPtr->errorString,
string, length );
163 errorInfoPtr->errorStringLength =
length;
176 memset( destErrorInfoPtr, 0,
sizeof(
ERROR_INFO ) );
177 if( srcErrorInfoPtr->errorStringLength > 0 )
180 srcErrorInfoPtr->errorStringLength );
205 const int localStatus = convertErrorStatus( status );
213 memset( errorInfoPtr, 0,
sizeof(
ERROR_INFO ) );
215 va_start( argPtr, format );
216 formatErrorString( errorInfoPtr, format, argPtr );
219 return( localStatus );
239 memset( errorInfoPtr, 0,
sizeof(
ERROR_INFO ) );
241 va_start( argPtr, format );
242 formatErrorString( errorInfoPtr, format, argPtr );
256 char extraErrorString[ MAX_ERRMSG_SIZE + 8 ];
257 const int localStatus = convertErrorStatus( status );
259 int errorStringLength, extErrorStatus, extErrorStringLength;
269 memset( errorInfoPtr, 0,
sizeof(
ERROR_INFO ) );
272 va_start( argPtr, format );
273 errorStringOK = formatErrorString( errorInfoPtr, format, argPtr );
279 return( localStatus );
281 errorStringLength = errorInfoPtr->errorStringLength;
282 ENSURES( errorStringLength > 0 && errorStringLength < MAX_ERRMSG_SIZE );
292 return( localStatus );
294 extErrorStringLength = msgData.
length;
295 ENSURES( extErrorStringLength > 0 && \
296 extErrorStringLength < MAX_ERRMSG_SIZE );
300 if( errorStringLength + extErrorStringLength < MAX_ERRMSG_SIZE - 32 )
304 memcpy( errorInfoPtr->errorString + errorStringLength,
305 ". Additional information: ", 26 );
306 memcpy( errorInfoPtr->errorString + errorStringLength + 26,
307 extraErrorString, extErrorStringLength );
308 errorInfoPtr->errorStringLength += 26 + extErrorStringLength;
311 return( localStatus );
322 const int localStatus = convertErrorStatus( status );
326 assert(
isReadPtr( extErrorString, extErrorStringLength ) );
330 REQUIRES( extErrorStringLength > 0 && \
331 extErrorStringLength < MAX_ERRMSG_SIZE );
334 memset( errorInfoPtr, 0,
sizeof(
ERROR_INFO ) );
337 va_start( argPtr, format );
338 errorStringOK = formatErrorString( errorInfoPtr, format, argPtr );
344 return( localStatus );
348 appendErrorString( errorInfoPtr, extErrorString, extErrorStringLength );
349 return( localStatus );
359 const int localStatus = convertErrorStatus( status );
360 char extErrorString[ MAX_ERRMSG_SIZE + 8 ];
362 int extErrorStringLength;
365 memset( errorInfoPtr, 0,
sizeof(
ERROR_INFO ) );
374 if( existingErrorInfoPtr->errorStringLength > 0 && \
375 existingErrorInfoPtr->errorStringLength < MAX_ERRMSG_SIZE )
377 memcpy( extErrorString, existingErrorInfoPtr->errorString,
378 existingErrorInfoPtr->errorStringLength );
379 extErrorStringLength = existingErrorInfoPtr->errorStringLength;
383 memcpy( extErrorString,
"(No additional information)", 27 );
384 extErrorStringLength = 27;
386 ENSURES( extErrorStringLength > 0 && \
387 extErrorStringLength < MAX_ERRMSG_SIZE );
390 va_start( argPtr, format );
391 errorStringOK = formatErrorString( errorInfoPtr, format, argPtr );
397 return( localStatus );
401 appendErrorString( errorInfoPtr, extErrorString, extErrorStringLength );
402 return( localStatus );
411 const int localStatus = convertErrorStatus( status );
412 char extErrorString[ MAX_ERRMSG_SIZE + 8 ];
413 int extErrorStringLength;
419 va_start( argPtr, format );
420 extErrorStringLength =
vsprintf_s( extErrorString, MAX_ERRMSG_SIZE,
423 if( extErrorStringLength <= 0 || extErrorStringLength > MAX_ERRMSG_SIZE )
428 "(Couldn't record error information)", 35 );
429 return( localStatus );
433 appendErrorString( errorInfoPtr, extErrorString, extErrorStringLength );
434 return( localStatus );
455 memset( destErrorInfoPtr, 0,
sizeof(
ERROR_INFO ) );
456 destErrorInfoPtr->errorCode = srcErrorInfoPtr->
errorCode;