[GDI32]
[reactos.git] / reactos / dll / win32 / gdi32 / objects / text.c
index c676368..d64e012 100644 (file)
@@ -173,7 +173,7 @@ GetTextExtentPointW(
        LPSIZE          lpSize
        )
 {
-  return NtGdiGetTextExtent(hdc, (LPWSTR)lpString, cchString, lpSize, 0);
+  return NtGdiGetTextExtent(hdc, (LPWSTR)lpString, cchString, lpSize, 1);
 }
 
 
@@ -192,6 +192,13 @@ GetTextExtentExPointW(
        LPSIZE  lpSize
        )
 {
+
+  if(nMaxExtent < -1)
+  {
+    SetLastError(ERROR_INVALID_PARAMETER);
+    return FALSE;
+  }
+
   return NtGdiGetTextExtentExW (
     hdc, (LPWSTR)lpszStr, cchString, nMaxExtent, (PULONG)lpnFit, (PULONG)alpDx, lpSize, 0 );
 }
@@ -216,6 +223,12 @@ GetTextExtentExPointA(
   LPWSTR lpszStrW;
   BOOL rc = 0;
 
+  if(nMaxExtent < -1)
+  {
+    SetLastError(ERROR_INVALID_PARAMETER);
+    return FALSE;
+  }
+
   Status = HEAP_strdupA2W ( &lpszStrW, lpszStr );
   if (!NT_SUCCESS (Status))
     SetLastError (RtlNtStatusToDosError(Status));
@@ -395,6 +408,10 @@ GetTextFaceA( HDC hdc, INT count, LPSTR name )
 
     res = GetTextFaceW(hdc, 0, NULL);
     nameW = HeapAlloc( GetProcessHeap(), 0, res * 2 );
+    if (nameW == NULL)
+    {
+        return 0;
+    }
     GetTextFaceW( hdc, res, nameW );
 
     if (name)