From 862b82f3fac4ab952c556ffdfde6b8164cd3117c Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Wed, 31 Jan 2018 12:34:41 +0100 Subject: [PATCH] [WIN32K:NTGDI] Fix more uses of RtlCreateUnicodeString. CORE-14271 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Addendum to 7f687154a0fe47826d8047f1a4f9cfd93414d45f. Spotted by Hermès. --- win32ss/gdi/ntgdi/freetype.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c index 7f24ba90dd6..392e338633a 100644 --- a/win32ss/gdi/ntgdi/freetype.c +++ b/win32ss/gdi/ntgdi/freetype.c @@ -391,10 +391,11 @@ IntLoadFontSubstList(PLIST_ENTRY pHead) pch = (LPWSTR)((PUCHAR)pInfo + pInfo->DataOffset); Length = pInfo->DataLength / sizeof(WCHAR); pch[Length] = UNICODE_NULL; /* truncate */ - Status = RtlCreateUnicodeString(&ToW, pch); - if (!NT_SUCCESS(Status)) + Success = RtlCreateUnicodeString(&ToW, pch); + if (!Success) { - DPRINT("RtlCreateUnicodeString failed: 0x%08X\n", Status); + Status = STATUS_INSUFFICIENT_RESOURCES; + DPRINT("RtlCreateUnicodeString failed\n"); RtlFreeUnicodeString(&FromW); break; /* failure */ } @@ -2193,7 +2194,14 @@ IntGetFontLocalizedName(PUNICODE_STRING pNameW, PSHARED_FACE SharedFace, /* Convert UTF-16 big endian to little endian */ SwapEndian(Buf, Name.string_len); - Status = RtlCreateUnicodeString(pNameW, Buf); + if (RtlCreateUnicodeString(pNameW, Buf)) + { + Status = STATUS_SUCCESS; + } + else + { + Status = STATUS_INSUFFICIENT_RESOURCES; + } } }