mirror of
https://github.com/reactos/reactos.git
synced 2025-04-21 20:50:29 +00:00
- rename NtGdiGetTextMetrics to NtGdigetTextMetricsW and add cj parameter
- GetTextMetricsAW: call NtGdigetTextMetricW with cj set to sizeof(TMW_INTERNAL), use TextMetric member - update w32ksvc.db - update ntgdibad.h svn path=/trunk/; revision=28026
This commit is contained in:
parent
380e7f70eb
commit
984be48dd5
4 changed files with 48 additions and 24 deletions
|
@ -86,14 +86,14 @@ GetTextMetricsA(
|
|||
LPTEXTMETRICA lptm
|
||||
)
|
||||
{
|
||||
TEXTMETRICW tmw;
|
||||
TMW_INTERNAL tmwi;
|
||||
|
||||
if (! NtGdiGetTextMetrics(hdc, &tmw))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (! NtGdiGetTextMetricsW(hdc, &tmwi, sizeof(TMW_INTERNAL)))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TextMetricW2A(lptm, &tmw);
|
||||
return TextMetricW2A(lptm, &tmwi.TextMetric);
|
||||
}
|
||||
|
||||
|
||||
|
@ -107,7 +107,15 @@ GetTextMetricsW(
|
|||
LPTEXTMETRICW lptm
|
||||
)
|
||||
{
|
||||
return NtGdiGetTextMetrics(hdc, lptm);
|
||||
TMW_INTERNAL tmwi;
|
||||
|
||||
if (! NtGdiGetTextMetricsW(hdc, &tmwi, sizeof(TMW_INTERNAL)))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
*lptm = tmwi.TextMetric;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -605,12 +605,6 @@ NtGdiGetTextCharset(HDC hDC);
|
|||
/* Needs to be done in user-mode, using shared GDI Object Attributes. */
|
||||
COLORREF STDCALL NtGdiGetTextColor(HDC hDC);
|
||||
|
||||
/* Use NtGdiGetTextMetricsW with 0 at the end */
|
||||
BOOL
|
||||
STDCALL
|
||||
NtGdiGetTextMetrics(HDC hDC,
|
||||
LPTEXTMETRICW tm);
|
||||
|
||||
/* Use NtGdiGetDCPoint with GdiGetViewPortExt */
|
||||
BOOL STDCALL NtGdiGetViewportExtEx(HDC hDC, LPSIZE viewportExt);
|
||||
|
||||
|
|
|
@ -3688,27 +3688,33 @@ NtGdiGetTextFaceW(
|
|||
return Count;
|
||||
}
|
||||
|
||||
W32KAPI
|
||||
BOOL
|
||||
STDCALL
|
||||
NtGdiGetTextMetrics(HDC hDC,
|
||||
LPTEXTMETRICW tm)
|
||||
APIENTRY
|
||||
NtGdiGetTextMetricsW(
|
||||
IN HDC hDC,
|
||||
OUT TMW_INTERNAL * pUnsafeTmwi,
|
||||
IN ULONG cj
|
||||
)
|
||||
{
|
||||
PDC dc;
|
||||
PTEXTOBJ TextObj;
|
||||
PFONTGDI FontGDI;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
TEXTMETRICW SafeTm;
|
||||
TMW_INTERNAL tmwi;
|
||||
FT_Face Face;
|
||||
TT_OS2 *pOS2;
|
||||
TT_HoriHeader *pHori;
|
||||
ULONG Error;
|
||||
|
||||
if (NULL == tm)
|
||||
if (NULL == pUnsafeTmwi)
|
||||
{
|
||||
SetLastWin32Error(STATUS_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* FIXME: check cj ? */
|
||||
|
||||
if(!(dc = DC_LockDc(hDC)))
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
|
@ -3736,7 +3742,9 @@ NtGdiGetTextMetrics(HDC hDC,
|
|||
}
|
||||
else
|
||||
{
|
||||
memcpy(&SafeTm, &FontGDI->TextMetric, sizeof(TEXTMETRICW));
|
||||
memcpy(&tmwi.TextMetric, &FontGDI->TextMetric, sizeof(TEXTMETRICW));
|
||||
/* FIXME: Fill Diff member */
|
||||
RtlZeroMemory(&tmwi.Diff, sizeof(tmwi.Diff));
|
||||
|
||||
Status = STATUS_SUCCESS;
|
||||
IntLockFreeType;
|
||||
|
@ -3757,10 +3765,24 @@ NtGdiGetTextMetrics(HDC hDC,
|
|||
IntUnLockFreeType;
|
||||
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
FillTM(&SafeTm, FontGDI->face, pOS2, pHori);
|
||||
Status = MmCopyToCaller(tm, &SafeTm, sizeof(TEXTMETRICW));
|
||||
}
|
||||
{
|
||||
FillTM(&tmwi.TextMetric, FontGDI->face, pOS2, pHori);
|
||||
|
||||
if (cj > sizeof(TMW_INTERNAL))
|
||||
cj = sizeof(TMW_INTERNAL);
|
||||
|
||||
Status = STATUS_SUCCESS;
|
||||
_SEH_TRY
|
||||
{
|
||||
ProbeForWrite(pUnsafeTmwi, cj, 1);
|
||||
RtlCopyMemory(pUnsafeTmwi,&tmwi,cj);
|
||||
}
|
||||
_SEH_HANDLE
|
||||
{
|
||||
Status = _SEH_GetExceptionCode();
|
||||
}
|
||||
_SEH_END
|
||||
}
|
||||
}
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@ NtGdiGetTextExtentExW 8
|
|||
NtGdiGetTextExtent 5
|
||||
NtGdiGetTextExtentPoint32 4
|
||||
NtGdiGetTextFaceW 4
|
||||
NtGdiGetTextMetrics 2
|
||||
NtGdiGetTextMetricsW 3
|
||||
NtGdiGetViewportExtEx 2
|
||||
NtGdiGetViewportOrgEx 2
|
||||
NtGdiGetWinMetaFileBits 5
|
||||
|
|
Loading…
Reference in a new issue