#include "precomp.h"
-
/*
* @implemented
*/
BOOL
-STDCALL
+WINAPI
TextOutA(
HDC hdc,
int nXStart,
int nYStart,
LPCSTR lpString,
- int cbString)
+ int cchString)
{
ANSI_STRING StringA;
UNICODE_STRING StringU;
} else
StringU.Buffer = NULL;
- ret = TextOutW(hdc, nXStart, nYStart, StringU.Buffer, cbString);
+ ret = TextOutW(hdc, nXStart, nYStart, StringU.Buffer, cchString);
RtlFreeUnicodeString(&StringU);
return ret;
}
* @implemented
*/
BOOL
-STDCALL
+WINAPI
TextOutW(
HDC hdc,
int nXStart,
int nYStart,
LPCWSTR lpString,
- int cbString)
+ int cchString)
{
- return NtGdiExtTextOutW(hdc, nXStart, nYStart, 0, NULL, (LPWSTR)lpString, cbString, NULL, 0);
+ return NtGdiExtTextOutW(hdc, nXStart, nYStart, 0, NULL, (LPWSTR)lpString, cchString, NULL, 0);
}
* @implemented
*/
DWORD
-STDCALL
+WINAPI
GdiGetCodePage(HDC hdc)
{
PDC_ATTR Dc_Attr;
* @unimplemented
*/
int
-STDCALL
+WINAPI
GetTextCharacterExtra(
HDC hDc
)
* @implemented
*/
int
-STDCALL
+WINAPI
GetTextCharset(HDC hdc)
{
/* MSDN docs say this is equivalent */
-
/*
* @implemented
*/
BOOL
-STDCALL
+WINAPI
GetTextMetricsA(
HDC hdc,
LPTEXTMETRICA lptm
return FALSE;
}
- return TextMetricW2A(lptm, &tmwi.TextMetric);
+ FONT_TextMetricWToA(&tmwi.TextMetric, lptm);
+ return TRUE;
}
* @implemented
*/
BOOL
-STDCALL
+WINAPI
GetTextMetricsW(
HDC hdc,
LPTEXTMETRICW lptm
GetTextExtentPointA(
HDC hdc,
LPCSTR lpString,
- int cbString,
+ int cchString,
LPSIZE lpSize
)
{
RtlInitAnsiString(&StringA, (LPSTR)lpString);
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
- ret = GetTextExtentPointW(hdc, StringU.Buffer, cbString, lpSize);
+ ret = GetTextExtentPointW(hdc, StringU.Buffer, cchString, lpSize);
RtlFreeUnicodeString(&StringU);
GetTextExtentPointW(
HDC hdc,
LPCWSTR lpString,
- int cbString,
+ int cchString,
LPSIZE lpSize
)
{
- return NtGdiGetTextExtent(hdc, (LPWSTR)lpString, cbString, lpSize, 0);
+ return NtGdiGetTextExtent(hdc, (LPWSTR)lpString, cchString, lpSize, 1);
}
BOOL
APIENTRY
GetTextExtentExPointW(
- HDC hdc,
- LPCWSTR lpszStr,
- int cchString,
- int nMaxExtent,
- LPINT lpnFit,
- LPINT alpDx,
- LPSIZE lpSize
+ HDC hdc,
+ LPCWSTR lpszStr,
+ int cchString,
+ int nMaxExtent,
+ LPINT lpnFit,
+ LPINT alpDx,
+ 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));
GetTextExtentPoint32A(
HDC hdc,
LPCSTR lpString,
- int cbString,
+ int cchString,
LPSIZE lpSize
)
{
RtlInitAnsiString(&StringA, (LPSTR)lpString);
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
- ret = GetTextExtentPoint32W(hdc, StringU.Buffer, cbString, lpSize);
+ ret = GetTextExtentPoint32W(hdc, StringU.Buffer, cchString, lpSize);
RtlFreeUnicodeString(&StringU);
GetTextExtentPoint32W(
HDC hdc,
LPCWSTR lpString,
- int cbString,
+ int cchString,
LPSIZE lpSize
)
{
- return NtGdiGetTextExtent(hdc, (LPWSTR)lpString, cbString, lpSize, 0);
+ return NtGdiGetTextExtent(hdc, (LPWSTR)lpString, cchString, lpSize, 0);
}
/*
* @implemented
*/
BOOL
-STDCALL
+WINAPI
GetTextExtentExPointI(HDC hdc,
LPWORD pgiIn,
int cgi,
* @implemented
*/
BOOL
-STDCALL
+WINAPI
GetTextExtentPointI(HDC hdc,
LPWORD pgiIn,
int cgi,
* @implemented
*/
BOOL
-STDCALL
+WINAPI
ExtTextOutA(
HDC hdc,
int X,
UINT fuOptions,
CONST RECT *lprc,
LPCSTR lpString,
- UINT cbCount,
+ UINT cchString,
CONST INT *lpDx
)
{
RtlInitAnsiString(&StringA, (LPSTR)lpString);
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
- ret = ExtTextOutW(hdc, X, Y, fuOptions, lprc, StringU.Buffer, cbCount, lpDx);
+ ret = ExtTextOutW(hdc, X, Y, fuOptions, lprc, StringU.Buffer, cchString, lpDx);
RtlFreeUnicodeString(&StringU);
* @implemented
*/
BOOL
-STDCALL
+WINAPI
ExtTextOutW(
HDC hdc,
int X,
UINT fuOptions,
CONST RECT *lprc,
LPCWSTR lpString,
- UINT cbCount,
+ UINT cchString,
CONST INT *lpDx
)
{
- return NtGdiExtTextOutW(hdc, X, Y, fuOptions, (LPRECT)lprc, (LPWSTR)lpString, cbCount, (LPINT)lpDx, 0);
+ return NtGdiExtTextOutW(hdc, X, Y, fuOptions, (LPRECT)lprc, (LPWSTR)lpString, cchString, (LPINT)lpDx, 0);
}
INT nCount,
PWSTR pFaceName)
{
- INT retValue;
-
- if ((pFaceName && nCount) ||
- !(pFaceName && nCount))
- {
- retValue = NtGdiGetTextFaceW(hDC, nCount, pFaceName, 0);
- }
- else
+ /* Validate parameters */
+ if (pFaceName && nCount <= 0)
{
- SetLastError(ERROR_INVALID_PARAMETER);
- retValue = 0;
+ /* Set last error and return failure */
+ GdiSetLastError(ERROR_INVALID_PARAMETER);
+ return 0;
}
- return retValue;
+ /* Forward to kernel */
+ return NtGdiGetTextFaceW(hDC, nCount, pFaceName, FALSE);
}
* @implemented
*/
int
-STDCALL
+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)
return res;
}
+
+/*
+ * @implemented
+ */
+INT
+WINAPI
+GetTextFaceAliasW(HDC hdc,
+ int cChar,
+ LPWSTR pszOut)
+{
+ if ( pszOut && !cChar )
+ {
+ GdiSetLastError(ERROR_INVALID_PARAMETER);
+ return 0;
+ }
+ return NtGdiGetTextFaceW(hdc,cChar,pszOut,TRUE);
+}
+
+
BOOL
-STDCALL
+WINAPI
GetFontResourceInfoW(
LPCWSTR lpFileName,
DWORD *pdwBufSize,
* @unimplemented
*/
int
-STDCALL
+WINAPI
SetTextCharacterExtra(
HDC hDC,
int CharExtra
*
*/
UINT
-STDCALL
+WINAPI
GetTextAlign(HDC hdc)
{
PDC_ATTR Dc_Attr;
*
*/
COLORREF
-STDCALL
+WINAPI
GetTextColor(HDC hdc)
{
PDC_ATTR Dc_Attr;
* @unimplemented
*/
UINT
-STDCALL
+WINAPI
SetTextAlign(HDC hdc,
UINT fMode)
{
* @implemented
*/
COLORREF
-STDCALL
+WINAPI
SetTextColor(
HDC hdc,
COLORREF crColor
if ( Dc_Attr->crForegroundClr != crColor )
{
- Dc_Attr->ulDirty_ |= DIRTY_TEXT;
+ Dc_Attr->ulDirty_ |= (DIRTY_TEXT|DIRTY_LINE|DIRTY_FILL);
Dc_Attr->crForegroundClr = crColor;
}
return OldColor;
* @implemented
*/
BOOL
-STDCALL
+WINAPI
SetTextJustification(
HDC hdc,
int extra,