[WIN32SS] Fix EqualFamilyInfo function logic. Patch by Victor Martinez Calvo, modified by Katayama Hirofumi MZ.

CORE-13411 #resolve, CID 1411971

svn path=/trunk/; revision=75321
This commit is contained in:
Mark Jansen 2017-07-12 18:40:49 +00:00
parent 3841692020
commit d9827356db

View file

@ -4550,28 +4550,23 @@ IntGetFullFileName(
} }
static BOOL static BOOL
EqualFamilyInfo(FONTFAMILYINFO *pInfo1, FONTFAMILYINFO *pInfo2) EqualFamilyInfo(const FONTFAMILYINFO *pInfo1, const FONTFAMILYINFO *pInfo2)
{ {
UNICODE_STRING Str1, Str2; const ENUMLOGFONTEXW *pLog1 = &pInfo1->EnumLogFontEx;
ENUMLOGFONTEXW *pLog1 = &pInfo1->EnumLogFontEx; const ENUMLOGFONTEXW *pLog2 = &pInfo2->EnumLogFontEx;
ENUMLOGFONTEXW *pLog2 = &pInfo2->EnumLogFontEx; const LOGFONTW *plf1 = &pLog1->elfLogFont;
RtlInitUnicodeString(&Str1, pLog1->elfLogFont.lfFaceName); const LOGFONTW *plf2 = &pLog2->elfLogFont;
RtlInitUnicodeString(&Str2, pLog2->elfLogFont.lfFaceName);
if (!RtlEqualUnicodeString(&Str1, &Str2, TRUE)) if (_wcsicmp(plf1->lfFaceName, plf2->lfFaceName) != 0)
{ {
return FALSE; return FALSE;
} }
if ((pLog1->elfStyle != NULL) != (pLog2->elfStyle != NULL))
return FALSE; if (_wcsicmp(pLog1->elfStyle, pLog2->elfStyle) != 0)
if (pLog1->elfStyle != NULL)
{ {
RtlInitUnicodeString(&Str1, pLog1->elfStyle); return FALSE;
RtlInitUnicodeString(&Str2, pLog2->elfStyle);
if (!RtlEqualUnicodeString(&Str1, &Str2, TRUE))
{
return FALSE;
}
} }
return TRUE; return TRUE;
} }