Commit in reactos on MAIN
iface/addsys/w32ksvc.db-11.49 -> 1.50
include/win32k/text.h-71.20 -> 1.21
lib/gdi32/misc/stubsa.c+1-351.28 -> 1.29
              /stubsw.c+1-331.25 -> 1.26
lib/gdi32/objects/font.c+68-11.1 -> 1.2
subsys/win32k/objects/text.c+3-141.82 -> 1.83
+73-91
6 modified files
- Implement GetCharWidthA/W()
- Fix memory overwrite in NtGdiGetCharWidth32()
Fixes bug #258

reactos/iface/addsys
w32ksvc.db 1.49 -> 1.50
diff -u -r1.49 -r1.50
--- w32ksvc.db	23 Mar 2004 00:18:54 -0000	1.49
+++ w32ksvc.db	23 Mar 2004 07:59:47 -0000	1.50
@@ -104,7 +104,6 @@
 NtGdiGetCharABCWidths			4
 NtGdiGetCharABCWidthsFloat		4
 NtGdiGetCharacterPlacement		6
-NtGdiGetCharWidth			4
 NtGdiGetCharWidth32			4
 NtGdiGetCharWidthFloat			4
 NtGdiGetClipBox				2

reactos/include/win32k
text.h 1.20 -> 1.21
diff -u -r1.20 -r1.21
--- text.h	23 Mar 2004 00:18:54 -0000	1.20
+++ text.h	23 Mar 2004 07:59:47 -0000	1.21
@@ -101,13 +101,6 @@
 
 BOOL
 STDCALL
-NtGdiGetCharWidth(HDC  hDC,
-                       UINT  FirstChar,
-                       UINT  LastChar,
-                       LPINT  Buffer);
-
-BOOL
-STDCALL
 NtGdiGetCharWidth32(HDC  hDC,
                          UINT  FirstChar,
                          UINT  LastChar,

reactos/lib/gdi32/misc
stubsa.c 1.28 -> 1.29
diff -u -r1.28 -r1.29
--- stubsa.c	23 Mar 2004 00:18:54 -0000	1.28
+++ stubsa.c	23 Mar 2004 07:59:47 -0000	1.29
@@ -1,4 +1,4 @@
-/* $Id: stubsa.c,v 1.28 2004/03/23 00:18:54 gvg Exp $
+/* $Id: stubsa.c,v 1.29 2004/03/23 07:59:47 gvg Exp $
  *
  * reactos/lib/gdi32/misc/stubs.c
  *
@@ -212,40 +212,6 @@
  * @unimplemented
  */
 BOOL
-STDCALL
-GetCharWidthA (
-	HDC	hdc,
-	UINT	iFirstChar,
-	UINT	iLastChar,
-	LPINT	lpBuffer
-	)
-{
-  /* FIXME what to do with iFirstChar and iLastChar ??? */
-  return NtGdiGetCharWidth ( hdc, iFirstChar, iLastChar, lpBuffer );
-}
-
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-GetCharWidth32A(
-	HDC	hdc,
-	UINT	iFirstChar,
-	UINT	iLastChar,
-	LPINT	lpBuffer
-	)
-{
-  /* FIXME what to do with iFirstChar and iLastChar ??? */
-  return NtGdiGetCharWidth32 ( hdc, iFirstChar, iLastChar, lpBuffer );
-}
-
-
-/*
- * @unimplemented
- */
-BOOL
 APIENTRY
 GetCharWidthFloatA(
 	HDC	hdc,

reactos/lib/gdi32/misc
stubsw.c 1.25 -> 1.26
diff -u -r1.25 -r1.26
--- stubsw.c	23 Mar 2004 00:18:54 -0000	1.25
+++ stubsw.c	23 Mar 2004 07:59:47 -0000	1.26
@@ -1,4 +1,4 @@
-/* $Id: stubsw.c,v 1.25 2004/03/23 00:18:54 gvg Exp $
+/* $Id: stubsw.c,v 1.26 2004/03/23 07:59:47 gvg Exp $
  *
  * reactos/lib/gdi32/misc/stubs.c
  *
@@ -137,38 +137,6 @@
  * @implemented
  */
 BOOL
-STDCALL
-GetCharWidthW (
-	HDC	hdc,
-	UINT	iFirstChar,
-	UINT	iLastChar,
-	LPINT	lpBuffer
-	)
-{
-  return NtGdiGetCharWidth ( hdc, iFirstChar, iLastChar, lpBuffer );
-}
-
-
-/*
- * @implemented
- */
-BOOL
-STDCALL
-GetCharWidth32W(
-	HDC	hdc,
-	UINT	iFirstChar,
-	UINT	iLastChar,
-	LPINT	lpBuffer
-	)
-{
-  return NtGdiGetCharWidth32 ( hdc, iFirstChar, iLastChar, lpBuffer );
-}
-
-
-/*
- * @implemented
- */
-BOOL
 APIENTRY
 GetCharWidthFloatW(
 	HDC	hdc,

reactos/lib/gdi32/objects
font.c 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- font.c	23 Mar 2004 00:18:54 -0000	1.1
+++ font.c	23 Mar 2004 07:59:47 -0000	1.2
@@ -1,4 +1,4 @@
-/* $Id: font.c,v 1.1 2004/03/23 00:18:54 gvg Exp $
+/* $Id: font.c,v 1.2 2004/03/23 07:59:47 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
@@ -15,6 +15,7 @@
 #include <windows.h>
 #include <rosrtl/logfont.h>
 #include <win32k/font.h>
+#include <win32k/text.h>
 #include <internal/font.h>
 
 #define NDEBUG
@@ -330,3 +331,69 @@
 
   return IntEnumFontFamilies(Dc, &LogFont, EnumFontFamProc, lParam, FALSE);
 }
+
+
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+GetCharWidthA (
+	HDC	hdc,
+	UINT	iFirstChar,
+	UINT	iLastChar,
+	LPINT	lpBuffer
+	)
+{
+  /* FIXME what to do with iFirstChar and iLastChar ??? */
+  return NtGdiGetCharWidth32 ( hdc, iFirstChar, iLastChar, lpBuffer );
+}
+
+
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+GetCharWidth32A(
+	HDC	hdc,
+	UINT	iFirstChar,
+	UINT	iLastChar,
+	LPINT	lpBuffer
+	)
+{
+  /* FIXME what to do with iFirstChar and iLastChar ??? */
+  return NtGdiGetCharWidth32 ( hdc, iFirstChar, iLastChar, lpBuffer );
+}
+
+
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+GetCharWidthW (
+	HDC	hdc,
+	UINT	iFirstChar,
+	UINT	iLastChar,
+	LPINT	lpBuffer
+	)
+{
+  return NtGdiGetCharWidth32 ( hdc, iFirstChar, iLastChar, lpBuffer );
+}
+
+
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+GetCharWidth32W(
+	HDC	hdc,
+	UINT	iFirstChar,
+	UINT	iLastChar,
+	LPINT	lpBuffer
+	)
+{
+  return NtGdiGetCharWidth32 ( hdc, iFirstChar, iLastChar, lpBuffer );
+}

reactos/subsys/win32k/objects
text.c 1.82 -> 1.83
diff -u -r1.82 -r1.83
--- text.c	23 Mar 2004 00:18:54 -0000	1.82
+++ text.c	23 Mar 2004 07:59:47 -0000	1.83
@@ -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.82 2004/03/23 00:18:54 gvg Exp $ */
+/* $Id: text.c,v 1.83 2004/03/23 07:59:47 gvg Exp $ */
 
 
 #undef WIN32_LEAN_AND_MEAN
@@ -1894,17 +1894,6 @@
 
 BOOL
 STDCALL
-NtGdiGetCharWidth(HDC  hDC,
-                       UINT  FirstChar,
-                       UINT  LastChar,
-                       LPINT  Buffer)
-{
-    DPRINT1("NtGdiGetCharWidth isnt really unimplemented - keep going anyway\n");
-    return 1;
-}
-
-BOOL
-STDCALL
 NtGdiGetCharWidth32(HDC  hDC,
                          UINT  FirstChar,
                          UINT  LastChar,
@@ -1924,7 +1913,7 @@
       return FALSE;
    }
 
-   BufferSize = (LastChar - FirstChar) * sizeof(INT);
+   BufferSize = (LastChar - FirstChar + 1) * sizeof(INT);
    SafeBuffer = ExAllocatePoolWithTag(PagedPool, BufferSize, TAG_GDITEXT);
    if (SafeBuffer == NULL)
    {
@@ -1982,7 +1971,7 @@
    {
       glyph_index = FT_Get_Char_Index(face, i);
       FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT);
-      SafeBuffer[i] = face->glyph->advance.x >> 6;
+      SafeBuffer[i - FirstChar] = face->glyph->advance.x >> 6;
    }
    IntUnLockFreeType;
    TEXTOBJ_UnlockText(dc->w.hFont);
CVSspam 0.2.8