Commit 7f16f21c authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

gdi32: Add an extensive EnumFontFamilies test, fix some failures when running under Wine.

parent 7b0cde8f
......@@ -877,7 +877,11 @@ INT16 WINAPI EnumFontFamilies16( HDC16 hDC, LPCSTR lpFamily,
LOGFONT16 lf;
lf.lfCharSet = DEFAULT_CHARSET;
if( lpFamily ) lstrcpynA( lf.lfFaceName, lpFamily, LF_FACESIZE );
if (lpFamily)
{
if (!*lpFamily) return 1;
lstrcpynA( lf.lfFaceName, lpFamily, LF_FACESIZE );
}
else lf.lfFaceName[0] = '\0';
return EnumFontFamiliesEx16( hDC, &lf, efproc, lpData, 0 );
......@@ -892,7 +896,11 @@ INT WINAPI EnumFontFamiliesA( HDC hDC, LPCSTR lpFamily,
LOGFONTA lf;
lf.lfCharSet = DEFAULT_CHARSET;
if( lpFamily ) lstrcpynA( lf.lfFaceName, lpFamily, LF_FACESIZE );
if (lpFamily)
{
if (!*lpFamily) return 1;
lstrcpynA( lf.lfFaceName, lpFamily, LF_FACESIZE );
}
else lf.lfFaceName[0] = lf.lfFaceName[1] = '\0';
return EnumFontFamiliesExA( hDC, &lf, efproc, lpData, 0 );
......@@ -907,7 +915,11 @@ INT WINAPI EnumFontFamiliesW( HDC hDC, LPCWSTR lpFamily,
LOGFONTW lf;
lf.lfCharSet = DEFAULT_CHARSET;
if( lpFamily ) lstrcpynW( lf.lfFaceName, lpFamily, LF_FACESIZE );
if (lpFamily)
{
if (!*lpFamily) return 1;
lstrcpynW( lf.lfFaceName, lpFamily, LF_FACESIZE );
}
else lf.lfFaceName[0] = 0;
return EnumFontFamiliesExW( hDC, &lf, efproc, lpData, 0 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment