#include "precomp.h"
-
/*
* @implemented
*/
-
/*
* @implemented
*/
return FALSE;
}
- return TextMetricW2A(lptm, &tmwi.TextMetric);
+ FONT_TextMetricWToA(&tmwi.TextMetric, lptm);
+ return TRUE;
}
LPSIZE lpSize
)
{
- return NtGdiGetTextExtent(hdc, (LPWSTR)lpString, cchString, lpSize, 0);
+ return NtGdiGetTextExtent(hdc, (LPWSTR)lpString, cchString, lpSize, 1);
}
LPSIZE lpSize
)
{
+
+ if(nMaxExtent < -1)
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+
return NtGdiGetTextExtentExW (
hdc, (LPWSTR)lpszStr, cchString, nMaxExtent, (PULONG)lpnFit, (PULONG)alpDx, lpSize, 0 );
}
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));
WINAPI
GetTextFaceA( HDC hdc, INT count, LPSTR name )
{
- INT res = GetTextFaceW(hdc, 0, NULL);
- LPWSTR nameW = HeapAlloc( GetProcessHeap(), 0, res * 2 );
+ INT res;
+ LPWSTR nameW;
+
+ /* Validate parameters */
+ if (name && count <= 0)
+ {
+ /* Set last error and return failure */
+ GdiSetLastError(ERROR_INVALID_PARAMETER);
+ return 0;
+ }
+
+ res = GetTextFaceW(hdc, 0, NULL);
+ nameW = HeapAlloc( GetProcessHeap(), 0, res * 2 );
+ if (nameW == NULL)
+ {
+ return 0;
+ }
GetTextFaceW( hdc, res, nameW );
if (name)