ReactOS 0.4.16-dev-1214-gd663eb4
text.c File Reference
#include <win32k.h>
#include <debug.h>
Include dependency graph for text.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

VOID FASTCALL IntTMWFixUp (_In_ HDC hDC, _Inout_ PTMW_INTERNAL ptm)
 
BOOL FASTCALL GreTextOutW (_In_ HDC hdc, _In_ INT nXStart, _In_ INT nYStart, _In_reads_(cchString) PCWCH lpString, _In_ INT cchString)
 
BOOL FASTCALL GreGetTextExtentW (_In_ HDC hDC, _In_reads_(cwc) PCWCH lpwsz, _In_ INT cwc, _Out_ PSIZE psize, _In_ UINT flOpts)
 
BOOL FASTCALL GreGetTextExtentExW (_In_ HDC hDC, _In_ PCWCH String, _In_ ULONG Count, _In_ ULONG MaxExtent, _Out_opt_ PULONG Fit, _Out_writes_to_opt_(Count, *Fit) PULONG Dx, _Out_ PSIZE pSize, _In_ FLONG fl)
 
BOOL WINAPI GreGetTextMetricsW (_In_ HDC hdc, _Out_ LPTEXTMETRICW lptm)
 
DWORD APIENTRY NtGdiGetCharSet (_In_ HDC hDC)
 
BOOL APIENTRY NtGdiGetRasterizerCaps (_Out_ LPRASTERIZER_STATUS praststat, _In_ ULONG cjBytes)
 
INT APIENTRY NtGdiGetTextCharsetInfo (_In_ HDC hdc, _Out_opt_ LPFONTSIGNATURE lpSig, _In_ DWORD dwFlags)
 
W32KAPI BOOL APIENTRY NtGdiGetTextExtentExW (_In_ HDC hDC, _In_reads_opt_(Count) PCWCH UnsafeString, _In_ ULONG Count, _In_ ULONG MaxExtent, _Out_opt_ PULONG UnsafeFit, _Out_writes_to_opt_(Count, *UnsafeFit) PULONG UnsafeDx, _Out_ PSIZE UnsafeSize, _In_ FLONG fl)
 
BOOL APIENTRY NtGdiGetTextExtent (_In_ HDC hdc, _In_reads_(cwc) PCWCH lpwsz, _In_ INT cwc, _Out_ PSIZE psize, _In_ UINT flOpts)
 
BOOL APIENTRY NtGdiSetTextJustification (_In_ HDC hDC, _In_ INT BreakExtra, _In_ INT BreakCount)
 
W32KAPI INT APIENTRY NtGdiGetTextFaceW (_In_ HDC hDC, _In_ INT Count, _Out_writes_to_opt_(Count, return) PWSTR FaceName, _In_ BOOL bAliasName)
 
W32KAPI BOOL APIENTRY NtGdiGetTextMetricsW (_In_ HDC hDC, _Out_ PTMW_INTERNAL pUnsafeTmwi, _In_ ULONG cj)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Includes

Definition at line 13 of file text.c.

Function Documentation

◆ GreGetTextExtentExW()

BOOL FASTCALL GreGetTextExtentExW ( _In_ HDC  hDC,
_In_ PCWCH  String,
_In_ ULONG  Count,
_In_ ULONG  MaxExtent,
_Out_opt_ PULONG  Fit,
_Out_writes_to_opt_(Count, *Fit) PULONG  Dx,
_Out_ PSIZE  pSize,
_In_ FLONG  fl 
)

Definition at line 133 of file text.c.

142{
143 PDC pdc;
144 PDC_ATTR pdcattr;
145 BOOL Result;
146 PTEXTOBJ TextObj;
147
148 if ( (!String && Count ) || !pSize )
149 {
151 return FALSE;
152 }
153
154 if ( !Count )
155 {
156 if ( Fit ) Fit = 0;
157 return TRUE;
158 }
159
160 pdc = DC_LockDc(hDC);
161 if (NULL == pdc)
162 {
164 return FALSE;
165 }
166 pdcattr = pdc->pdcattr;
167
168 TextObj = RealizeFontInit(pdcattr->hlfntNew);
169 if ( TextObj )
170 {
172 TextObj,
173 String,
174 Count,
175 MaxExtent,
176 (PINT)Fit,
177 (PINT)Dx,
178 pSize,
179 fl);
180 TEXTOBJ_UnlockText(TextObj);
181 }
182 else
183 Result = FALSE;
184
185 DC_UnlockDc(pdc);
186 return Result;
187}
static HDC hDC
Definition: 3dtext.c:33
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:238
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:220
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL FASTCALL TextIntGetTextExtentPoint(_In_ PDC dc, _In_ PTEXTOBJ TextObj, _In_reads_(Count) PCWCH String, _In_ INT Count, _In_ ULONG MaxExtent, _Out_ PINT Fit, _Out_writes_to_opt_(Count, *Fit) PINT Dx, _Out_ PSIZE Size, _In_ FLONG fl)
Definition: freetype.c:5154
int Count
Definition: noreturn.cpp:7
Definition: polytest.cpp:41
HANDLE hlfntNew
Definition: ntgdihdl.h:330
Definition: text.h:60
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
PTEXTOBJ FASTCALL RealizeFontInit(_In_ HFONT hFont)
Definition: font.c:431
FORCEINLINE VOID TEXTOBJ_UnlockText(PLFONT plfnt)
Definition: text.h:96
_In_ FLONG fl
Definition: winddi.h:1279
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:22
int * PINT
Definition: windef.h:177
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409

Referenced by TEXT_Ellipsify(), TEXT_NextLineW(), TEXT_PathEllipsify(), TEXT_WordBreak(), and UserDrawCaptionText().

◆ GreGetTextExtentW()

BOOL FASTCALL GreGetTextExtentW ( _In_ HDC  hDC,
_In_reads_(cwc) PCWCH  lpwsz,
_In_ INT  cwc,
_Out_ PSIZE  psize,
_In_ UINT  flOpts 
)

Definition at line 77 of file text.c.

83{
84 PDC pdc;
85 PDC_ATTR pdcattr;
87 PTEXTOBJ TextObj;
88
89 if (!cwc)
90 {
91 psize->cx = 0;
92 psize->cy = 0;
93 return TRUE;
94 }
95
96 pdc = DC_LockDc(hDC);
97 if (!pdc)
98 {
100 return FALSE;
101 }
102
103 pdcattr = pdc->pdcattr;
104
105 TextObj = RealizeFontInit(pdcattr->hlfntNew);
106 if ( TextObj )
107 {
109 TextObj,
110 lpwsz,
111 cwc,
112 0,
113 NULL,
114 0,
115 psize,
116 flOpts);
117 TEXTOBJ_UnlockText(TextObj);
118 }
119 else
120 Result = FALSE;
121
122 DC_UnlockDc(pdc);
123 return Result;
124}
_Must_inspect_result_ _Out_ LPSIZE psize
Definition: ntgdi.h:1569
LONG cx
Definition: windef.h:334
LONG cy
Definition: windef.h:335

Referenced by DrawTextExWorker(), IntPaintDesktop(), and TEXT_DrawUnderscore().

◆ GreGetTextMetricsW()

BOOL WINAPI GreGetTextMetricsW ( _In_ HDC  hdc,
_Out_ LPTEXTMETRICW  lptm 
)

Definition at line 191 of file text.c.

194{
195 TMW_INTERNAL tmwi;
196 if (!ftGdiGetTextMetricsW(hdc, &tmwi)) return FALSE;
197 IntTMWFixUp(hdc, &tmwi);
198 *lptm = tmwi.TextMetric;
199 return TRUE;
200}
BOOL FASTCALL ftGdiGetTextMetricsW(HDC hDC, PTMW_INTERNAL ptmwi)
Definition: freetype.c:5464
HDC hdc
Definition: main.c:9
static LPTEXTMETRICW lptm
Definition: font.c:42
TEXTMETRICW TextMetric
Definition: ntgdityp.h:370
VOID FASTCALL IntTMWFixUp(_In_ HDC hDC, _Inout_ PTMW_INTERNAL ptm)
Definition: text.c:29

Referenced by DrawTextExWorker().

◆ GreTextOutW()

BOOL FASTCALL GreTextOutW ( _In_ HDC  hdc,
_In_ INT  nXStart,
_In_ INT  nYStart,
_In_reads_(cchString) PCWCH  lpString,
_In_ INT  cchString 
)

Functions

Definition at line 60 of file text.c.

66{
67 return GreExtTextOutW(hdc, nXStart, nYStart, 0, NULL, lpString, cchString, NULL, 0);
68}
BOOL 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)
Definition: freetype.c:7504

Referenced by MENU_DrawPopupGlyph(), UITOOLS95_DFC_ButtonCheckRadio(), UITOOLS95_DrawFrameCaption(), UITOOLS95_DrawFrameMenu(), and UITOOLS95_DrawFrameScroll().

◆ IntTMWFixUp()

VOID FASTCALL IntTMWFixUp ( _In_ HDC  hDC,
_Inout_ PTMW_INTERNAL  ptm 
)

Definition at line 29 of file text.c.

32{
33 LOGFONTW lf;
34 HFONT hCurrentFont;
35
37 GreGetObject(hCurrentFont, sizeof(LOGFONTW), &lf);
38
39 /* To compensate for the GetTextMetricsW call changing the PitchAndFamily
40 * to a TrueType one when we have a 'Raster' font as our input we filter
41 * out the problematic TrueType and Vector bits.
42 * Our list below checks for Raster Font Facenames. */
43 DPRINT("Font Facename is '%S'.\n", lf.lfFaceName);
44 if ((_wcsicmp(lf.lfFaceName, L"Courier") == 0) ||
45 (_wcsicmp(lf.lfFaceName, L"FixedSys") == 0) ||
46 (_wcsicmp(lf.lfFaceName, L"Helv") == 0) ||
47 (_wcsicmp(lf.lfFaceName, L"MS Sans Serif") == 0) ||
48 (_wcsicmp(lf.lfFaceName, L"MS Serif") == 0) ||
49 (_wcsicmp(lf.lfFaceName, L"System") == 0) ||
50 (_wcsicmp(lf.lfFaceName, L"Terminal") == 0) ||
51 (_wcsicmp(lf.lfFaceName, L"Tms Rmn") == 0))
52 {
53 ptm->TextMetric.tmPitchAndFamily &= ~(TMPF_TRUETYPE | TMPF_VECTOR);
54 }
55}
#define GDI_OBJECT_TYPE_FONT
Definition: gdi.h:50
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
__kernel_entry W32KAPI HANDLE APIENTRY NtGdiGetDCObject(_In_ HDC hdc, _In_ INT itype)
#define L(x)
Definition: ntvdm.h:50
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define DPRINT
Definition: sndvol32.h:73
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
INT NTAPI GreGetObject(IN HGDIOBJ hobj, IN INT cbCount, OUT PVOID pvBuffer)
Definition: gdiobj.c:1270
#define TMPF_TRUETYPE
Definition: wingdi.h:1313
#define TMPF_VECTOR
Definition: wingdi.h:1312

Referenced by GreGetTextMetricsW(), and NtGdiGetTextMetricsW().

◆ NtGdiGetCharSet()

DWORD APIENTRY NtGdiGetCharSet ( _In_ HDC  hDC)

Definition at line 204 of file text.c.

205{
206 PDC Dc;
207 PDC_ATTR pdcattr;
208 DWORD cscp;
209 // If here, update everything!
210 Dc = DC_LockDc(hDC);
211 if (!Dc)
212 {
214 return 0;
215 }
216 cscp = ftGdiGetTextCharsetInfo(Dc, NULL, 0);
217 pdcattr = Dc->pdcattr;
218 pdcattr->iCS_CP = cscp;
219 pdcattr->ulDirty_ &= ~DIRTY_CHARSET;
220 DC_UnlockDc( Dc );
221 return cscp;
222}
unsigned long DWORD
Definition: ntddk_ex.h:95
INT FASTCALL ftGdiGetTextCharsetInfo(PDC Dc, LPFONTSIGNATURE lpSig, DWORD dwFlags)
Definition: freetype.c:5277
DWORD iCS_CP
Definition: ntgdihdl.h:305
ULONG ulDirty_
Definition: ntgdihdl.h:294

Referenced by GdiGetCodePage().

◆ NtGdiGetRasterizerCaps()

BOOL APIENTRY NtGdiGetRasterizerCaps ( _Out_ LPRASTERIZER_STATUS  praststat,
_In_ ULONG  cjBytes 
)

Definition at line 226 of file text.c.

229{
231 RASTERIZER_STATUS rsSafe;
232
233 if (praststat && cjBytes)
234 {
235 if ( cjBytes >= sizeof(RASTERIZER_STATUS) ) cjBytes = sizeof(RASTERIZER_STATUS);
236 if ( ftGdiGetRasterizerCaps(&rsSafe))
237 {
239 {
240 ProbeForWrite( praststat,
241 sizeof(RASTERIZER_STATUS),
242 1);
243 RtlCopyMemory(praststat, &rsSafe, cjBytes );
244 }
246 {
248 }
249 _SEH2_END;
250
251 if (!NT_SUCCESS(Status))
252 {
254 return FALSE;
255 }
256
257 return TRUE;
258 }
259 }
260 return FALSE;
261}
LONG NTSTATUS
Definition: precomp.h:26
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
BOOL FASTCALL ftGdiGetRasterizerCaps(LPRASTERIZER_STATUS lprs)
Definition: freetype.c:3948
Status
Definition: gdiplustypes.h:25
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:181
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:82
#define _SEH2_END
Definition: pseh2_64.h:171
#define _SEH2_TRY
Definition: pseh2_64.h:71
#define STATUS_SUCCESS
Definition: shellext.h:65
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
VOID FASTCALL SetLastNtError(_In_ NTSTATUS Status)
Definition: error.c:31
struct _RASTERIZER_STATUS RASTERIZER_STATUS

◆ NtGdiGetTextCharsetInfo()

INT APIENTRY NtGdiGetTextCharsetInfo ( _In_ HDC  hdc,
_Out_opt_ LPFONTSIGNATURE  lpSig,
_In_ DWORD  dwFlags 
)

Definition at line 265 of file text.c.

269{
270 PDC Dc;
271 INT Ret;
272 FONTSIGNATURE fsSafe;
273 PFONTSIGNATURE pfsSafe = &fsSafe;
275
276 Dc = DC_LockDc(hdc);
277 if (!Dc)
278 {
280 return DEFAULT_CHARSET;
281 }
282
283 if (!lpSig) pfsSafe = NULL;
284
285 Ret = HIWORD(ftGdiGetTextCharsetInfo( Dc, pfsSafe, dwFlags));
286
287 if (lpSig)
288 {
289 if (Ret == DEFAULT_CHARSET)
290 RtlZeroMemory(pfsSafe, sizeof(FONTSIGNATURE));
291
293 {
294 ProbeForWrite( lpSig,
295 sizeof(FONTSIGNATURE),
296 1);
297 RtlCopyMemory(lpSig, pfsSafe, sizeof(FONTSIGNATURE));
298 }
300 {
302 }
303 _SEH2_END;
304
305 if (!NT_SUCCESS(Status))
306 {
308 return DEFAULT_CHARSET;
309 }
310 }
311 DC_UnlockDc(Dc);
312 return Ret;
313}
int32_t INT
Definition: typedefs.h:58
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define HIWORD(l)
Definition: typedefs.h:247
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
#define DEFAULT_CHARSET
Definition: wingdi.h:384

Referenced by GetFontLanguageInfo(), and GetTextCharset().

◆ NtGdiGetTextExtent()

BOOL APIENTRY NtGdiGetTextExtent ( _In_ HDC  hdc,
_In_reads_(cwc) PCWCH  lpwsz,
_In_ INT  cwc,
_Out_ PSIZE  psize,
_In_ UINT  flOpts 
)

Definition at line 489 of file text.c.

495{
496 return NtGdiGetTextExtentExW(hdc, lpwsz, cwc, 0, NULL, NULL, psize, flOpts);
497}
__kernel_entry W32KAPI BOOL APIENTRY NtGdiGetTextExtentExW(_In_ HDC hdc, _In_reads_opt_(cwc) PCWCH pwsz, _In_ ULONG cwc, _In_ ULONG dxMax, _Out_opt_ PULONG pcCh, _Out_writes_to_opt_(cwc, *pcCh) PULONG pdxOut, _Out_ PSIZE psize, _In_ FLONG fl)

Referenced by GetTextExtentPoint32W(), GetTextExtentPointI(), and GetTextExtentPointW().

◆ NtGdiGetTextExtentExW()

W32KAPI BOOL APIENTRY NtGdiGetTextExtentExW ( _In_ HDC  hDC,
_In_reads_opt_(Count) PCWCH  UnsafeString,
_In_ ULONG  Count,
_In_ ULONG  MaxExtent,
_Out_opt_ PULONG  UnsafeFit,
_Out_writes_to_opt_(Count, *UnsafeFit) PULONG  UnsafeDx,
_Out_ PSIZE  UnsafeSize,
_In_ FLONG  fl 
)

Definition at line 324 of file text.c.

333{
334 PDC dc;
335 PDC_ATTR pdcattr;
337 SIZE Size;
340 INT Fit;
341 PINT Dx;
342 PTEXTOBJ TextObj;
343
344 if ((LONG)Count < 0)
345 {
347 return FALSE;
348 }
349
350 /* FIXME: Handle fl */
351
352 if (0 == Count)
353 {
354 Size.cx = 0;
355 Size.cy = 0;
356 Status = MmCopyToCaller(UnsafeSize, &Size, sizeof(SIZE));
357 if (! NT_SUCCESS(Status))
358 {
360 return FALSE;
361 }
362 return TRUE;
363 }
364
366 if (NULL == String)
367 {
369 return FALSE;
370 }
371
372 if (NULL != UnsafeDx)
373 {
375 if (NULL == Dx)
376 {
379 return FALSE;
380 }
381 }
382 else
383 {
384 Dx = NULL;
385 }
386
387 Status = MmCopyFromCaller(String, UnsafeString, Count * sizeof(WCHAR));
388 if (! NT_SUCCESS(Status))
389 {
390 if (NULL != Dx)
391 {
393 }
396 return FALSE;
397 }
398
399 dc = DC_LockDc(hDC);
400 if (NULL == dc)
401 {
402 if (NULL != Dx)
403 {
405 }
408 return FALSE;
409 }
410 pdcattr = dc->pdcattr;
411 TextObj = RealizeFontInit(pdcattr->hlfntNew);
412 if ( TextObj )
413 {
415 TextObj,
416 String,
417 Count,
418 MaxExtent,
419 NULL == UnsafeFit ? NULL : &Fit,
420 Dx,
421 &Size,
422 fl);
423 TEXTOBJ_UnlockText(TextObj);
424 }
425 else
426 Result = FALSE;
428
430 if (! Result)
431 {
432 if (NULL != Dx)
433 {
435 }
436 return FALSE;
437 }
438
439 if (NULL != UnsafeFit)
440 {
441 Status = MmCopyToCaller(UnsafeFit, &Fit, sizeof(INT));
442 if (! NT_SUCCESS(Status))
443 {
444 if (NULL != Dx)
445 {
447 }
449 return FALSE;
450 }
451 }
452
453 if (NULL != UnsafeDx)
454 {
455 Status = MmCopyToCaller(UnsafeDx, Dx, Count * sizeof(INT));
456 if (! NT_SUCCESS(Status))
457 {
458 if (NULL != Dx)
459 {
461 }
463 return FALSE;
464 }
465 }
466 if (NULL != Dx)
467 {
469 }
470
471 Status = MmCopyToCaller(UnsafeSize, &Size, sizeof(SIZE));
472 if (! NT_SUCCESS(Status))
473 {
475 return FALSE;
476 }
477
478 return TRUE;
479}
unsigned char BOOLEAN
HDC dc
Definition: cylfrac.c:34
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PagedPool
Definition: env_spec_w32.h:308
#define MmCopyToCaller(x, y, z)
Definition: mmcopy.h:19
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
long LONG
Definition: pedump.c:60
#define MmCopyFromCaller
Definition: polytest.cpp:29
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
#define GDITAG_TEXT
Definition: tags.h:172
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ NtGdiGetTextFaceW()

W32KAPI INT APIENTRY NtGdiGetTextFaceW ( _In_ HDC  hDC,
_In_ INT  Count,
_Out_writes_to_opt_(Count, return) PWSTR  FaceName,
_In_ BOOL  bAliasName 
)

Definition at line 529 of file text.c.

534{
535 PDC Dc;
536 PDC_ATTR pdcattr;
537 HFONT hFont;
538 PTEXTOBJ TextObj;
540 SIZE_T fLen;
541 INT ret;
542
543 /* FIXME: Handle bAliasName */
544
545 Dc = DC_LockDc(hDC);
546 if (Dc == NULL)
547 {
549 return FALSE;
550 }
551 pdcattr = Dc->pdcattr;
552 hFont = pdcattr->hlfntNew;
553 DC_UnlockDc(Dc);
554
555 TextObj = RealizeFontInit(hFont);
556 ASSERT(TextObj != NULL);
557 fLen = wcslen(TextObj->TextFace) + 1;
558
559 if (FaceName != NULL)
560 {
561 Count = min(Count, fLen);
562 Status = MmCopyToCaller(FaceName, TextObj->TextFace, Count * sizeof(WCHAR));
563 if (!NT_SUCCESS(Status))
564 {
565 TEXTOBJ_UnlockText(TextObj);
567 return 0;
568 }
569 /* Terminate if we copied only part of the font name */
570 if (Count > 0 && Count < fLen)
571 {
572 FaceName[Count - 1] = '\0';
573 }
574 ret = Count;
575 }
576 else
577 {
578 ret = fLen;
579 }
580
581 TEXTOBJ_UnlockText(TextObj);
582 return ret;
583}
HFONT hFont
Definition: main.c:53
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define ASSERT(a)
Definition: mode.c:44
#define min(a, b)
Definition: monoChain.cc:55
WCHAR TextFace[LF_FACESIZE]
Definition: text.h:67
ULONG_PTR SIZE_T
Definition: typedefs.h:80
int ret

Referenced by GetTextFaceAliasW(), and GetTextFaceW().

◆ NtGdiGetTextMetricsW()

W32KAPI BOOL APIENTRY NtGdiGetTextMetricsW ( _In_ HDC  hDC,
_Out_ PTMW_INTERNAL  pUnsafeTmwi,
_In_ ULONG  cj 
)

Definition at line 588 of file text.c.

592{
593 TMW_INTERNAL Tmwi;
594
595 if ( cj <= sizeof(TMW_INTERNAL) )
596 {
597 if (ftGdiGetTextMetricsW(hDC, &Tmwi))
598 {
599 IntTMWFixUp(hDC, &Tmwi);
601 {
602 ProbeForWrite(pUnsafeTmwi, cj, 1);
603 RtlCopyMemory(pUnsafeTmwi, &Tmwi, cj);
604 }
606 {
608 _SEH2_YIELD(return FALSE);
609 }
611
612 return TRUE;
613 }
614 }
615 return FALSE;
616}
#define _SEH2_YIELD(__stmt)
Definition: pseh2_64.h:184
_In_ ULONG cj
Definition: winddi.h:3540

Referenced by GetTextMetricsA(), and GetTextMetricsW().

◆ NtGdiSetTextJustification()

BOOL APIENTRY NtGdiSetTextJustification ( _In_ HDC  hDC,
_In_ INT  BreakExtra,
_In_ INT  BreakCount 
)

Definition at line 501 of file text.c.

505{
506 PDC pDc;
507 PDC_ATTR pdcattr;
508
509 pDc = DC_LockDc(hDC);
510 if (!pDc)
511 {
513 return FALSE;
514 }
515
516 pdcattr = pDc->pdcattr;
517
518 pdcattr->lBreakExtra = BreakExtra;
519 pdcattr->cBreak = BreakCount;
520
521 DC_UnlockDc(pDc);
522 return TRUE;
523}
LONG lBreakExtra
Definition: ntgdihdl.h:328
LONG cBreak
Definition: ntgdihdl.h:329