mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-31 00:48:16 +02:00
simplify use of winW32Error function
This commit is contained in:
parent
2fcb025e5e
commit
8a073b2292
3 changed files with 13 additions and 6 deletions
|
|
@ -369,7 +369,7 @@ winLoadCursor (ScreenPtr pScreen, CursorPtr pCursor, int screen)
|
|||
hCursor = (HCURSOR) CreateIconIndirect( &ii );
|
||||
|
||||
if (hCursor == NULL)
|
||||
winW32Error(2, GetLastError(), "winLoadCursor - CreateIconIndirect failed: %s\n");
|
||||
winW32Error(2, "winLoadCursor - CreateIconIndirect failed:");
|
||||
else
|
||||
{
|
||||
if (GetIconInfo(hCursor, &ii))
|
||||
|
|
@ -386,7 +386,7 @@ winLoadCursor (ScreenPtr pScreen, CursorPtr pCursor, int screen)
|
|||
hCursor = (HCURSOR) CreateIconIndirect( &ii );
|
||||
|
||||
if (hCursor == NULL)
|
||||
winW32Error(2, GetLastError(), "winLoadCursor - CreateIconIndirect failed: %s\n");
|
||||
winW32Error(2, "winLoadCursor - CreateIconIndirect failed:");
|
||||
}
|
||||
/* GetIconInfo creates new bitmaps. Destroy them again */
|
||||
if (ii.hbmMask)
|
||||
|
|
@ -412,7 +412,7 @@ winLoadCursor (ScreenPtr pScreen, CursorPtr pCursor, int screen)
|
|||
pScreenPriv->cursor.sm_cx, pScreenPriv->cursor.sm_cy,
|
||||
pAnd, pXor);
|
||||
if (hCursor == NULL)
|
||||
winW32Error(2, GetLastError(), "winLoadCursor - CreateCursor failed: %s\n");
|
||||
winW32Error(2, "winLoadCursor - CreateCursor failed:");
|
||||
}
|
||||
free (pAnd);
|
||||
free (pXor);
|
||||
|
|
|
|||
|
|
@ -103,7 +103,13 @@ winDebug (const char *format, ...)
|
|||
}
|
||||
|
||||
void
|
||||
winW32Error(int verb, DWORD errorcode, const char *format)
|
||||
winW32Error(int verb, const char *msg)
|
||||
{
|
||||
winW32ErrorEx(verb, msg, GetLastError());
|
||||
}
|
||||
|
||||
void
|
||||
winW32ErrorEx(int verb, const char *msg, DWORD errorcode)
|
||||
{
|
||||
LPVOID buffer;
|
||||
if (!FormatMessage(
|
||||
|
|
@ -121,7 +127,7 @@ winW32Error(int verb, DWORD errorcode, const char *format)
|
|||
}
|
||||
else
|
||||
{
|
||||
winErrorFVerb(verb, format, (char *)buffer);
|
||||
winErrorFVerb(verb, "%s %s", msg, (char *)buffer);
|
||||
LocalFree(buffer);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ void winMsg (MessageType type, const char *format, ...);
|
|||
void winDebug (const char *format, ...);
|
||||
|
||||
void winErrorFVerb (int verb, const char *format, ...);
|
||||
void winW32Error(int verb, DWORD errorcode, const char *format);
|
||||
void winW32Error(int verb, const char *message);
|
||||
void winW32ErrorEx(int verb, const char *message, DWORD errorcode);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue