From 85cec6dde56b8b5f03a4167b41b0ec2658edec74 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Sun, 11 Jul 2004 02:10:48 +0000 Subject: [PATCH] - Fixed locking in NtGdiGetCharWidth32. This caused problems with AbiWord reported by Jason Filby. svn path=/trunk/; revision=10076 --- reactos/subsys/win32k/objects/text.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/reactos/subsys/win32k/objects/text.c b/reactos/subsys/win32k/objects/text.c index 03291a23cf8..41637e9e6e2 100644 --- a/reactos/subsys/win32k/objects/text.c +++ b/reactos/subsys/win32k/objects/text.c @@ -22,7 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: text.c,v 1.103 2004/07/09 20:28:20 navaraf Exp $ */ +/* $Id: text.c,v 1.104 2004/07/11 02:10:48 navaraf Exp $ */ #include #include @@ -2016,10 +2016,17 @@ NtGdiGetCharWidth32(HDC hDC, SetLastWin32Error(ERROR_INVALID_HANDLE); return FALSE; } - TextObj = TEXTOBJ_LockText(hFont); hFont = dc->w.hFont; + TextObj = TEXTOBJ_LockText(hFont); DC_UnlockDc(hDC); + if (TextObj == NULL) + { + ExFreePool(SafeBuffer); + SetLastWin32Error(ERROR_INVALID_HANDLE); + return FALSE; + } + if (!NT_SUCCESS(GetFontObjectsFromTextObj(TextObj, NULL, NULL, &FontGDI))) { ExFreePool(SafeBuffer);