https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d84b76a69e3e57264860f…
commit d84b76a69e3e57264860fa2fc3245f6f02dac9ec
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Wed Sep 14 20:53:04 2022 +0200
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Sep 18 20:51:12 2022 +0200
[GDI32] Fix ExtTextOutA with ETO_GLYPH_INDEX
CORE-18365
---
win32ss/gdi/gdi32/objects/text.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/win32ss/gdi/gdi32/objects/text.c b/win32ss/gdi/gdi32/objects/text.c
index 2a3831aff27..4ba8c9a5d4d 100644
--- a/win32ss/gdi/gdi32/objects/text.c
+++ b/win32ss/gdi/gdi32/objects/text.c
@@ -465,9 +465,16 @@ ExtTextOutA(
UNICODE_STRING StringU;
BOOL ret;
- RtlInitAnsiString(&StringA, (LPSTR)lpString);
+ if (fuOptions & ETO_GLYPH_INDEX)
+ return ExtTextOutW(hdc, x, y, fuOptions, lprc, (LPCWSTR)lpString, cch, lpDx);
+
+ StringA.Buffer = (PCHAR)lpString;
+ StringA.Length = StringA.MaximumLength = cch;
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
+ if (StringU.Length != StringA.Length * sizeof(WCHAR))
+ DPRINT1("ERROR: Should convert lpDx properly!\n");
+
ret = ExtTextOutW(hdc, x, y, fuOptions, lprc, StringU.Buffer, cch, lpDx);
RtlFreeUnicodeString(&StringU);