gdi32: Correctly propagate the enumproc's return value.
This commit is contained in:
parent
1726427113
commit
41fb856961
|
@ -121,6 +121,7 @@ struct font_enum
|
||||||
LPARAM lpData;
|
LPARAM lpData;
|
||||||
BOOL unicode;
|
BOOL unicode;
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
|
INT retval;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -721,6 +722,7 @@ static INT CALLBACK FONT_EnumInstance( const LOGFONTW *plf, const TEXTMETRICW *p
|
||||||
ptm = (TEXTMETRICW *)&tmA;
|
ptm = (TEXTMETRICW *)&tmA;
|
||||||
}
|
}
|
||||||
ret = pfe->lpEnumFunc( plf, ptm, fType, pfe->lpData );
|
ret = pfe->lpEnumFunc( plf, ptm, fType, pfe->lpData );
|
||||||
|
pfe->retval = ret;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -745,10 +747,11 @@ static INT FONT_EnumFontFamiliesEx( HDC hDC, LPLOGFONTW plf, FONTENUMPROCW efpro
|
||||||
fe.lpData = lParam;
|
fe.lpData = lParam;
|
||||||
fe.unicode = unicode;
|
fe.unicode = unicode;
|
||||||
fe.hdc = hDC;
|
fe.hdc = hDC;
|
||||||
|
fe.retval = 1;
|
||||||
ret = physdev->funcs->pEnumFonts( physdev, plf, FONT_EnumInstance, (LPARAM)&fe );
|
ret = physdev->funcs->pEnumFonts( physdev, plf, FONT_EnumInstance, (LPARAM)&fe );
|
||||||
release_dc_ptr( dc );
|
release_dc_ptr( dc );
|
||||||
}
|
}
|
||||||
return ret;
|
return ret ? fe.retval : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
|
@ -3756,6 +3756,11 @@ static INT CALLBACK enum_all_fonts_proc(const LOGFONT *elf, const TEXTMETRIC *nt
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static INT CALLBACK enum_with_magic_retval_proc(const LOGFONT *elf, const TEXTMETRIC *ntm, DWORD type, LPARAM lparam)
|
||||||
|
{
|
||||||
|
return lparam;
|
||||||
|
}
|
||||||
|
|
||||||
static void test_EnumFonts(void)
|
static void test_EnumFonts(void)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -3777,6 +3782,10 @@ static void test_EnumFonts(void)
|
||||||
|
|
||||||
hdc = CreateCompatibleDC(0);
|
hdc = CreateCompatibleDC(0);
|
||||||
|
|
||||||
|
/* check that the enumproc's retval is returned */
|
||||||
|
ret = EnumFontFamilies(hdc, NULL, enum_with_magic_retval_proc, 0xcafe);
|
||||||
|
ok(ret == 0xcafe, "got %08x\n", ret);
|
||||||
|
|
||||||
ret = EnumFontFamilies(hdc, "Arial", enum_fonts_proc, (LPARAM)&lf);
|
ret = EnumFontFamilies(hdc, "Arial", enum_fonts_proc, (LPARAM)&lf);
|
||||||
ok(!ret, "font Arial is not enumerated\n");
|
ok(!ret, "font Arial is not enumerated\n");
|
||||||
ret = strcmp(lf.lfFaceName, "Arial");
|
ret = strcmp(lf.lfFaceName, "Arial");
|
||||||
|
|
Loading…
Reference in New Issue