mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 22:55:41 +00:00
[WINESYNC]d3dx9_36: Support NULL terminated strings in ID3DXFont_DrawText
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> wine-staging patch by Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
This commit is contained in:
parent
54240ccee0
commit
219ef2e81f
3 changed files with 146 additions and 2 deletions
|
@ -213,9 +213,12 @@ static INT WINAPI ID3DXFontImpl_DrawTextA(ID3DXFont *iface, ID3DXSprite *sprite,
|
|||
TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x\n",
|
||||
iface, sprite, debugstr_a(string), count, wine_dbgstr_rect(rect), format, color);
|
||||
|
||||
if (!string || count <= 0)
|
||||
if (!string || count == 0)
|
||||
return 0;
|
||||
|
||||
if (count < 0)
|
||||
count = -1;
|
||||
|
||||
countW = MultiByteToWideChar(CP_ACP, 0, string, count, NULL, 0);
|
||||
stringW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR));
|
||||
if (stringW)
|
||||
|
@ -238,9 +241,12 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
|
|||
TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x\n",
|
||||
iface, sprite, debugstr_w(string), count, wine_dbgstr_rect(rect), format, color);
|
||||
|
||||
if (!string || count <= 0)
|
||||
if (!string || count == 0)
|
||||
return 0;
|
||||
|
||||
if (count < 0)
|
||||
count = lstrlenW(string);
|
||||
|
||||
/* Strip terminating NULL characters */
|
||||
while (count > 0 && !string[count-1])
|
||||
count--;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue