mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 12:49:45 +00:00
gdi32: GetCharABCWidthsW should not crash on a NULL handle.
This commit is contained in:
parent
1bf5e2da0a
commit
c4f4b01b05
@ -2330,6 +2330,8 @@ BOOL WINAPI GetCharABCWidthsW( HDC hdc, UINT firstChar, UINT lastChar,
|
||||
unsigned int i;
|
||||
BOOL ret = FALSE;
|
||||
|
||||
if (!dc) return FALSE;
|
||||
|
||||
if(dc->gdiFont)
|
||||
ret = WineEngGetCharABCWidths( dc->gdiFont, firstChar, lastChar, abc );
|
||||
else
|
||||
|
@ -323,6 +323,18 @@ static void test_GdiGetCharDimensions(void)
|
||||
DeleteDC(hdc);
|
||||
}
|
||||
|
||||
static void test_GetCharABCWidthsW(void)
|
||||
{
|
||||
BOOL ret;
|
||||
ABC abc[1];
|
||||
typedef BOOL (WINAPI *fnGetCharABCWidthsW)(HDC hdc, UINT first, UINT last, LPABC abc);
|
||||
fnGetCharABCWidthsW GetCharABCWidthsW = (fnGetCharABCWidthsW)GetProcAddress(LoadLibrary("gdi32"), "GetCharABCWidthsW");
|
||||
if (!GetCharABCWidthsW) return;
|
||||
|
||||
ret = GetCharABCWidthsW(NULL, 'a', 'a', abc);
|
||||
ok(!ret, "GetCharABCWidthsW should have returned FALSE\n");
|
||||
}
|
||||
|
||||
static void test_text_extents(void)
|
||||
{
|
||||
LOGFONTA lf;
|
||||
@ -353,5 +365,6 @@ START_TEST(font)
|
||||
test_bitmap_font();
|
||||
test_bitmap_font_metrics();
|
||||
test_GdiGetCharDimensions();
|
||||
test_GetCharABCWidthsW();
|
||||
test_text_extents();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user