[GDI32][NTGDI][SDK] Font/Text: Fix SAL2 annotations and const-ness (#7865)

I want to work in correct type info.
JIRA issue: CORE-17684
- Add and fix SAL2 annotations.
- Fix const-ness of function
  parameters.
- Delete needless type casts.
This commit is contained in:
Katayama Hirofumi MZ 2025-05-06 15:13:04 +09:00 committed by GitHub
parent 530d26a1f4
commit 0ca6002b4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 312 additions and 300 deletions

View file

@ -151,7 +151,7 @@ W32KAPI
BOOL BOOL
APIENTRY APIENTRY
NtGdiGetFontResourceInfoInternalW( NtGdiGetFontResourceInfoInternalW(
_In_reads_z_(cwc) LPWSTR pwszFiles, _In_reads_z_(cwc) PCWCH pwszFiles,
_In_ ULONG cwc, _In_ ULONG cwc,
_In_ ULONG cFiles, _In_ ULONG cFiles,
_In_ UINT cjBuf, _In_ UINT cjBuf,
@ -165,9 +165,9 @@ DWORD
APIENTRY APIENTRY
NtGdiGetGlyphIndicesW( NtGdiGetGlyphIndicesW(
_In_ HDC hdc, _In_ HDC hdc,
_In_reads_opt_(cwc) LPCWSTR pwc, _In_reads_opt_(cwc) PCWCH pwc,
_In_ INT cwc, _In_ INT cwc,
_Out_writes_opt_(cwc) LPWORD pgi, _Out_writes_opt_(cwc) PWORD pgi,
_In_ DWORD iMode); _In_ DWORD iMode);
__kernel_entry __kernel_entry
@ -176,9 +176,9 @@ DWORD
APIENTRY APIENTRY
NtGdiGetGlyphIndicesWInternal( NtGdiGetGlyphIndicesWInternal(
_In_ HDC hdc, _In_ HDC hdc,
_In_reads_opt_(cwc) LPWSTR pwc, _In_reads_opt_(cwc) PCWCH pwc,
_In_ INT cwc, _In_ INT cwc,
_Out_writes_opt_(cwc) LPWORD pgi, _Out_writes_opt_(cwc) PWORD pgi,
_In_ DWORD iMode, _In_ DWORD iMode,
_In_ BOOL bSubset); _In_ BOOL bSubset);
@ -235,8 +235,8 @@ APIENTRY
NtGdiGetOutlineTextMetricsInternalW( NtGdiGetOutlineTextMetricsInternalW(
_In_ HDC hdc, _In_ HDC hdc,
_In_ ULONG cjotm, _In_ ULONG cjotm,
_Out_writes_bytes_opt_(cjotm) OUTLINETEXTMETRICW *potmw, _Out_writes_bytes_opt_(cjotm) POUTLINETEXTMETRICW potmw,
_Out_ TMDIFF *ptmd); _Out_ PTMDIFF ptmd);
_Success_(return != FALSE) _Success_(return != FALSE)
__kernel_entry __kernel_entry
@ -342,11 +342,11 @@ W32KAPI
HANDLE HANDLE
APIENTRY APIENTRY
NtGdiAddFontMemResourceEx( NtGdiAddFontMemResourceEx(
_In_reads_bytes_(cjBuffer) PVOID pvBuffer, _In_reads_bytes_(cjBuffer) const VOID *pvBuffer,
_In_ DWORD cjBuffer, _In_ DWORD cjBuffer,
_In_reads_bytes_opt_(cjDV) DESIGNVECTOR *pdv, _In_reads_bytes_opt_(cjDV) const DESIGNVECTOR *pdv,
_In_ ULONG cjDV, _In_ ULONG cjDV,
_Out_ DWORD *pNumFonts); _Out_ PDWORD pNumFonts);
__kernel_entry __kernel_entry
W32KAPI W32KAPI
@ -1598,12 +1598,12 @@ W32KAPI
BOOL BOOL
APIENTRY APIENTRY
NtGdiRemoveFontResourceW( NtGdiRemoveFontResourceW(
_In_reads_(cwc) WCHAR *pwszFiles, _In_reads_(cwc) PCWCH pwszFiles,
_In_ ULONG cwc, _In_ ULONG cwc,
_In_ ULONG cFiles, _In_ ULONG cFiles,
_In_ ULONG fl, _In_ ULONG fl,
_In_ DWORD dwPidTid, _In_ DWORD dwPidTid,
_In_opt_ DESIGNVECTOR *pdv); _In_opt_ const DESIGNVECTOR *pdv);
__kernel_entry __kernel_entry
W32KAPI W32KAPI
@ -1663,12 +1663,12 @@ BOOL
APIENTRY APIENTRY
NtGdiGetTextExtentExW( NtGdiGetTextExtentExW(
_In_ HDC hdc, _In_ HDC hdc,
_In_reads_opt_(cwc) LPWSTR pwsz, _In_reads_opt_(cwc) PCWCH pwsz,
_In_ ULONG cwc, _In_ ULONG cwc,
_In_ ULONG dxMax, _In_ ULONG dxMax,
_Out_opt_ ULONG *pcCh, _Out_opt_ PULONG pcCh,
_Out_writes_to_opt_(cwc, *pcCh) PULONG pdxOut, _Out_writes_to_opt_(cwc, *pcCh) PULONG pdxOut,
_Out_ LPSIZE psize, _Out_ PSIZE psize,
_In_ FLONG fl); _In_ FLONG fl);
__kernel_entry __kernel_entry
@ -1679,7 +1679,7 @@ NtGdiGetCharABCWidthsW(
_In_ HDC hdc, _In_ HDC hdc,
_In_ UINT wchFirst, _In_ UINT wchFirst,
_In_ ULONG cwch, _In_ ULONG cwch,
_In_reads_opt_(cwch) PWCHAR pwch, _In_reads_opt_(cwch) PCWCH pwch,
_In_ FLONG fl, _In_ FLONG fl,
_Out_writes_bytes_(cwch * sizeof(ABC)) PVOID pvBuf); _Out_writes_bytes_(cwch * sizeof(ABC)) PVOID pvBuf);
@ -1689,10 +1689,10 @@ DWORD
APIENTRY APIENTRY
NtGdiGetCharacterPlacementW( NtGdiGetCharacterPlacementW(
_In_ HDC hdc, _In_ HDC hdc,
_In_reads_z_(nCount) LPWSTR pwsz, _In_reads_(nCount) PCWCH pwsz,
_In_ INT nCount, _In_ INT nCount,
_In_ INT nMaxExtent, _In_ INT nMaxExtent,
_Inout_ LPGCP_RESULTSW pgcpw, _Inout_opt_ LPGCP_RESULTSW pgcpw,
_In_ DWORD dwFlags); _In_ DWORD dwFlags);
__kernel_entry __kernel_entry
@ -1986,7 +1986,7 @@ NtGdiGetCharWidthW(
_In_ HDC hdc, _In_ HDC hdc,
_In_ UINT wcFirst, _In_ UINT wcFirst,
_In_ UINT cwc, _In_ UINT cwc,
_In_reads_opt_(cwc) PWCHAR pwc, _In_reads_opt_(cwc) PCWCH pwc,
_In_ FLONG fl, _In_ FLONG fl,
_Out_writes_bytes_(cwc * sizeof(ULONG)) PVOID pvBuf); _Out_writes_bytes_(cwc * sizeof(ULONG)) PVOID pvBuf);
@ -2069,7 +2069,7 @@ NtGdiGetGlyphOutline(
_Out_ LPGLYPHMETRICS pgm, _Out_ LPGLYPHMETRICS pgm,
_In_ ULONG cjBuf, _In_ ULONG cjBuf,
_Out_writes_bytes_opt_(cjBuf) PVOID pvBuf, _Out_writes_bytes_opt_(cjBuf) PVOID pvBuf,
_In_ LPMAT2 pmat2, _In_ const MAT2 *pmat2,
_In_ BOOL bIgnoreRotation); _In_ BOOL bIgnoreRotation);
__kernel_entry __kernel_entry
@ -2457,9 +2457,9 @@ BOOL
APIENTRY APIENTRY
NtGdiGetTextExtent( NtGdiGetTextExtent(
_In_ HDC hdc, _In_ HDC hdc,
_In_reads_(cwc) LPWSTR lpwsz, _In_reads_(cwc) PCWCH lpwsz,
_In_ INT cwc, _In_ INT cwc,
_Out_ LPSIZE psize, _Out_ PSIZE psize,
_In_ UINT flOpts); _In_ UINT flOpts);
_Success_(return != FALSE) _Success_(return != FALSE)
@ -2469,7 +2469,7 @@ BOOL
APIENTRY APIENTRY
NtGdiGetTextMetricsW( NtGdiGetTextMetricsW(
_In_ HDC hdc, _In_ HDC hdc,
_Out_writes_bytes_(cj) TMW_INTERNAL *ptm, _Out_writes_bytes_(cj) PTMW_INTERNAL ptm,
_In_ ULONG cj); _In_ ULONG cj);
__kernel_entry __kernel_entry
@ -2477,9 +2477,9 @@ W32KAPI
INT INT
APIENTRY APIENTRY
NtGdiGetTextFaceW( NtGdiGetTextFaceW(
_In_ HDC hdc, _In_ HDC hDC,
_In_ INT cChar, _In_ INT Count,
_Out_writes_to_opt_(cChar, return) LPWSTR pszOut, _Out_writes_to_opt_(Count, return) PWSTR FaceName,
_In_ BOOL bAliasName); _In_ BOOL bAliasName);
__kernel_entry __kernel_entry
@ -2501,7 +2501,7 @@ NtGdiExtTextOutW(
_In_ INT y, _In_ INT y,
_In_ UINT flOpts, _In_ UINT flOpts,
_In_opt_ LPCRECT prcl, _In_opt_ LPCRECT prcl,
_In_reads_opt_(cwc) LPCWSTR pwsz, _In_reads_opt_(cwc) PCWCH pwsz,
_In_range_(0, 0xffff) UINT cwc, _In_range_(0, 0xffff) UINT cwc,
_In_reads_opt_(_Inexpressible_(cwc)) const INT *pdx, _In_reads_opt_(_Inexpressible_(cwc)) const INT *pdx,
_In_ DWORD dwCodePage); _In_ DWORD dwCodePage);
@ -2873,23 +2873,23 @@ INT
W32KAPI W32KAPI
APIENTRY APIENTRY
NtGdiAddFontResourceW( NtGdiAddFontResourceW(
_In_reads_(cwc) WCHAR *pwszFiles, _In_reads_(cwc) PCWCH pwszFiles,
_In_ ULONG cwc, _In_ ULONG cwc,
_In_ ULONG cFiles, _In_ ULONG cFiles,
_In_ FLONG f, _In_ FLONG f,
_In_ DWORD dwPidTid, _In_ DWORD dwPidTid,
_In_opt_ DESIGNVECTOR *pdv); _In_opt_ const DESIGNVECTOR *pdv);
__kernel_entry __kernel_entry
W32KAPI W32KAPI
HFONT HFONT
APIENTRY APIENTRY
NtGdiHfontCreate( NtGdiHfontCreate(
_In_reads_bytes_(cjElfw) ENUMLOGFONTEXDVW *pelfw, _In_reads_bytes_(cjElfw) const ENUMLOGFONTEXDVW *pelfw,
_In_ ULONG cjElfw, _In_ ULONG cjElfw,
_In_ LFTYPE lft, _In_ LFTYPE lft,
_In_ FLONG fl, _In_ FLONG fl,
_In_ PVOID pvCliData); _In_opt_ PVOID pvCliData);
__kernel_entry __kernel_entry
W32KAPI W32KAPI

View file

@ -34,13 +34,13 @@ BOOL WINAPI GdiDrawStream(HDC dc, ULONG l, PGDI_DRAW_STREAM pDS);
BOOL WINAPI BOOL WINAPI
GetTextExtentExPointWPri( GetTextExtentExPointWPri(
HDC hdc, _In_ HDC hdc,
LPCWSTR lpwsz, _In_reads_(cwc) PCWCH lpwsz,
INT cwc, _In_ INT cwc,
INT dxMax, _In_ INT dxMax,
LPINT pcCh, _Out_opt_ LPINT pcCh,
LPINT pdxOut, _Out_writes_to_opt_(cwc, *pcCh) LPINT pdxOut,
LPSIZE psize); _In_ LPSIZE psize);
BOOL WINAPI BOOL WINAPI
GetFontResourceInfoW( GetFontResourceInfoW(

View file

@ -1087,12 +1087,12 @@ NtGdiGetSpoolMessage(
DWORD DWORD
APIENTRY APIENTRY
NtGdiGetGlyphIndicesWInternal( NtGdiGetGlyphIndicesWInternal(
IN HDC hdc, _In_ HDC hdc,
IN OPTIONAL LPWSTR pwc, _In_reads_opt_(cwc) PCWCH pwc,
IN INT cwc, _In_ INT cwc,
OUT OPTIONAL LPWORD pgi, _Out_writes_opt_(cwc) PWORD pgi,
IN DWORD iMode, _In_ DWORD iMode,
IN BOOL bSubset) _In_ BOOL bSubset)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0; return 0;

View file

@ -672,7 +672,7 @@ NewGetCharacterPlacementW(
nSet = lpResults->nGlyphs; nSet = lpResults->nGlyphs;
return NtGdiGetCharacterPlacementW( hdc, return NtGdiGetCharacterPlacementW( hdc,
(LPWSTR)lpString, lpString,
nSet, nSet,
nMaxExtent, nMaxExtent,
lpResults, lpResults,
@ -699,9 +699,9 @@ GetCharABCWidthsFloatW(HDC hdc,
return NtGdiGetCharABCWidthsW( hdc, return NtGdiGetCharABCWidthsW( hdc,
FirstChar, FirstChar,
(ULONG)(LastChar - FirstChar + 1), (ULONG)(LastChar - FirstChar + 1),
(PWCHAR) NULL, NULL,
0, 0,
(PVOID)abcF); abcF);
} }
/* /*
@ -724,9 +724,9 @@ GetCharWidthFloatW(HDC hdc,
return NtGdiGetCharWidthW( hdc, return NtGdiGetCharWidthW( hdc,
iFirstChar, iFirstChar,
(ULONG)(iLastChar - iFirstChar + 1), (ULONG)(iLastChar - iFirstChar + 1),
(PWCHAR) NULL, NULL,
0, 0,
(PVOID) pxBuffer); pxBuffer);
} }
/* /*
@ -749,9 +749,9 @@ GetCharWidthW(HDC hdc,
return NtGdiGetCharWidthW( hdc, return NtGdiGetCharWidthW( hdc,
iFirstChar, iFirstChar,
(ULONG)(iLastChar - iFirstChar + 1), (ULONG)(iLastChar - iFirstChar + 1),
(PWCHAR) NULL, NULL,
GCW_NOFLOAT, GCW_NOFLOAT,
(PVOID) lpBuffer); lpBuffer);
} }
/* /*
@ -774,9 +774,9 @@ GetCharWidth32W(HDC hdc,
return NtGdiGetCharWidthW( hdc, return NtGdiGetCharWidthW( hdc,
iFirstChar, iFirstChar,
(ULONG)(iLastChar - iFirstChar + 1), (ULONG)(iLastChar - iFirstChar + 1),
(PWCHAR) NULL, NULL,
GCW_NOFLOAT|GCW_WIN32, GCW_NOFLOAT|GCW_WIN32,
(PVOID) lpBuffer); lpBuffer);
} }
@ -800,9 +800,9 @@ GetCharABCWidthsW(HDC hdc,
return NtGdiGetCharABCWidthsW( hdc, return NtGdiGetCharABCWidthsW( hdc,
FirstChar, FirstChar,
(ULONG)(LastChar - FirstChar + 1), (ULONG)(LastChar - FirstChar + 1),
(PWCHAR) NULL, NULL,
GCABCW_NOFLOAT, GCABCW_NOFLOAT,
(PVOID)lpabc); lpabc);
} }
/* /*
@ -837,10 +837,10 @@ GetCharWidthA(
ret = NtGdiGetCharWidthW( hdc, ret = NtGdiGetCharWidthW( hdc,
wstr[0], wstr[0],
(ULONG) count, count,
(PWCHAR) wstr, wstr,
GCW_NOFLOAT, GCW_NOFLOAT,
(PVOID) lpBuffer); lpBuffer);
HeapFree(GetProcessHeap(), 0, str); HeapFree(GetProcessHeap(), 0, str);
HeapFree(GetProcessHeap(), 0, wstr); HeapFree(GetProcessHeap(), 0, wstr);
@ -880,10 +880,10 @@ GetCharWidth32A(
ret = NtGdiGetCharWidthW( hdc, ret = NtGdiGetCharWidthW( hdc,
wstr[0], wstr[0],
(ULONG) count, count,
(PWCHAR) wstr, wstr,
GCW_NOFLOAT|GCW_WIN32, GCW_NOFLOAT|GCW_WIN32,
(PVOID) lpBuffer); lpBuffer);
HeapFree(GetProcessHeap(), 0, str); HeapFree(GetProcessHeap(), 0, str);
HeapFree(GetProcessHeap(), 0, wstr); HeapFree(GetProcessHeap(), 0, wstr);
@ -920,7 +920,7 @@ GetCharWidthFloatA(
HeapFree(GetProcessHeap(), 0, str); HeapFree(GetProcessHeap(), 0, str);
return FALSE; return FALSE;
} }
ret = NtGdiGetCharWidthW( hdc, wstr[0], (ULONG) count, (PWCHAR) wstr, 0, (PVOID) pxBuffer); ret = NtGdiGetCharWidthW(hdc, wstr[0], count, wstr, 0, pxBuffer);
HeapFree(GetProcessHeap(), 0, str); HeapFree(GetProcessHeap(), 0, str);
HeapFree(GetProcessHeap(), 0, wstr); HeapFree(GetProcessHeap(), 0, wstr);
@ -1000,7 +1000,7 @@ GetCharABCWidthsFloatA(
HeapFree( GetProcessHeap(), 0, str ); HeapFree( GetProcessHeap(), 0, str );
return FALSE; return FALSE;
} }
ret = NtGdiGetCharABCWidthsW( hdc,wstr[0],(ULONG)count, (PWCHAR)wstr, 0, (PVOID)lpABCF); ret = NtGdiGetCharABCWidthsW(hdc, wstr[0], count, wstr, 0, lpABCF);
HeapFree( GetProcessHeap(), 0, str ); HeapFree( GetProcessHeap(), 0, str );
HeapFree( GetProcessHeap(), 0, wstr ); HeapFree( GetProcessHeap(), 0, wstr );
@ -1666,7 +1666,7 @@ CreateFontIndirectExA(const ENUMLOGFONTEXDVA *elfexd)
&Logfont.elfEnumLogfontEx ); &Logfont.elfEnumLogfontEx );
RtlCopyMemory( &Logfont.elfDesignVector, RtlCopyMemory( &Logfont.elfDesignVector,
(PVOID) &elfexd->elfDesignVector, &elfexd->elfDesignVector,
sizeof(DESIGNVECTOR)); sizeof(DESIGNVECTOR));
return NtGdiHfontCreate( &Logfont, 0, 0, 0, NULL); return NtGdiHfontCreate( &Logfont, 0, 0, 0, NULL);
@ -1864,7 +1864,7 @@ CreateFontA(
UNICODE_STRING StringU; UNICODE_STRING StringU;
HFONT ret; HFONT ret;
RtlInitAnsiString(&StringA, (LPSTR)lpszFace); RtlInitAnsiString(&StringA, lpszFace);
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE); RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
ret = CreateFontW(nHeight, ret = CreateFontW(nHeight,

View file

@ -249,7 +249,8 @@ GetTextExtentPointA(
UNICODE_STRING StringU; UNICODE_STRING StringU;
BOOL ret; BOOL ret;
RtlInitAnsiString(&StringA, (LPSTR)lpString); /* FIXME: lpString can be non-NUL-terminated */
RtlInitAnsiString(&StringA, lpString);
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE); RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
ret = GetTextExtentPointW(hdc, StringU.Buffer, cchString, lpsz); ret = GetTextExtentPointW(hdc, StringU.Buffer, cchString, lpsz);
@ -271,7 +272,7 @@ GetTextExtentPointW(
_In_ INT cchString, _In_ INT cchString,
_Out_ LPSIZE lpsz) _Out_ LPSIZE lpsz)
{ {
return NtGdiGetTextExtent(hdc, (LPWSTR)lpString, cchString, lpsz, 0); return NtGdiGetTextExtent(hdc, lpString, cchString, lpsz, 0);
} }
@ -289,7 +290,6 @@ GetTextExtentExPointW(
_Out_writes_to_opt_(cchString, *lpnFit) LPINT lpnDx, _Out_writes_to_opt_(cchString, *lpnFit) LPINT lpnDx,
_Out_ LPSIZE lpSize) _Out_ LPSIZE lpSize)
{ {
/* Windows doesn't check nMaxExtent validity in unicode version */ /* Windows doesn't check nMaxExtent validity in unicode version */
if (nMaxExtent < -1) if (nMaxExtent < -1)
{ {
@ -299,8 +299,7 @@ GetTextExtentExPointW(
if (LoadLPK(LPK_GTEP)) if (LoadLPK(LPK_GTEP))
return LpkGetTextExtentExPoint(hdc, lpszString, cchString, nMaxExtent, lpnFit, lpnDx, lpSize, 0, 0); return LpkGetTextExtentExPoint(hdc, lpszString, cchString, nMaxExtent, lpnFit, lpnDx, lpSize, 0, 0);
return NtGdiGetTextExtentExW ( return NtGdiGetTextExtentExW(hdc, lpszString, cchString, nMaxExtent, (PULONG)lpnFit, (PULONG)lpnDx, lpSize, 0);
hdc, (LPWSTR)lpszString, cchString, nMaxExtent, (PULONG)lpnFit, (PULONG)lpnDx, lpSize, 0 );
} }
@ -311,14 +310,14 @@ BOOL
WINAPI WINAPI
GetTextExtentExPointWPri( GetTextExtentExPointWPri(
_In_ HDC hdc, _In_ HDC hdc,
_In_reads_(cwc) LPCWSTR lpwsz, _In_reads_(cwc) PCWCH lpwsz,
_In_ INT cwc, _In_ INT cwc,
_In_ INT dxMax, _In_ INT dxMax,
_Out_opt_ LPINT pcCh, _Out_opt_ LPINT pcCh,
_Out_writes_to_opt_(cwc, *pcCh) LPINT pdxOut, _Out_writes_to_opt_(cwc, *pcCh) LPINT pdxOut,
_In_ LPSIZE psize) _In_ LPSIZE psize)
{ {
return NtGdiGetTextExtentExW(hdc, (LPWSTR)lpwsz, cwc, dxMax, (PULONG)pcCh, (PULONG)pdxOut, psize, 0); return NtGdiGetTextExtentExW(hdc, lpwsz, cwc, dxMax, (PULONG)pcCh, (PULONG)pdxOut, psize, 0);
} }
/* /*
@ -405,7 +404,7 @@ GetTextExtentPoint32W(
_In_ int cchString, _In_ int cchString,
_Out_ LPSIZE lpSize) _Out_ LPSIZE lpSize)
{ {
return NtGdiGetTextExtent(hdc, (LPWSTR)lpString, cchString, lpSize, 0); return NtGdiGetTextExtent(hdc, lpString, cchString, lpSize, 0);
} }
/* /*

View file

@ -1,11 +1,10 @@
/* /*
* PROJECT: ReactOS win32 kernel mode subsystem * PROJECT: ReactOS win32 kernel mode subsystem
* LICENSE: GPL - See COPYING in the top level directory * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
* FILE: win32ss/gdi/ntgdi/font.c
* PURPOSE: Font * PURPOSE: Font
* PROGRAMMERS: James Tabor <james.tabor@reactos.org> * COPYRIGHT: Copyright (C) James Tabor <james.tabor@reactos.org>
* Timo Kreuzer <timo.kreuzer@reactos.org> * Copyright (C) Timo Kreuzer <timo.kreuzer@reactos.org>
* Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com> * Copyright (C) Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
*/ */
/** Includes ******************************************************************/ /** Includes ******************************************************************/
@ -15,12 +14,18 @@
#define NDEBUG #define NDEBUG
#include <debug.h> #include <debug.h>
HFONT APIENTRY HfontCreate( IN PENUMLOGFONTEXDVW pelfw,IN ULONG cjElfw,IN LFTYPE lft,IN FLONG fl,IN PVOID pvCliData ); HFONT APIENTRY
HfontCreate(
_In_ const ENUMLOGFONTEXDVW *pelfw,
_In_ ULONG cjElfw,
_In_ LFTYPE lft,
_In_ FLONG fl,
_In_opt_ PVOID pvCliData);
/** Internal ******************************************************************/ /** Internal ******************************************************************/
HFONT FASTCALL HFONT FASTCALL
GreCreateFontIndirectW( LOGFONTW *lplf ) GreCreateFontIndirectW(_In_ const LOGFONTW *lplf)
{ {
if (lplf) if (lplf)
{ {
@ -38,7 +43,7 @@ GreCreateFontIndirectW( LOGFONTW *lplf )
RtlZeroMemory( &Logfont.elfDesignVector, sizeof(DESIGNVECTOR)); RtlZeroMemory( &Logfont.elfDesignVector, sizeof(DESIGNVECTOR));
return HfontCreate((PENUMLOGFONTEXDVW)&Logfont, 0, 0, 0, NULL ); return HfontCreate(&Logfont, 0, 0, 0, NULL);
} }
else return NULL; else return NULL;
} }
@ -46,9 +51,9 @@ GreCreateFontIndirectW( LOGFONTW *lplf )
DWORD DWORD
FASTCALL FASTCALL
GreGetKerningPairs( GreGetKerningPairs(
HDC hDC, _In_ HDC hDC,
ULONG NumPairs, _In_ ULONG NumPairs,
LPKERNINGPAIR krnpair) _Out_writes_(NumPairs) LPKERNINGPAIR krnpair)
{ {
PDC dc; PDC dc;
PDC_ATTR pdcattr; PDC_ATTR pdcattr;
@ -102,7 +107,6 @@ GreGetKerningPairs(
} }
/* /*
It is recommended that an application use the GetFontLanguageInfo function It is recommended that an application use the GetFontLanguageInfo function
to determine whether the GCP_DIACRITIC, GCP_DBCS, GCP_USEKERNING, GCP_LIGATE, to determine whether the GCP_DIACRITIC, GCP_DBCS, GCP_USEKERNING, GCP_LIGATE,
GCP_REORDER, GCP_GLYPHSHAPE, and GCP_KASHIDA values are valid for the GCP_REORDER, GCP_GLYPHSHAPE, and GCP_KASHIDA values are valid for the
@ -112,18 +116,17 @@ GreGetKerningPairs(
MS must use a preset "compiled in" support for each language based releases. MS must use a preset "compiled in" support for each language based releases.
ReactOS uses FreeType, this will need to be supported. ATM this is hard coded ReactOS uses FreeType, this will need to be supported. ATM this is hard coded
for GCPCLASS_LATIN! for GCPCLASS_LATIN!
*/ */
#if 0 #if 0
DWORD DWORD
FASTCALL FASTCALL
GreGetCharacterPlacementW( GreGetCharacterPlacementW(
HDC hdc, _In_ HDC hdc,
LPCWSTR pwsz, _In_reads_(nCount) PCWCH pwsz,
INT nCount, _In_ INT nCount,
INT nMaxExtent, _In_ INT nMaxExtent,
LPGCP_RESULTSW pgcpw, _Inout_opt_ LPGCP_RESULTSW pgcpw,
DWORD dwFlags) _In_ DWORD dwFlags)
{ {
GCP_RESULTSW gcpwSave; GCP_RESULTSW gcpwSave;
UINT i, nSet, cSet; UINT i, nSet, cSet;
@ -290,7 +293,10 @@ GreGetCharacterPlacementW(
ULONG ULONG
FASTCALL FASTCALL
FontGetObject(PTEXTOBJ plfont, ULONG cjBuffer, PVOID pvBuffer) FontGetObject(
_Inout_ PTEXTOBJ plfont,
_In_ ULONG cjBuffer,
_Out_ PVOID pvBuffer)
{ {
ULONG cjMaxSize; ULONG cjMaxSize;
ENUMLOGFONTEXDVW *plf; ENUMLOGFONTEXDVW *plf;
@ -326,7 +332,10 @@ FontGetObject(PTEXTOBJ plfont, ULONG cjBuffer, PVOID pvBuffer)
DWORD DWORD
FASTCALL FASTCALL
IntGetCharDimensions(HDC hdc, PTEXTMETRICW ptm, PDWORD height) IntGetCharDimensions(
_In_ HDC hdc,
_Out_opt_ PTEXTMETRICW ptm,
_Out_opt_ PDWORD height)
{ {
PDC pdc; PDC pdc;
PDC_ATTR pdcattr; PDC_ATTR pdcattr;
@ -354,7 +363,7 @@ IntGetCharDimensions(HDC hdc, PTEXTMETRICW ptm, PDWORD height)
DC_UnlockDc(pdc); DC_UnlockDc(pdc);
return 0; return 0;
} }
Good = TextIntGetTextExtentPoint(pdc, TextObj, alphabet, 52, 0, NULL, 0, &sz, 0); Good = TextIntGetTextExtentPoint(pdc, TextObj, alphabet, 52, 0, NULL, NULL, &sz, 0);
TEXTOBJ_UnlockText(TextObj); TEXTOBJ_UnlockText(TextObj);
DC_UnlockDc(pdc); DC_UnlockDc(pdc);
@ -368,7 +377,7 @@ IntGetCharDimensions(HDC hdc, PTEXTMETRICW ptm, PDWORD height)
DWORD DWORD
FASTCALL FASTCALL
IntGetFontLanguageInfo(PDC Dc) IntGetFontLanguageInfo(_In_ PDC Dc)
{ {
PDC_ATTR pdcattr; PDC_ATTR pdcattr;
FONTSIGNATURE fontsig; FONTSIGNATURE fontsig;
@ -419,7 +428,7 @@ IntGetFontLanguageInfo(PDC Dc)
PTEXTOBJ PTEXTOBJ
FASTCALL FASTCALL
RealizeFontInit(HFONT hFont) RealizeFontInit(_In_ HFONT hFont)
{ {
NTSTATUS Status = STATUS_SUCCESS; NTSTATUS Status = STATUS_SUCCESS;
PTEXTOBJ pTextObj; PTEXTOBJ pTextObj;
@ -440,7 +449,7 @@ RealizeFontInit(HFONT hFont)
static BOOL static BOOL
IntCheckFontPathNames( IntCheckFontPathNames(
_In_reads_(cwc) WCHAR *pwcFiles, _In_reads_(cwc) PCWCH pwcFiles,
_In_ ULONG cFiles, _In_ ULONG cFiles,
_In_ ULONG cwc) _In_ ULONG cwc)
{ {
@ -463,12 +472,12 @@ IntCheckFontPathNames(
INT INT
APIENTRY APIENTRY
NtGdiAddFontResourceW( NtGdiAddFontResourceW(
_In_reads_(cwc) WCHAR *pwcFiles, _In_reads_(cwc) PCWCH pwcFiles,
_In_ ULONG cwc, _In_ ULONG cwc,
_In_ ULONG cFiles, _In_ ULONG cFiles,
_In_ FLONG fl, _In_ FLONG fl,
_In_ DWORD dwPidTid, _In_ DWORD dwPidTid,
_In_opt_ DESIGNVECTOR *pdv) _In_opt_ const DESIGNVECTOR *pdv)
{ {
UNICODE_STRING SafeFileName; UNICODE_STRING SafeFileName;
INT Ret; INT Ret;
@ -517,12 +526,12 @@ NtGdiAddFontResourceW(
BOOL BOOL
APIENTRY APIENTRY
NtGdiRemoveFontResourceW( NtGdiRemoveFontResourceW(
_In_reads_(cwc) WCHAR *pwszFiles, _In_reads_(cwc) PCWCH pwszFiles,
_In_ ULONG cwc, _In_ ULONG cwc,
_In_ ULONG cFiles, _In_ ULONG cFiles,
_In_ ULONG fl, _In_ ULONG fl,
_In_ DWORD dwPidTid, _In_ DWORD dwPidTid,
_In_opt_ DESIGNVECTOR *pdv) _In_opt_ const DESIGNVECTOR *pdv)
{ {
UNICODE_STRING SafeFileName; UNICODE_STRING SafeFileName;
BOOL Ret; BOOL Ret;
@ -571,11 +580,11 @@ NtGdiRemoveFontResourceW(
HANDLE HANDLE
APIENTRY APIENTRY
NtGdiAddFontMemResourceEx( NtGdiAddFontMemResourceEx(
IN PVOID pvBuffer, _In_reads_bytes_(cjBuffer) const VOID *pvBuffer,
IN DWORD cjBuffer, _In_ DWORD cjBuffer,
IN DESIGNVECTOR *pdv, _In_reads_bytes_opt_(cjDV) const DESIGNVECTOR *pdv,
IN ULONG cjDV, _In_ ULONG cjDV,
OUT DWORD *pNumFonts) _Out_ PDWORD pNumFonts)
{ {
_SEH2_VOLATILE PVOID Buffer = NULL; _SEH2_VOLATILE PVOID Buffer = NULL;
HANDLE Ret; HANDLE Ret;
@ -627,7 +636,7 @@ NtGdiAddFontMemResourceEx(
BOOL BOOL
APIENTRY APIENTRY
NtGdiRemoveFontMemResourceEx( NtGdiRemoveFontMemResourceEx(
IN HANDLE hMMFont) _In_ HANDLE hMMFont)
{ {
return IntGdiRemoveFontMemResource(hMMFont); return IntGdiRemoveFontMemResource(hMMFont);
} }
@ -639,12 +648,12 @@ NtGdiRemoveFontMemResourceEx(
DWORD DWORD
APIENTRY APIENTRY
NtGdiGetCharacterPlacementW( NtGdiGetCharacterPlacementW(
IN HDC hdc, _In_ HDC hdc,
IN LPWSTR pwsz, _In_reads_(nCount) PCWCH pwsz,
IN INT nCount, _In_ INT nCount,
IN INT nMaxExtent, _In_ INT nMaxExtent,
IN OUT LPGCP_RESULTSW pgcpw, _Inout_opt_ LPGCP_RESULTSW pgcpw,
IN DWORD dwFlags) _In_ DWORD dwFlags)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return 0; return 0;
@ -661,11 +670,11 @@ NtGdiGetCharacterPlacementW(
DWORD DWORD
APIENTRY APIENTRY
NtGdiGetFontData( NtGdiGetFontData(
HDC hDC, _In_ HDC hDC,
DWORD Table, _In_ DWORD Table,
DWORD Offset, _In_ DWORD Offset,
LPVOID Buffer, _Out_writes_bytes_(Size) PVOID Buffer,
DWORD Size) _In_ DWORD Size)
{ {
PDC Dc; PDC Dc;
PDC_ATTR pdcattr; PDC_ATTR pdcattr;
@ -717,14 +726,12 @@ NtGdiGetFontData(
return Result; return Result;
} }
/* /* @implemented */
* @implemented
*/
DWORD DWORD
APIENTRY APIENTRY
NtGdiGetFontUnicodeRanges( NtGdiGetFontUnicodeRanges(
IN HDC hdc, _In_ HDC hdc,
OUT OPTIONAL LPGLYPHSET pgs) _Out_opt_ LPGLYPHSET pgs)
{ {
PDC pDc; PDC pDc;
PDC_ATTR pdcattr; PDC_ATTR pdcattr;
@ -794,14 +801,14 @@ Exit:
ULONG ULONG
APIENTRY APIENTRY
NtGdiGetGlyphOutline( NtGdiGetGlyphOutline(
IN HDC hdc, _In_ HDC hdc,
IN WCHAR wch, _In_ WCHAR wch,
IN UINT iFormat, _In_ UINT iFormat,
OUT LPGLYPHMETRICS pgm, _Out_ LPGLYPHMETRICS pgm,
IN ULONG cjBuf, _In_ ULONG cjBuf,
OUT OPTIONAL PVOID UnsafeBuf, _Out_writes_bytes_opt_(cjBuf) PVOID UnsafeBuf,
IN LPMAT2 pmat2, _In_opt_ const MAT2 *pmat2,
IN BOOL bIgnoreRotation) _In_ BOOL bIgnoreRotation)
{ {
ULONG Ret = GDI_ERROR; ULONG Ret = GDI_ERROR;
PDC dc; PDC dc;
@ -878,9 +885,10 @@ Exit:
DWORD DWORD
APIENTRY APIENTRY
NtGdiGetKerningPairs(HDC hDC, NtGdiGetKerningPairs(
ULONG NumPairs, _In_ HDC hDC,
LPKERNINGPAIR krnpair) _In_ ULONG NumPairs,
_Out_writes_(NumPairs) LPKERNINGPAIR krnpair)
{ {
PDC dc; PDC dc;
PDC_ATTR pdcattr; PDC_ATTR pdcattr;
@ -952,10 +960,11 @@ NtGdiGetKerningPairs(HDC hDC,
*/ */
ULONG ULONG
APIENTRY APIENTRY
NtGdiGetOutlineTextMetricsInternalW (HDC hDC, NtGdiGetOutlineTextMetricsInternalW(
ULONG Data, _In_ HDC hDC,
OUTLINETEXTMETRICW *otm, _In_ ULONG Data,
TMDIFF *Tmd) _Out_opt_ POUTLINETEXTMETRICW otm,
_In_ PTMDIFF Tmd)
{ {
PDC dc; PDC dc;
PDC_ATTR pdcattr; PDC_ATTR pdcattr;
@ -1030,13 +1039,13 @@ W32KAPI
BOOL BOOL
APIENTRY APIENTRY
NtGdiGetFontResourceInfoInternalW( NtGdiGetFontResourceInfoInternalW(
IN LPWSTR pwszFiles, _In_reads_(cwc) PCWCH pwszFiles,
IN ULONG cwc, _In_ ULONG cwc,
IN ULONG cFiles, _In_ ULONG cFiles,
IN UINT cjIn, _In_ UINT cjIn,
IN OUT LPDWORD pdwBytes, _Inout_ PDWORD pdwBytes,
OUT LPVOID pvBuf, _Out_writes_bytes_(*pdwBytes) PVOID pvBuf,
IN DWORD dwType) _In_ DWORD dwType)
{ {
NTSTATUS Status = STATUS_SUCCESS; NTSTATUS Status = STATUS_SUCCESS;
DWORD dwBytes, dwBytesRequested; DWORD dwBytes, dwBytesRequested;
@ -1138,15 +1147,13 @@ NtGdiGetFontResourceInfoInternalW(
return bRet; return bRet;
} }
/* /* @unimplemented */
* @unimplemented
*/
BOOL BOOL
APIENTRY APIENTRY
NtGdiGetRealizationInfo( NtGdiGetRealizationInfo(
IN HDC hdc, _In_ HDC hdc,
OUT PREALIZATION_INFO pri, _Out_ PREALIZATION_INFO pri,
IN HFONT hf) _In_ HFONT hf)
{ {
PDC pDc; PDC pDc;
PTEXTOBJ pTextObj; PTEXTOBJ pTextObj;
@ -1209,15 +1216,14 @@ NtGdiGetRealizationInfo(
return Ret; return Ret;
} }
HFONT HFONT
APIENTRY APIENTRY
HfontCreate( HfontCreate(
IN PENUMLOGFONTEXDVW pelfw, const ENUMLOGFONTEXDVW *pelfw,
IN ULONG cjElfw, _In_ ULONG cjElfw,
IN LFTYPE lft, _In_ LFTYPE lft,
IN FLONG fl, _In_ FLONG fl,
IN PVOID pvCliData ) _In_opt_ PVOID pvCliData)
{ {
HFONT hNewFont; HFONT hNewFont;
PLFONT plfont; PLFONT plfont;
@ -1267,11 +1273,11 @@ HfontCreate(
HFONT HFONT
APIENTRY APIENTRY
NtGdiHfontCreate( NtGdiHfontCreate(
IN PENUMLOGFONTEXDVW pelfw, _In_reads_bytes_(cjElfw) const ENUMLOGFONTEXDVW *pelfw,
IN ULONG cjElfw, _In_ ULONG cjElfw,
IN LFTYPE lft, _In_ LFTYPE lft,
IN FLONG fl, _In_ FLONG fl,
IN PVOID pvCliData ) _In_opt_ PVOID pvCliData)
{ {
ENUMLOGFONTEXDVW SafeLogfont; ENUMLOGFONTEXDVW SafeLogfont;
NTSTATUS Status = STATUS_SUCCESS; NTSTATUS Status = STATUS_SUCCESS;
@ -1303,6 +1309,3 @@ NtGdiHfontCreate(
return HfontCreate(&SafeLogfont, cjElfw, lft, fl, pvCliData); return HfontCreate(&SafeLogfont, cjElfw, lft, fl, pvCliData);
} }
/* EOF */

View file

@ -4630,7 +4630,7 @@ ftGdiGetGlyphOutline(
LPGLYPHMETRICS pgm, LPGLYPHMETRICS pgm,
ULONG cjBuf, ULONG cjBuf,
PVOID pvBuf, PVOID pvBuf,
LPMAT2 pmat2, const MAT2 *pmat2,
BOOL bIgnoreRotation) BOOL bIgnoreRotation)
{ {
PDC_ATTR pdcattr; PDC_ATTR pdcattr;
@ -5151,15 +5151,16 @@ IntGetRealGlyph(
BOOL BOOL
FASTCALL FASTCALL
TextIntGetTextExtentPoint(PDC dc, TextIntGetTextExtentPoint(
PTEXTOBJ TextObj, _In_ PDC dc,
LPCWSTR String, _In_ PTEXTOBJ TextObj,
INT Count, _In_reads_(Count) PCWCH String,
ULONG MaxExtent, _In_ INT Count,
LPINT Fit, _In_ ULONG MaxExtent,
LPINT Dx, _Out_ PINT Fit,
LPSIZE Size, _Out_writes_to_opt_(Count, *Fit) PINT Dx,
FLONG fl) _Out_ PSIZE Size,
_In_ FLONG fl)
{ {
PFONTGDI FontGDI; PFONTGDI FontGDI;
FT_BitmapGlyph realglyph; FT_BitmapGlyph realglyph;
@ -6668,10 +6669,11 @@ IntGetFontFamilyInfo(HDC Dc,
} }
LONG NTAPI LONG NTAPI
NtGdiGetFontFamilyInfo(HDC Dc, NtGdiGetFontFamilyInfo(
const LOGFONTW *UnsafeLogFont, _In_ HDC Dc,
PFONTFAMILYINFO UnsafeInfo, _In_ const LOGFONTW *UnsafeLogFont,
LPLONG UnsafeInfoCount) _Out_ PFONTFAMILYINFO UnsafeInfo,
_Inout_ PLONG UnsafeInfoCount)
{ {
NTSTATUS Status; NTSTATUS Status;
LOGFONTW LogFont; LOGFONTW LogFont;
@ -6786,15 +6788,15 @@ ScaleLong(LONG lValue, PFLOATOBJ pef)
*/ */
static BOOL static BOOL
IntGetTextDisposition( IntGetTextDisposition(
OUT LONGLONG *pX64, _Out_ LONGLONG *pX64,
OUT LONGLONG *pY64, _Out_ LONGLONG *pY64,
IN LPCWSTR String, _In_reads_(Count) PCWCH String,
IN INT Count, _In_ INT Count,
IN OPTIONAL LPINT Dx, _In_opt_ const INT *Dx,
IN OUT PFONT_CACHE_ENTRY Cache, _Inout_ PFONT_CACHE_ENTRY Cache,
IN UINT fuOptions, _In_ UINT fuOptions,
IN BOOL bNoTransform, _In_ BOOL bNoTransform,
IN OUT PFONTLINK_CHAIN pChain) _Inout_ PFONTLINK_CHAIN pChain)
{ {
LONGLONG X64 = 0, Y64 = 0; LONGLONG X64 = 0, Y64 = 0;
INT i, glyph_index; INT i, glyph_index;
@ -6954,15 +6956,15 @@ IntEngFillBox(
BOOL BOOL
APIENTRY APIENTRY
IntExtTextOutW( IntExtTextOutW(
IN PDC dc, _In_ PDC dc,
IN INT XStart, _In_ INT XStart,
IN INT YStart, _In_ INT YStart,
IN UINT fuOptions, _In_ UINT fuOptions,
IN OPTIONAL PRECTL lprc, _In_opt_ PRECTL lprc,
IN LPCWSTR String, _In_reads_opt_(Count) PCWCH String,
IN INT Count, _In_ INT Count,
IN OPTIONAL LPINT Dx, _In_opt_ const INT *Dx,
IN DWORD dwCodePage) _In_ DWORD dwCodePage)
{ {
/* /*
* FIXME: * FIXME:
@ -7273,7 +7275,7 @@ IntExtTextOutW(
{ {
IntUnLockFreeType(); IntUnLockFreeType();
/* Get the width of the space character */ /* Get the width of the space character */
TextIntGetTextExtentPoint(dc, TextObj, L" ", 1, 0, NULL, 0, &spaceWidth, 0); TextIntGetTextExtentPoint(dc, TextObj, L" ", 1, 0, NULL, NULL, &spaceWidth, 0);
IntLockFreeType(); IntLockFreeType();
glyphSize.cx = spaceWidth.cx; glyphSize.cx = spaceWidth.cx;
realglyph->left = 0; realglyph->left = 0;
@ -7500,15 +7502,15 @@ Cleanup:
BOOL BOOL
APIENTRY APIENTRY
GreExtTextOutW( GreExtTextOutW(
IN HDC hDC, _In_ HDC hDC,
IN INT XStart, _In_ INT XStart,
IN INT YStart, _In_ INT YStart,
IN UINT fuOptions, _In_ UINT fuOptions,
IN OPTIONAL PRECTL lprc, _In_opt_ PRECTL lprc,
IN LPCWSTR String, _In_reads_opt_(Count) PCWCH String,
IN INT Count, _In_ INT Count,
IN OPTIONAL LPINT Dx, _In_opt_ const INT *Dx,
IN DWORD dwCodePage) _In_ DWORD dwCodePage)
{ {
BOOL bResult; BOOL bResult;
DC *dc; DC *dc;
@ -7542,15 +7544,15 @@ GreExtTextOutW(
BOOL BOOL
APIENTRY APIENTRY
NtGdiExtTextOutW( NtGdiExtTextOutW(
IN HDC hDC, _In_ HDC hDC,
IN INT XStart, _In_ INT XStart,
IN INT YStart, _In_ INT YStart,
IN UINT fuOptions, _In_ UINT fuOptions,
IN OPTIONAL LPCRECT UnsafeRect, _In_opt_ LPCRECT UnsafeRect,
IN LPCWSTR UnsafeString, _In_reads_opt_(Count) PCWCH UnsafeString,
IN UINT Count, _In_range_(0, 0xFFFF) UINT Count,
IN OPTIONAL const INT *UnsafeDx, _In_reads_opt_(_Inexpressible_(cwc)) const INT *UnsafeDx,
IN DWORD dwCodePage) _In_ DWORD dwCodePage)
{ {
BOOL Result = FALSE; BOOL Result = FALSE;
NTSTATUS Status = STATUS_SUCCESS; NTSTATUS Status = STATUS_SUCCESS;
@ -7558,7 +7560,7 @@ NtGdiExtTextOutW(
BYTE LocalBuffer[STACK_TEXT_BUFFER_SIZE]; BYTE LocalBuffer[STACK_TEXT_BUFFER_SIZE];
PVOID Buffer = LocalBuffer; PVOID Buffer = LocalBuffer;
LPCWSTR SafeString = NULL; LPCWSTR SafeString = NULL;
LPINT SafeDx = NULL; PINT SafeDx = NULL;
ULONG BufSize, StringSize, DxSize = 0; ULONG BufSize, StringSize, DxSize = 0;
/* Check if String is valid */ /* Check if String is valid */
@ -7667,12 +7669,12 @@ cleanup:
BOOL BOOL
APIENTRY APIENTRY
NtGdiGetCharABCWidthsW( NtGdiGetCharABCWidthsW(
IN HDC hDC, _In_ HDC hDC,
IN UINT FirstChar, _In_ UINT FirstChar,
IN ULONG Count, _In_ ULONG Count,
IN OPTIONAL PWCHAR UnSafepwch, _In_reads_opt_(Count) PCWCH UnSafepwch,
IN FLONG fl, _In_ FLONG fl,
OUT PVOID Buffer) _Out_writes_bytes_(Count * sizeof(ABC)) PVOID Buffer)
{ {
LPABC SafeBuff; LPABC SafeBuff;
LPABCFLOAT SafeBuffF = NULL; LPABCFLOAT SafeBuffF = NULL;
@ -7870,12 +7872,12 @@ NtGdiGetCharABCWidthsW(
BOOL BOOL
APIENTRY APIENTRY
NtGdiGetCharWidthW( NtGdiGetCharWidthW(
IN HDC hDC, _In_ HDC hDC,
IN UINT FirstChar, _In_ UINT FirstChar,
IN UINT Count, _In_ UINT Count,
IN OPTIONAL PWCHAR UnSafepwc, _In_reads_opt_(Count) PCWCH UnSafepwc,
IN FLONG fl, _In_ FLONG fl,
OUT PVOID Buffer) _Out_writes_bytes_(Count * sizeof(ULONG)) PVOID Buffer)
{ {
NTSTATUS Status = STATUS_SUCCESS; NTSTATUS Status = STATUS_SUCCESS;
LPINT SafeBuff; LPINT SafeBuff;
@ -8035,9 +8037,9 @@ DWORD
APIENTRY APIENTRY
NtGdiGetGlyphIndicesW( NtGdiGetGlyphIndicesW(
_In_ HDC hdc, _In_ HDC hdc,
_In_reads_opt_(cwc) LPCWSTR pwc, _In_reads_opt_(cwc) PCWCH pwc,
_In_ INT cwc, _In_ INT cwc,
_Out_writes_opt_(cwc) LPWORD pgi, _Out_writes_opt_(cwc) PWORD pgi,
_In_ DWORD iMode) _In_ DWORD iMode)
{ {
PDC dc; PDC dc;

View file

@ -5,7 +5,7 @@
#include <debug.h> #include <debug.h>
BOOL FASTCALL IntPatBlt( PDC,INT,INT,INT,INT,DWORD,PEBRUSHOBJ); BOOL FASTCALL IntPatBlt( PDC,INT,INT,INT,INT,DWORD,PEBRUSHOBJ);
BOOL APIENTRY IntExtTextOutW(IN PDC,IN INT,IN INT,IN UINT,IN OPTIONAL PRECTL,IN LPCWSTR,IN INT,IN OPTIONAL LPINT,IN DWORD); BOOL APIENTRY IntExtTextOutW(IN PDC,IN INT,IN INT,IN UINT,IN OPTIONAL PRECTL,IN LPCWSTR,IN INT,IN OPTIONAL const INT *,IN DWORD);
// //
@ -316,7 +316,7 @@ GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr)
lprc, lprc,
(LPCWSTR)&pgO->String[pgO->Size/sizeof(WCHAR)], (LPCWSTR)&pgO->String[pgO->Size/sizeof(WCHAR)],
pgO->cbCount, pgO->cbCount,
pgO->Size ? (LPINT)&pgO->Buffer : NULL, pgO->Size ? (const INT *)&pgO->Buffer : NULL,
pgO->iCS_CP ); pgO->iCS_CP );
// Restore attributes and flags // Restore attributes and flags

View file

@ -13,7 +13,6 @@
#define NDEBUG #define NDEBUG
#include <debug.h> #include <debug.h>
/* /*
This is a hack. See CORE-1091. This is a hack. See CORE-1091.
@ -28,8 +27,8 @@
VOID FASTCALL VOID FASTCALL
IntTMWFixUp( IntTMWFixUp(
HDC hDC, _In_ HDC hDC,
TMW_INTERNAL *ptm) _Inout_ PTMW_INTERNAL ptm)
{ {
LOGFONTW lf; LOGFONTW lf;
HFONT hCurrentFont; HFONT hCurrentFont;
@ -59,11 +58,11 @@ IntTMWFixUp(
BOOL FASTCALL BOOL FASTCALL
GreTextOutW( GreTextOutW(
HDC hdc, _In_ HDC hdc,
int nXStart, _In_ INT nXStart,
int nYStart, _In_ INT nYStart,
LPCWSTR lpString, _In_reads_(cchString) PCWCH lpString,
int cchString) _In_ INT cchString)
{ {
return GreExtTextOutW(hdc, nXStart, nYStart, 0, NULL, lpString, cchString, NULL, 0); return GreExtTextOutW(hdc, nXStart, nYStart, 0, NULL, lpString, cchString, NULL, 0);
} }
@ -76,11 +75,11 @@ GreTextOutW(
BOOL BOOL
FASTCALL FASTCALL
GreGetTextExtentW( GreGetTextExtentW(
HDC hDC, _In_ HDC hDC,
LPCWSTR lpwsz, _In_reads_(cwc) PCWCH lpwsz,
INT cwc, _In_ INT cwc,
LPSIZE psize, _Out_ PSIZE psize,
UINT flOpts) _In_ UINT flOpts)
{ {
PDC pdc; PDC pdc;
PDC_ATTR pdcattr; PDC_ATTR pdcattr;
@ -124,7 +123,6 @@ GreGetTextExtentW(
return Result; return Result;
} }
/* /*
fl : fl :
GetTextExtentExPointW = 0 and everything else that uses this. GetTextExtentExPointW = 0 and everything else that uses this.
@ -133,14 +131,14 @@ GreGetTextExtentW(
BOOL BOOL
FASTCALL FASTCALL
GreGetTextExtentExW( GreGetTextExtentExW(
HDC hDC, _In_ HDC hDC,
LPCWSTR String, _In_ PCWCH String,
ULONG Count, _In_ ULONG Count,
ULONG MaxExtent, _In_ ULONG MaxExtent,
PULONG Fit, _Out_opt_ PULONG Fit,
PULONG Dx, _Out_writes_to_opt_(Count, *Fit) PULONG Dx,
LPSIZE pSize, _Out_ PSIZE pSize,
FLONG fl) _In_ FLONG fl)
{ {
PDC pdc; PDC pdc;
PDC_ATTR pdcattr; PDC_ATTR pdcattr;
@ -175,8 +173,8 @@ GreGetTextExtentExW(
String, String,
Count, Count,
MaxExtent, MaxExtent,
(LPINT)Fit, (PINT)Fit,
(LPINT)Dx, (PINT)Dx,
pSize, pSize,
fl); fl);
TEXTOBJ_UnlockText(TextObj); TEXTOBJ_UnlockText(TextObj);
@ -203,7 +201,7 @@ GreGetTextMetricsW(
DWORD DWORD
APIENTRY APIENTRY
NtGdiGetCharSet(HDC hDC) NtGdiGetCharSet(_In_ HDC hDC)
{ {
PDC Dc; PDC Dc;
PDC_ATTR pdcattr; PDC_ATTR pdcattr;
@ -226,8 +224,8 @@ NtGdiGetCharSet(HDC hDC)
BOOL BOOL
APIENTRY APIENTRY
NtGdiGetRasterizerCaps( NtGdiGetRasterizerCaps(
OUT LPRASTERIZER_STATUS praststat, _Out_ LPRASTERIZER_STATUS praststat,
IN ULONG cjBytes) _In_ ULONG cjBytes)
{ {
NTSTATUS Status = STATUS_SUCCESS; NTSTATUS Status = STATUS_SUCCESS;
RASTERIZER_STATUS rsSafe; RASTERIZER_STATUS rsSafe;
@ -265,9 +263,9 @@ NtGdiGetRasterizerCaps(
INT INT
APIENTRY APIENTRY
NtGdiGetTextCharsetInfo( NtGdiGetTextCharsetInfo(
IN HDC hdc, _In_ HDC hdc,
OUT OPTIONAL LPFONTSIGNATURE lpSig, _Out_opt_ LPFONTSIGNATURE lpSig,
IN DWORD dwFlags) _In_ DWORD dwFlags)
{ {
PDC Dc; PDC Dc;
INT Ret; INT Ret;
@ -324,15 +322,14 @@ W32KAPI
BOOL BOOL
APIENTRY APIENTRY
NtGdiGetTextExtentExW( NtGdiGetTextExtentExW(
IN HDC hDC, _In_ HDC hDC,
IN OPTIONAL LPWSTR UnsafeString, _In_reads_opt_(Count) PCWCH UnsafeString,
IN ULONG Count, _In_ ULONG Count,
IN ULONG MaxExtent, _In_ ULONG MaxExtent,
OUT OPTIONAL PULONG UnsafeFit, _Out_opt_ PULONG UnsafeFit,
OUT OPTIONAL PULONG UnsafeDx, _Out_writes_to_opt_(Count, *UnsafeFit) PULONG UnsafeDx,
OUT LPSIZE UnsafeSize, _Out_ PSIZE UnsafeSize,
IN FLONG fl _In_ FLONG fl)
)
{ {
PDC dc; PDC dc;
PDC_ATTR pdcattr; PDC_ATTR pdcattr;
@ -341,7 +338,7 @@ NtGdiGetTextExtentExW(
NTSTATUS Status; NTSTATUS Status;
BOOLEAN Result; BOOLEAN Result;
INT Fit; INT Fit;
LPINT Dx; PINT Dx;
PTEXTOBJ TextObj; PTEXTOBJ TextObj;
if ((LONG)Count < 0) if ((LONG)Count < 0)
@ -489,20 +486,22 @@ NtGdiGetTextExtentExW(
*/ */
BOOL BOOL
APIENTRY APIENTRY
NtGdiGetTextExtent(HDC hdc, NtGdiGetTextExtent(
LPWSTR lpwsz, _In_ HDC hdc,
INT cwc, _In_reads_(cwc) PCWCH lpwsz,
LPSIZE psize, _In_ INT cwc,
UINT flOpts) _Out_ PSIZE psize,
_In_ UINT flOpts)
{ {
return NtGdiGetTextExtentExW(hdc, lpwsz, cwc, 0, NULL, NULL, psize, flOpts); return NtGdiGetTextExtentExW(hdc, lpwsz, cwc, 0, NULL, NULL, psize, flOpts);
} }
BOOL BOOL
APIENTRY APIENTRY
NtGdiSetTextJustification(HDC hDC, NtGdiSetTextJustification(
int BreakExtra, _In_ HDC hDC,
int BreakCount) _In_ INT BreakExtra,
_In_ INT BreakCount)
{ {
PDC pDc; PDC pDc;
PDC_ATTR pdcattr; PDC_ATTR pdcattr;
@ -528,11 +527,10 @@ W32KAPI
INT INT
APIENTRY APIENTRY
NtGdiGetTextFaceW( NtGdiGetTextFaceW(
IN HDC hDC, _In_ HDC hDC,
IN INT Count, _In_ INT Count,
OUT OPTIONAL LPWSTR FaceName, _Out_writes_to_opt_(Count, return) PWSTR FaceName,
IN BOOL bAliasName _In_ BOOL bAliasName)
)
{ {
PDC Dc; PDC Dc;
PDC_ATTR pdcattr; PDC_ATTR pdcattr;
@ -588,9 +586,9 @@ W32KAPI
BOOL BOOL
APIENTRY APIENTRY
NtGdiGetTextMetricsW( NtGdiGetTextMetricsW(
IN HDC hDC, _In_ HDC hDC,
OUT TMW_INTERNAL * pUnsafeTmwi, _Out_ PTMW_INTERNAL pUnsafeTmwi,
IN ULONG cj) _In_ ULONG cj)
{ {
TMW_INTERNAL Tmwi; TMW_INTERNAL Tmwi;

View file

@ -129,11 +129,11 @@ BOOL FASTCALL IntGdiRemoveFontResource(
_In_ DWORD dwFlags); _In_ DWORD dwFlags);
HANDLE FASTCALL IntGdiAddFontMemResource(PVOID Buffer, DWORD dwSize, PDWORD pNumAdded); HANDLE FASTCALL IntGdiAddFontMemResource(PVOID Buffer, DWORD dwSize, PDWORD pNumAdded);
BOOL FASTCALL IntGdiRemoveFontMemResource(HANDLE hMMFont); BOOL FASTCALL IntGdiRemoveFontMemResource(HANDLE hMMFont);
ULONG FASTCALL ftGdiGetGlyphOutline(PDC,WCHAR,UINT,LPGLYPHMETRICS,ULONG,PVOID,LPMAT2,BOOL); ULONG FASTCALL ftGdiGetGlyphOutline(PDC, WCHAR, UINT, LPGLYPHMETRICS, ULONG, PVOID, const MAT2*, BOOL);
INT FASTCALL IntGetOutlineTextMetrics(PFONTGDI, UINT, OUTLINETEXTMETRICW*, BOOL); INT FASTCALL IntGetOutlineTextMetrics(PFONTGDI, UINT, OUTLINETEXTMETRICW*, BOOL);
BOOL FASTCALL TextIntUpdateSize(PDC,PTEXTOBJ,PFONTGDI,BOOL); BOOL FASTCALL TextIntUpdateSize(PDC,PTEXTOBJ,PFONTGDI,BOOL);
BOOL FASTCALL ftGdiGetRasterizerCaps(LPRASTERIZER_STATUS); BOOL FASTCALL ftGdiGetRasterizerCaps(LPRASTERIZER_STATUS);
BOOL FASTCALL TextIntGetTextExtentPoint(PDC,PTEXTOBJ,LPCWSTR,INT,ULONG,LPINT,LPINT,LPSIZE,FLONG); BOOL FASTCALL TextIntGetTextExtentPoint(PDC, PTEXTOBJ, PCWCH, INT, ULONG, PINT, PINT, PSIZE, FLONG);
BOOL FASTCALL ftGdiGetTextMetricsW(HDC,PTMW_INTERNAL); BOOL FASTCALL ftGdiGetTextMetricsW(HDC,PTMW_INTERNAL);
DWORD FASTCALL IntGetFontLanguageInfo(PDC); DWORD FASTCALL IntGetFontLanguageInfo(PDC);
INT FASTCALL ftGdiGetTextCharsetInfo(PDC,PFONTSIGNATURE,DWORD); INT FASTCALL ftGdiGetTextCharsetInfo(PDC,PFONTSIGNATURE,DWORD);
@ -142,13 +142,23 @@ DWORD FASTCALL ftGdiGetFontData(PFONTGDI,DWORD,DWORD,PVOID,DWORD);
BOOL FASTCALL IntGdiGetFontResourceInfo(PUNICODE_STRING,PVOID,DWORD*,DWORD); BOOL FASTCALL IntGdiGetFontResourceInfo(PUNICODE_STRING,PVOID,DWORD*,DWORD);
BOOL FASTCALL ftGdiRealizationInfo(PFONTGDI,PREALIZATION_INFO); BOOL FASTCALL ftGdiRealizationInfo(PFONTGDI,PREALIZATION_INFO);
DWORD FASTCALL ftGdiGetKerningPairs(PFONTGDI,DWORD,LPKERNINGPAIR); DWORD FASTCALL ftGdiGetKerningPairs(PFONTGDI,DWORD,LPKERNINGPAIR);
BOOL NTAPI GreExtTextOutW(IN HDC,IN INT,IN INT,IN UINT,IN OPTIONAL RECTL*, BOOL
IN LPCWSTR, IN INT, IN OPTIONAL LPINT, IN DWORD); APIENTRY
GreExtTextOutW(
_In_ HDC hDC,
_In_ INT XStart,
_In_ INT YStart,
_In_ UINT fuOptions,
_In_opt_ PRECTL lprc,
_In_reads_opt_(Count) PCWCH String,
_In_ INT Count,
_In_opt_ const INT *Dx,
_In_ DWORD dwCodePage);
DWORD FASTCALL IntGetCharDimensions(HDC, PTEXTMETRICW, PDWORD); DWORD FASTCALL IntGetCharDimensions(HDC, PTEXTMETRICW, PDWORD);
BOOL FASTCALL GreGetTextExtentW(HDC,LPCWSTR,INT,LPSIZE,UINT); BOOL FASTCALL GreGetTextExtentW(HDC, PCWCH, INT, PSIZE, UINT);
BOOL FASTCALL GreGetTextExtentExW(HDC,LPCWSTR,ULONG,ULONG,PULONG,PULONG,LPSIZE,FLONG); BOOL FASTCALL GreGetTextExtentExW(HDC, PCWCH, ULONG, ULONG, PULONG, PULONG, PSIZE, FLONG);
BOOL FASTCALL GreTextOutW(HDC,int,int,LPCWSTR,int); BOOL FASTCALL GreTextOutW(HDC, INT, INT, PCWCH, INT);
HFONT FASTCALL GreCreateFontIndirectW( LOGFONTW * ); HFONT FASTCALL GreCreateFontIndirectW(_In_ const LOGFONTW *lplf);
BOOL WINAPI GreGetTextMetricsW( _In_ HDC hdc, _Out_ LPTEXTMETRICW lptm); BOOL WINAPI GreGetTextMetricsW( _In_ HDC hdc, _Out_ LPTEXTMETRICW lptm);
#define IntLockProcessPrivateFonts(W32Process) \ #define IntLockProcessPrivateFonts(W32Process) \