https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7fe6a14ede49276cd934b…
commit 7fe6a14ede49276cd934bca9f36bad314689ad09
Author: Baruch Rutman <peterooch(a)gmail.com>
AuthorDate: Mon Jun 18 14:52:57 2018 +0300
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Fri Jul 27 00:47:14 2018 +0200
[LPK] Diverse fixes (#622).
- Changed wcspy to strsafe function.
- Use GetCharWidthI instead of GetCharWidth32W if dealing with glyph indices.
---
dll/win32/lpk/lpk.c | 6 +++---
dll/win32/lpk/ros_lpk.h | 1 +
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/dll/win32/lpk/lpk.c b/dll/win32/lpk/lpk.c
index 656808ea5b..85e2e8faf4 100644
--- a/dll/win32/lpk/lpk.c
+++ b/dll/win32/lpk/lpk.c
@@ -145,7 +145,7 @@ LpkGetCharacterPlacement(
if (lpResults->lpGlyphs)
{
if (lpGlyphs)
- wcscpy(lpResults->lpGlyphs, lpGlyphs);
+ StringCchCopyW(lpResults->lpGlyphs, cGlyphs, lpGlyphs);
else if (lpResults->lpOutString)
GetGlyphIndicesW(hdc, lpResults->lpOutString, nSet,
lpResults->lpGlyphs, 0);
@@ -154,7 +154,7 @@ LpkGetCharacterPlacement(
if (lpResults->lpDx)
{
/* If glyph shaping was requested */
- if(dwFlags & GCP_GLYPHSHAPE)
+ if (dwFlags & GCP_GLYPHSHAPE)
{
int c;
@@ -162,7 +162,7 @@ LpkGetCharacterPlacement(
{
for (i = 0; i < lpResults->nGlyphs; i++)
{
- if (GetCharWidth32W(hdc, lpResults->lpGlyphs[i],
lpResults->lpGlyphs[i], &c))
+ if (GetCharWidthI(hdc, 0, 1, (WORD *)&lpResults->lpGlyphs[i],
&c))
lpResults->lpDx[i] = c;
}
}
diff --git a/dll/win32/lpk/ros_lpk.h b/dll/win32/lpk/ros_lpk.h
index d82a4498bc..0fb1fe341d 100644
--- a/dll/win32/lpk/ros_lpk.h
+++ b/dll/win32/lpk/ros_lpk.h
@@ -17,6 +17,7 @@
#include <wingdi.h>
#include <winnls.h>
#include <usp10.h>
+#include <strsafe.h>
/* FIXME USP10 api that does not have prototype in any include file */
VOID WINAPI LpkPresent(VOID);