move logLastError

This commit is contained in:
ehouse 2004-01-30 05:45:23 +00:00
parent 5528dc305f
commit 94ea85eac8

View file

@ -339,42 +339,6 @@ ce_draw_clearRect( DrawCtx* p_dctx, XP_Rect* rectP )
ceClearToBkground( (CEDrawCtx*)p_dctx, rectP );
} /* ce_draw_clearRect */
#ifdef DEBUG
static void
logLastError()
{
LPVOID lpMsgBuf;
DWORD lastErr = GetLastError();
XP_UCHAR msg[256];
XP_U16 len;
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
lastErr,
0, // Default language
(LPTSTR) &lpMsgBuf,
0,
NULL
);
len = wcslen( lpMsgBuf );
if ( len >= sizeof(msg) ) {
len = sizeof(msg) - 1;
}
WideCharToMultiByte( CP_ACP, 0, lpMsgBuf, len + 1,
msg, len + 1, NULL, NULL );
LocalFree( lpMsgBuf );
XP_LOGF( "system error: %s", msg );
} /* logLastError */
#else
# define logLastError()
#endif
static void
ceDrawBitmapInRect( HDC hdc, XP_U32 x, XP_U32 y, HBITMAP bitmap )
{
@ -388,7 +352,7 @@ ceDrawBitmapInRect( HDC hdc, XP_U32 x, XP_U32 y, HBITMAP bitmap )
nBytes = GetObject( bitmap, sizeof(bmp), &bmp );
XP_ASSERT( nBytes > 0 );
if ( nBytes == 0 ) {
logLastError();
logLastError( "ceDrawBitmapInRect:GetObject" );
}
BitBlt( hdc, x, y, bmp.bmWidth, bmp.bmHeight,