ReactOS 0.4.16-dev-1188-gc03d779
font.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS win32 kernel mode subsystem
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Font
5 * COPYRIGHT: Copyright (C) James Tabor <james.tabor@reactos.org>
6 * Copyright (C) Timo Kreuzer <timo.kreuzer@reactos.org>
7 * Copyright (C) Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
8 */
9
12#include <win32k.h>
13
14#define NDEBUG
15#include <debug.h>
16
19 _In_ const ENUMLOGFONTEXDVW *pelfw,
20 _In_ ULONG cjElfw,
21 _In_ LFTYPE lft,
23 _In_opt_ PVOID pvCliData);
24
29{
30 if (lplf)
31 {
32 ENUMLOGFONTEXDVW Logfont;
33
34 RtlCopyMemory( &Logfont.elfEnumLogfontEx.elfLogFont, lplf, sizeof(LOGFONTW));
36 sizeof(Logfont.elfEnumLogfontEx.elfFullName));
38 sizeof(Logfont.elfEnumLogfontEx.elfStyle));
40 sizeof(Logfont.elfEnumLogfontEx.elfScript));
41
42 Logfont.elfDesignVector.dvNumAxes = 0;
43
44 RtlZeroMemory( &Logfont.elfDesignVector, sizeof(DESIGNVECTOR));
45
46 return HfontCreate(&Logfont, 0, 0, 0, NULL);
47 }
48 else return NULL;
49}
50
54 _In_ HDC hDC,
55 _In_ ULONG NumPairs,
56 _Out_writes_(NumPairs) LPKERNINGPAIR krnpair)
57{
58 PDC dc;
59 PDC_ATTR pdcattr;
60 PTEXTOBJ TextObj;
61 PFONTGDI FontGDI;
63 KERNINGPAIR *pKP;
64
65 dc = DC_LockDc(hDC);
66 if (!dc)
67 {
69 return 0;
70 }
71
72 pdcattr = dc->pdcattr;
73 TextObj = RealizeFontInit(pdcattr->hlfntNew);
75
76 if (!TextObj)
77 {
79 return 0;
80 }
81
82 FontGDI = ObjToGDI(TextObj->Font, FONT);
83 TEXTOBJ_UnlockText(TextObj);
84
85 Count = ftGdiGetKerningPairs(FontGDI,0,NULL);
86
87 if ( Count && krnpair )
88 {
89 if (Count > NumPairs)
90 {
92 return 0;
93 }
95 if (!pKP)
96 {
98 return 0;
99 }
100 ftGdiGetKerningPairs(FontGDI,Count,pKP);
101
102 RtlCopyMemory(krnpair, pKP, Count * sizeof(KERNINGPAIR));
103
105 }
106 return Count;
107}
108
109/*
110 It is recommended that an application use the GetFontLanguageInfo function
111 to determine whether the GCP_DIACRITIC, GCP_DBCS, GCP_USEKERNING, GCP_LIGATE,
112 GCP_REORDER, GCP_GLYPHSHAPE, and GCP_KASHIDA values are valid for the
113 currently selected font. If not valid, GetCharacterPlacement ignores the
114 value.
115
116 MS must use a preset "compiled in" support for each language based releases.
117 ReactOS uses FreeType, this will need to be supported. ATM this is hard coded
118 for GCPCLASS_LATIN!
119 */
120#if 0
121DWORD
123GreGetCharacterPlacementW(
124 _In_ HDC hdc,
125 _In_reads_(nCount) PCWCH pwsz,
126 _In_ INT nCount,
127 _In_ INT nMaxExtent,
130{
131 GCP_RESULTSW gcpwSave;
132 UINT i, nSet, cSet;
133 INT *tmpDxCaretPos;
134 LONG Cx;
135 SIZE Size = {0,0};
136
137 DPRINT1("GreGCPW Start\n");
138
139 if (!pgcpw)
140 {
141 if (GreGetTextExtentW( hdc, pwsz, nCount, &Size, 1))
142 return MAKELONG(Size.cx, Size.cy);
143 return 0;
144 }
145
146 DPRINT1("GreGCPW 1\n");
147
148 RtlCopyMemory(&gcpwSave, pgcpw, sizeof(GCP_RESULTSW));
149
150 cSet = nSet = nCount;
151
152 if ( nCount > gcpwSave.nGlyphs ) cSet = gcpwSave.nGlyphs;
153
154 /* GCP_JUSTIFY may only be used in conjunction with GCP_MAXEXTENT. */
156
157 if ( !gcpwSave.lpDx && gcpwSave.lpCaretPos )
158 tmpDxCaretPos = gcpwSave.lpCaretPos;
159 else
160 tmpDxCaretPos = gcpwSave.lpDx;
161
163 pwsz,
164 cSet,
165 nMaxExtent,
166 ((dwFlags & GCP_MAXEXTENT) ? (PULONG) &cSet : NULL),
167 (PULONG) tmpDxCaretPos,
168 &Size,
169 0) )
170 {
171 return 0;
172 }
173
174 DPRINT1("GreGCPW 2\n");
175
176 nSet = cSet;
177
178 if ( tmpDxCaretPos && nSet > 0)
179 {
180 for (i = (nSet - 1); i > 0; i--)
181 {
182 tmpDxCaretPos[i] -= tmpDxCaretPos[i - 1];
183 }
184 }
185
186 if ( !(dwFlags & GCP_MAXEXTENT) || nSet )
187 {
188 if ( (dwFlags & GCP_USEKERNING) &&
189 ( gcpwSave.lpDx ||
190 gcpwSave.lpCaretPos ) &&
191 nSet >= 2 )
192 {
193 DWORD Count;
194 LPKERNINGPAIR pKP;
195
197 if (Count)
198 {
200 if (pKP)
201 {
202 if ( GreGetKerningPairs( hdc, Count, pKP) != Count)
203 {
205 return 0;
206 }
207
208 if ( (ULONG_PTR)(pKP) < ((ULONG_PTR)(pKP) + (ULONG_PTR)(Count * sizeof(KERNINGPAIR))) )
209 {
210 DPRINT1("We Need to Do Something HERE!\n");
211 }
212
214
215 if ( dwFlags & GCP_MAXEXTENT )
216 {
217 if ( Size.cx > nMaxExtent )
218 {
219 for (Cx = Size.cx; nSet > 0; nSet--)
220 {
221 Cx -= tmpDxCaretPos[nSet - 1];
222 Size.cx = Cx;
223 if ( Cx <= nMaxExtent ) break;
224 }
225 }
226 if ( !nSet )
227 {
228 pgcpw->nGlyphs = 0;
229 pgcpw->nMaxFit = 0;
230 return 0;
231 }
232 }
233 }
234 }
235 }
236
237 if ( (dwFlags & GCP_JUSTIFY) &&
238 ( gcpwSave.lpDx ||
239 gcpwSave.lpCaretPos ) &&
240 nSet )
241 {
242 DPRINT1("We Need to Do Something HERE 2!\n");
243 }
244
245 if ( gcpwSave.lpDx && gcpwSave.lpCaretPos )
246 RtlCopyMemory( gcpwSave.lpCaretPos, gcpwSave.lpDx, nSet * sizeof(LONG));
247
248 if ( gcpwSave.lpCaretPos )
249 {
250 int pos = 0;
251 i = 0;
252 if ( nSet > 0 )
253 {
254 do
255 {
256 Cx = gcpwSave.lpCaretPos[i];
257 gcpwSave.lpCaretPos[i] = pos;
258 pos += Cx;
259 ++i;
260 }
261 while ( i < nSet );
262 }
263 }
264
265 if ( gcpwSave.lpOutString )
266 RtlCopyMemory(gcpwSave.lpOutString, pwsz, nSet * sizeof(WCHAR));
267
268 if ( gcpwSave.lpClass )
269 RtlFillMemory(gcpwSave.lpClass, nSet, GCPCLASS_LATIN);
270
271 if ( gcpwSave.lpOrder )
272 {
273 for (i = 0; i < nSet; i++)
274 gcpwSave.lpOrder[i] = i;
275 }
276
277 if ( gcpwSave.lpGlyphs )
278 {
279 if ( GreGetGlyphIndicesW( hdc, pwsz, nSet, gcpwSave.lpGlyphs, 0, 0) == GDI_ERROR )
280 {
281 nSet = 0;
282 Size.cx = 0;
283 Size.cy = 0;
284 }
285 }
286 pgcpw->nGlyphs = nSet;
287 pgcpw->nMaxFit = nSet;
288 }
289 DPRINT1("GreGCPW Exit\n");
290 return MAKELONG(Size.cx, Size.cy);
291}
292#endif
293
294ULONG
297 _Inout_ PTEXTOBJ plfont,
299 _Out_ PVOID pvBuffer)
300{
301 ULONG cjMaxSize;
302 ENUMLOGFONTEXDVW *plf;
303
304 ASSERT(plfont);
305 plf = &plfont->logfont;
306
307 if (!(plfont->fl & TEXTOBJECT_INIT))
308 {
310 DPRINT("FontGetObject font not initialized!\n");
311
312 Status = TextIntRealizeFont(plfont->BaseObject.hHmgr, plfont);
313 if (!NT_SUCCESS(Status))
314 {
315 DPRINT1("FontGetObject(TextIntRealizeFont) Status = 0x%lx\n", Status);
316 }
317 }
318
319 /* If buffer is NULL, only the size is requested */
320 if (pvBuffer == NULL) return sizeof(LOGFONTW);
321
322 /* Calculate the maximum size according to number of axes */
323 cjMaxSize = FIELD_OFFSET(ENUMLOGFONTEXDVW,
324 elfDesignVector.dvValues[plf->elfDesignVector.dvNumAxes]);
325
326 if (cjBuffer > cjMaxSize) cjBuffer = cjMaxSize;
327
328 RtlCopyMemory(pvBuffer, plf, cjBuffer);
329
330 return cjBuffer;
331}
332
333DWORD
336 _In_ HDC hdc,
339{
340 PDC pdc;
341 PDC_ATTR pdcattr;
342 PTEXTOBJ TextObj;
343 SIZE sz;
344 TMW_INTERNAL tmwi;
345 BOOL Good;
346
347 static const WCHAR alphabet[] = {
348 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q',
349 'r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H',
350 'I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',0};
351
352 if(!ftGdiGetTextMetricsW(hdc, &tmwi)) return 0;
353
354 pdc = DC_LockDc(hdc);
355
356 if (!pdc) return 0;
357
358 pdcattr = pdc->pdcattr;
359
360 TextObj = RealizeFontInit(pdcattr->hlfntNew);
361 if ( !TextObj )
362 {
363 DC_UnlockDc(pdc);
364 return 0;
365 }
366 Good = TextIntGetTextExtentPoint(pdc, TextObj, alphabet, 52, 0, NULL, NULL, &sz, 0);
367 TEXTOBJ_UnlockText(TextObj);
368 DC_UnlockDc(pdc);
369
370 if (!Good) return 0;
371 if (ptm) *ptm = tmwi.TextMetric;
372 if (height) *height = tmwi.TextMetric.tmHeight;
373
374 return (sz.cx / 26 + 1) / 2;
375}
376
377
378DWORD
381{
382 PDC_ATTR pdcattr;
383 FONTSIGNATURE fontsig;
384 static const DWORD GCP_DBCS_MASK=0x003F0000,
385 GCP_DIACRITIC_MASK=0x00000000,
386 FLI_GLYPHS_MASK=0x00000000,
387 GCP_GLYPHSHAPE_MASK=0x00000040,
388 GCP_KASHIDA_MASK=0x00000000,
389 GCP_LIGATE_MASK=0x00000000,
390 GCP_USEKERNING_MASK=0x00000000,
391 GCP_REORDER_MASK=0x00000060;
392
393 DWORD result=0;
394
395 ftGdiGetTextCharsetInfo( Dc, &fontsig, 0 );
396
397 /* We detect each flag we return using a bitmask on the Codepage Bitfields */
398 if( (fontsig.fsCsb[0]&GCP_DBCS_MASK)!=0 )
400
401 if( (fontsig.fsCsb[0]&GCP_DIACRITIC_MASK)!=0 )
403
404 if( (fontsig.fsCsb[0]&FLI_GLYPHS_MASK)!=0 )
406
407 if( (fontsig.fsCsb[0]&GCP_GLYPHSHAPE_MASK)!=0 )
409
410 if( (fontsig.fsCsb[0]&GCP_KASHIDA_MASK)!=0 )
412
413 if( (fontsig.fsCsb[0]&GCP_LIGATE_MASK)!=0 )
415
416 if( (fontsig.fsCsb[0]&GCP_USEKERNING_MASK)!=0 )
418
419 pdcattr = Dc->pdcattr;
420
421 /* This might need a test for a HEBREW- or ARABIC_CHARSET as well */
422 if ( pdcattr->flTextAlign & TA_RTLREADING )
423 if( (fontsig.fsCsb[0]&GCP_REORDER_MASK)!=0 )
425
426 return result;
427}
428
432{
434 PTEXTOBJ pTextObj;
435
436 pTextObj = TEXTOBJ_LockText(hFont);
437
438 if ( pTextObj && !(pTextObj->fl & TEXTOBJECT_INIT))
439 {
440 Status = TextIntRealizeFont(hFont, pTextObj);
441 if (!NT_SUCCESS(Status))
442 {
443 TEXTOBJ_UnlockText(pTextObj);
444 return NULL;
445 }
446 }
447 return pTextObj;
448}
449
450static BOOL
452 _In_reads_(cwc) PCWCH pwcFiles,
453 _In_ ULONG cFiles,
454 _In_ ULONG cwc)
455{
456 ULONG ich, cRealFiles;
457
458 if (pwcFiles[cwc - 1] != UNICODE_NULL)
459 return FALSE;
460
461 for (ich = cRealFiles = 0; ich < cwc; ++ich)
462 {
463 if (!pwcFiles[ich])
464 ++cRealFiles;
465 }
466
467 return cRealFiles >= cFiles;
468}
469
472INT
475 _In_reads_(cwc) PCWCH pwcFiles,
476 _In_ ULONG cwc,
477 _In_ ULONG cFiles,
478 _In_ FLONG fl,
479 _In_ DWORD dwPidTid,
481{
482 UNICODE_STRING SafeFileName;
483 INT Ret;
484
487
488 DPRINT("NtGdiAddFontResourceW\n");
489
490 /* cwc = Length + trailing zero. */
491 if ((cwc <= 1) || (cwc > UNICODE_STRING_MAX_CHARS))
492 return 0;
493
494 SafeFileName.Length = (USHORT)((cwc - 1) * sizeof(WCHAR));
495 SafeFileName.MaximumLength = SafeFileName.Length + sizeof(UNICODE_NULL);
497 SafeFileName.MaximumLength,
498 TAG_STRING);
499 if (!SafeFileName.Buffer)
500 return 0;
501
503 {
504 ProbeForRead(pwcFiles, cwc * sizeof(WCHAR), sizeof(WCHAR));
505
506 if (!IntCheckFontPathNames(pwcFiles, cFiles, cwc))
507 return 0;
508
509 RtlCopyMemory(SafeFileName.Buffer, pwcFiles, SafeFileName.Length);
510 }
512 {
513 ExFreePoolWithTag(SafeFileName.Buffer, TAG_STRING);
514 _SEH2_YIELD(return 0);
515 }
516 _SEH2_END;
517
518 SafeFileName.Buffer[SafeFileName.Length / sizeof(WCHAR)] = UNICODE_NULL;
519
520 Ret = IntGdiAddFontResourceEx(&SafeFileName, cFiles, fl, 0);
521
522 ExFreePoolWithTag(SafeFileName.Buffer, TAG_STRING);
523 return Ret;
524}
525
526BOOL
529 _In_reads_(cwc) PCWCH pwszFiles,
530 _In_ ULONG cwc,
531 _In_ ULONG cFiles,
532 _In_ ULONG fl,
533 _In_ DWORD dwPidTid,
535{
536 UNICODE_STRING SafeFileName;
537 BOOL Ret;
538
541
542 DPRINT("NtGdiRemoveFontResourceW\n");
543
544 /* cwc = Length + trailing zero. */
545 if ((cwc <= 1) || (cwc > UNICODE_STRING_MAX_CHARS))
546 return FALSE;
547
548 SafeFileName.Length = (USHORT)((cwc - 1) * sizeof(WCHAR));
549 SafeFileName.MaximumLength = SafeFileName.Length + sizeof(UNICODE_NULL);
551 SafeFileName.MaximumLength,
552 TAG_STRING);
553 if (!SafeFileName.Buffer)
554 return FALSE;
555
557 {
558 ProbeForRead(pwszFiles, cwc * sizeof(WCHAR), sizeof(WCHAR));
559
560 if (!IntCheckFontPathNames(pwszFiles, cFiles, cwc))
561 return FALSE;
562
563 RtlCopyMemory(SafeFileName.Buffer, pwszFiles, SafeFileName.Length);
564 }
566 {
567 ExFreePoolWithTag(SafeFileName.Buffer, TAG_STRING);
568 _SEH2_YIELD(return FALSE);
569 }
570 _SEH2_END;
571
572 SafeFileName.Buffer[SafeFileName.Length / sizeof(WCHAR)] = UNICODE_NULL;
573
574 Ret = IntGdiRemoveFontResource(&SafeFileName, cFiles, fl);
575
576 ExFreePoolWithTag(SafeFileName.Buffer, TAG_STRING);
577 return Ret;
578}
579
580HANDLE
583 _In_reads_bytes_(cjBuffer) const VOID *pvBuffer,
586 _In_ ULONG cjDV,
587 _Out_ PDWORD pNumFonts)
588{
590 HANDLE Ret;
591 DWORD NumFonts = 0;
592
593 DPRINT("NtGdiAddFontMemResourceEx\n");
596
597 if (!pvBuffer || !cjBuffer)
598 return NULL;
599
601 {
602 ProbeForRead(pvBuffer, cjBuffer, sizeof(BYTE));
604 RtlCopyMemory(Buffer, pvBuffer, cjBuffer);
605 }
607 {
608 if (Buffer != NULL)
609 {
611 }
612 _SEH2_YIELD(return NULL);
613 }
614 _SEH2_END;
615
616 Ret = IntGdiAddFontMemResource(Buffer, cjBuffer, &NumFonts);
618
620 {
621 ProbeForWrite(pNumFonts, sizeof(NumFonts), 1);
622 *pNumFonts = NumFonts;
623 }
625 {
626 /* Leak it? */
627 _SEH2_YIELD(return NULL);
628 }
629 _SEH2_END;
630
631
632 return Ret;
633}
634
635
636BOOL
639 _In_ HANDLE hMMFont)
640{
641 return IntGdiRemoveFontMemResource(hMMFont);
642}
643
644
645 /*
646 * @unimplemented
647 */
648DWORD
651 _In_ HDC hdc,
652 _In_reads_(nCount) PCWCH pwsz,
653 _In_ INT nCount,
654 _In_ INT nMaxExtent,
657{
659 return 0;
660#if 0
661 return GreGetCharacterPlacementW( hdc,
662 pwsz,
663 nCount,
664 nMaxExtent,
665 pgcpw,
666 dwFlags);
667#endif
668}
669
670DWORD
673 _In_ HDC hDC,
678{
679 PDC Dc;
680 PDC_ATTR pdcattr;
681 HFONT hFont;
682 PTEXTOBJ TextObj;
683 PFONTGDI FontGdi;
686
687 if (Buffer && Size)
688 {
690 {
692 }
694 {
696 }
698 }
699
700 if (!NT_SUCCESS(Status)) return Result;
701
702 Dc = DC_LockDc(hDC);
703 if (Dc == NULL)
704 {
706 return GDI_ERROR;
707 }
708 pdcattr = Dc->pdcattr;
709
710 hFont = pdcattr->hlfntNew;
711 TextObj = RealizeFontInit(hFont);
712 DC_UnlockDc(Dc);
713
714 if (TextObj == NULL)
715 {
717 return GDI_ERROR;
718 }
719
720 FontGdi = ObjToGDI(TextObj->Font, FONT);
721
723
724 TEXTOBJ_UnlockText(TextObj);
725
726 return Result;
727}
728
729/* @implemented */
730DWORD
733 _In_ HDC hdc,
734 _Out_opt_ LPGLYPHSET pgs)
735{
736 PDC pDc;
737 PDC_ATTR pdcattr;
738 HFONT hFont;
739 PTEXTOBJ TextObj;
740 PFONTGDI FontGdi;
741 DWORD Size = 0;
742 PGLYPHSET pgsSafe;
744
745 pDc = DC_LockDc(hdc);
746 if (!pDc)
747 {
749 return 0;
750 }
751
752 pdcattr = pDc->pdcattr;
753
754 hFont = pdcattr->hlfntNew;
755 TextObj = RealizeFontInit(hFont);
756
757 if ( TextObj == NULL)
758 {
760 goto Exit;
761 }
762 FontGdi = ObjToGDI(TextObj->Font, FONT);
763
764 Size = ftGetFontUnicodeRanges( FontGdi, NULL);
765
766 if (Size && pgs)
767 {
769 if (!pgsSafe)
770 {
772 Size = 0;
773 goto Exit;
774 }
775
776 Size = ftGetFontUnicodeRanges( FontGdi, pgsSafe);
777
778 if (Size)
779 {
781 {
782 ProbeForWrite(pgs, Size, 1);
783 RtlCopyMemory(pgs, pgsSafe, Size);
784 }
786 {
788 }
790
791 if (!NT_SUCCESS(Status)) Size = 0;
792 }
794 }
795Exit:
796 TEXTOBJ_UnlockText(TextObj);
797 DC_UnlockDc(pDc);
798 return Size;
799}
800
801ULONG
804 _In_ HDC hdc,
805 _In_ WCHAR wch,
810 _In_opt_ const MAT2 *pmat2,
811 _In_ BOOL bIgnoreRotation)
812{
813 ULONG Ret = GDI_ERROR;
814 PDC dc;
815 PVOID pvBuf = NULL;
816 GLYPHMETRICS gm;
818
819 dc = DC_LockDc(hdc);
820 if (!dc)
821 {
823 return GDI_ERROR;
824 }
825
826 if (UnsafeBuf && cjBuf)
827 {
829 if (!pvBuf)
830 {
832 goto Exit;
833 }
834 }
835
837 wch,
838 iFormat,
839 pgm ? &gm : NULL,
840 cjBuf,
841 pvBuf,
842 pmat2,
843 bIgnoreRotation);
844
845 if (pvBuf)
846 {
848 {
849 ProbeForWrite(UnsafeBuf, cjBuf, 1);
850 RtlCopyMemory(UnsafeBuf, pvBuf, cjBuf);
851 }
853 {
855 }
857
859 }
860
861 if (pgm)
862 {
864 {
865 ProbeForWrite(pgm, sizeof(GLYPHMETRICS), 1);
866 RtlCopyMemory(pgm, &gm, sizeof(GLYPHMETRICS));
867 }
869 {
871 }
873 }
874
875 if (! NT_SUCCESS(Status))
876 {
878 Ret = GDI_ERROR;
879 }
880
881Exit:
883 return Ret;
884}
885
886DWORD
889 _In_ HDC hDC,
890 _In_ ULONG NumPairs,
891 _Out_writes_(NumPairs) LPKERNINGPAIR krnpair)
892{
893 PDC dc;
894 PDC_ATTR pdcattr;
895 PTEXTOBJ TextObj;
896 PFONTGDI FontGDI;
897 DWORD Count;
898 KERNINGPAIR *pKP;
900
901 dc = DC_LockDc(hDC);
902 if (!dc)
903 {
905 return 0;
906 }
907
908 pdcattr = dc->pdcattr;
909 TextObj = RealizeFontInit(pdcattr->hlfntNew);
911
912 if (!TextObj)
913 {
915 return 0;
916 }
917
918 FontGDI = ObjToGDI(TextObj->Font, FONT);
919 TEXTOBJ_UnlockText(TextObj);
920
921 Count = ftGdiGetKerningPairs(FontGDI,0,NULL);
922
923 if ( Count && krnpair )
924 {
925 if (Count > NumPairs)
926 {
928 return 0;
929 }
931 if (!pKP)
932 {
934 return 0;
935 }
936 ftGdiGetKerningPairs(FontGDI,Count,pKP);
938 {
939 ProbeForWrite(krnpair, Count * sizeof(KERNINGPAIR), 1);
940 RtlCopyMemory(krnpair, pKP, Count * sizeof(KERNINGPAIR));
941 }
943 {
945 }
947 if (!NT_SUCCESS(Status))
948 {
950 Count = 0;
951 }
953 }
954 return Count;
955}
956
957/*
958 From "Undocumented Windows 2000 Secrets" Appendix B, Table B-2, page
959 472, this is NtGdiGetOutlineTextMetricsInternalW.
960 */
961ULONG
964 _In_ HDC hDC,
967 _In_ PTMDIFF Tmd)
968{
969 PDC dc;
970 PDC_ATTR pdcattr;
971 PTEXTOBJ TextObj;
972 PFONTGDI FontGDI;
973 HFONT hFont = 0;
974 ULONG Size;
975 OUTLINETEXTMETRICW *potm;
977
978 dc = DC_LockDc(hDC);
979 if (!dc)
980 {
982 return 0;
983 }
984 pdcattr = dc->pdcattr;
985 hFont = pdcattr->hlfntNew;
986 TextObj = RealizeFontInit(hFont);
988 if (!TextObj)
989 {
991 return 0;
992 }
993 FontGDI = ObjToGDI(TextObj->Font, FONT);
994 if (!(FontGDI->flType & FO_TYPE_TRUETYPE))
995 {
996 TEXTOBJ_UnlockText(TextObj);
997 return 0;
998 }
999 TextIntUpdateSize(dc, TextObj, FontGDI, TRUE);
1000 TEXTOBJ_UnlockText(TextObj);
1001 Size = IntGetOutlineTextMetrics(FontGDI, 0, NULL, FALSE);
1002 if (!otm) return Size;
1003 if (Size > Data)
1004 {
1006 return 0;
1007 }
1009 if (!potm)
1010 {
1012 return 0;
1013 }
1014 RtlZeroMemory(potm, Size);
1015 IntGetOutlineTextMetrics(FontGDI, Size, potm, FALSE);
1016
1017 _SEH2_TRY
1018 {
1019 ProbeForWrite(otm, Size, 1);
1020 RtlCopyMemory(otm, potm, Size);
1021 }
1023 {
1025 }
1026 _SEH2_END
1027
1028 if (!NT_SUCCESS(Status))
1029 {
1031 Size = 0;
1032 }
1033
1035 return Size;
1036}
1037
1038W32KAPI
1039BOOL
1042 _In_reads_(cwc) PCWCH pwszFiles,
1043 _In_ ULONG cwc,
1044 _In_ ULONG cFiles,
1045 _In_ UINT cjIn,
1048 _In_ DWORD dwType)
1049{
1051 DWORD dwBytes, dwBytesRequested;
1052 UNICODE_STRING SafeFileNames;
1053 BOOL bRet = FALSE;
1054 ULONG cbStringSize;
1055 LPVOID Buffer;
1056
1057 /* FIXME: Handle cFiles > 0 */
1058
1059 /* Check for valid dwType values */
1060 if (dwType > 5)
1061 {
1063 return FALSE;
1064 }
1065
1066 /* Allocate a safe unicode string buffer */
1067 cbStringSize = cwc * sizeof(WCHAR);
1068 SafeFileNames.MaximumLength = SafeFileNames.Length = (USHORT)cbStringSize - sizeof(WCHAR);
1069 SafeFileNames.Buffer = ExAllocatePoolWithTag(PagedPool,
1070 cbStringSize,
1071 TAG_USTR);
1072 if (!SafeFileNames.Buffer)
1073 {
1075 return FALSE;
1076 }
1077 RtlZeroMemory(SafeFileNames.Buffer, SafeFileNames.MaximumLength);
1078
1079 /* Check buffers and copy pwszFiles to safe unicode string */
1080 _SEH2_TRY
1081 {
1082 ProbeForRead(pwszFiles, cbStringSize, 1);
1083 ProbeForWrite(pdwBytes, sizeof(DWORD), 1);
1084 if (pvBuf)
1085 ProbeForWrite(pvBuf, cjIn, 1);
1086
1087 dwBytes = *pdwBytes;
1088 dwBytesRequested = dwBytes;
1089
1090 RtlCopyMemory(SafeFileNames.Buffer, pwszFiles, cbStringSize);
1091 if (dwBytes > 0)
1092 {
1094 }
1095 else
1096 {
1098 }
1099 }
1101 {
1103 }
1104 _SEH2_END
1105
1106 if(!NT_SUCCESS(Status))
1107 {
1109 /* Free the string buffer for the safe filename */
1110 ExFreePoolWithTag(SafeFileNames.Buffer, TAG_USTR);
1111 return FALSE;
1112 }
1113
1114 /* Do the actual call */
1115 bRet = IntGdiGetFontResourceInfo(&SafeFileNames,
1116 (pvBuf ? Buffer : NULL),
1117 &dwBytes, dwType);
1118
1119 /* Check if succeeded */
1120 if (bRet)
1121 {
1122 /* Copy the data back to caller */
1123 _SEH2_TRY
1124 {
1125 /* Buffers are already probed */
1126 if (pvBuf && dwBytesRequested > 0)
1127 RtlCopyMemory(pvBuf, Buffer, min(dwBytesRequested, dwBytes));
1128 *pdwBytes = dwBytes;
1129 }
1131 {
1133 }
1134 _SEH2_END
1135
1136 if(!NT_SUCCESS(Status))
1137 {
1139 bRet = FALSE;
1140 }
1141 }
1142
1144 /* Free the string for the safe filenames */
1145 ExFreePoolWithTag(SafeFileNames.Buffer, TAG_USTR);
1146
1147 return bRet;
1148}
1149
1150/* @unimplemented */
1151BOOL
1154 _In_ HDC hdc,
1156 _In_ HFONT hf)
1157{
1158 PDC pDc;
1159 PTEXTOBJ pTextObj;
1160 PFONTGDI pFontGdi;
1161 PDC_ATTR pdcattr;
1162 BOOL Ret = FALSE;
1163 INT i = 0;
1165
1166 pDc = DC_LockDc(hdc);
1167 if (!pDc)
1168 {
1170 return 0;
1171 }
1172 pdcattr = pDc->pdcattr;
1173 pTextObj = RealizeFontInit(pdcattr->hlfntNew);
1174 ASSERT(pTextObj != NULL);
1175 pFontGdi = ObjToGDI(pTextObj->Font, FONT);
1176 TEXTOBJ_UnlockText(pTextObj);
1177 DC_UnlockDc(pDc);
1178
1179 Ret = ftGdiRealizationInfo(pFontGdi, &ri);
1180 if (Ret)
1181 {
1182 if (pri)
1183 {
1185 _SEH2_TRY
1186 {
1187 ProbeForWrite(pri, sizeof(REALIZATION_INFO), 1);
1188 RtlCopyMemory(pri, &ri, sizeof(REALIZATION_INFO));
1189 }
1191 {
1193 }
1194 _SEH2_END
1195
1196 if(!NT_SUCCESS(Status))
1197 {
1199 return FALSE;
1200 }
1201 }
1202 do
1203 {
1204 if (GdiHandleTable->cfPublic[i].hf == hf)
1205 {
1206 GdiHandleTable->cfPublic[i].iTechnology = ri.iTechnology;
1207 GdiHandleTable->cfPublic[i].iUniq = ri.iUniq;
1208 GdiHandleTable->cfPublic[i].dwUnknown = ri.dwUnknown;
1209 GdiHandleTable->cfPublic[i].dwCFCount = GdiHandleTable->dwCFCount;
1210 GdiHandleTable->cfPublic[i].fl |= CFONT_REALIZATION;
1211 }
1212 i++;
1213 }
1214 while ( i < GDI_CFONT_MAX );
1215 }
1216 return Ret;
1217}
1218
1219HFONT
1222 const ENUMLOGFONTEXDVW *pelfw,
1223 _In_ ULONG cjElfw,
1224 _In_ LFTYPE lft,
1225 _In_ FLONG fl,
1226 _In_opt_ PVOID pvCliData)
1227{
1228 HFONT hNewFont;
1229 PLFONT plfont;
1230
1231 if (!pelfw)
1232 {
1233 return NULL;
1234 }
1235
1236 plfont = LFONT_AllocFontWithHandle();
1237 if (!plfont)
1238 {
1239 return NULL;
1240 }
1241 hNewFont = plfont->BaseObject.hHmgr;
1242
1243 plfont->lft = lft;
1244 plfont->fl = fl;
1245 RtlCopyMemory (&plfont->logfont, pelfw, sizeof(ENUMLOGFONTEXDVW));
1246 ExInitializePushLock(&plfont->lock);
1247
1250 {
1251 /* This should really depend on whether GM_ADVANCED is set */
1254 }
1255 LFONT_UnlockFont(plfont);
1256
1257 if (pvCliData && hNewFont)
1258 {
1259 // FIXME: Use GDIOBJ_InsertUserData
1261 {
1264 Entry->UserData = pvCliData;
1265 }
1267 }
1268
1269 return hNewFont;
1270}
1271
1272
1273HFONT
1276 _In_reads_bytes_(cjElfw) const ENUMLOGFONTEXDVW *pelfw,
1277 _In_ ULONG cjElfw,
1278 _In_ LFTYPE lft,
1279 _In_ FLONG fl,
1280 _In_opt_ PVOID pvCliData)
1281{
1282 ENUMLOGFONTEXDVW SafeLogfont;
1284
1285 /* Silence GCC warnings */
1288
1289 if (!pelfw)
1290 {
1291 return NULL;
1292 }
1293
1294 _SEH2_TRY
1295 {
1296 ProbeForRead(pelfw, sizeof(ENUMLOGFONTEXDVW), 1);
1297 RtlCopyMemory(&SafeLogfont, pelfw, sizeof(ENUMLOGFONTEXDVW));
1298 }
1300 {
1302 }
1303 _SEH2_END
1304
1305 if (!NT_SUCCESS(Status))
1306 {
1307 return NULL;
1308 }
1309
1310 return HfontCreate(&SafeLogfont, cjElfw, lft, fl, pvCliData);
1311}
static HDC hDC
Definition: 3dtext.c:33
INT APIENTRY NtGdiAddFontResourceW(_In_reads_(cwc) WCHAR *pwszFiles, _In_ ULONG cwc, _In_ ULONG cFiles, _In_ FLONG f, _In_ DWORD dwPidTid, _In_opt_ DESIGNVECTOR *pdv)
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
HFONT hFont
Definition: main.c:53
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15
HGDIOBJ hHmgr(VOID)
Definition: baseobj.hpp:95
Definition: bufpool.h:45
HDC dc
Definition: cylfrac.c:34
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:238
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:220
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define TAG_USTR
Definition: libsupp.c:997
#define APIENTRY
Definition: api.h:79
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define ObjToGDI(ClipObj, Type)
Definition: engobjects.h:184
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PagedPool
Definition: env_spec_w32.h:308
#define ExInitializePushLock
Definition: ex.h:1016
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL FASTCALL TextIntUpdateSize(PDC dc, PTEXTOBJ TextObj, PFONTGDI FontGDI, BOOL bDoLock)
Definition: freetype.c:4417
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
DWORD FASTCALL ftGdiGetKerningPairs(PFONTGDI Font, DWORD cPairs, LPKERNINGPAIR pKerningPair)
Definition: freetype.c:6581
BOOL FASTCALL ftGdiGetTextMetricsW(HDC hDC, PTMW_INTERNAL ptmwi)
Definition: freetype.c:5464
BOOL FASTCALL IntGdiRemoveFontResource(_In_ PCUNICODE_STRING FileName, _In_ DWORD cFiles, _In_ DWORD dwFlags)
Definition: freetype.c:2453
BOOL FASTCALL IntGdiGetFontResourceInfo(PUNICODE_STRING FileName, PVOID pBuffer, DWORD *pdwBytes, DWORD dwType)
Definition: freetype.c:6294
DWORD FASTCALL ftGetFontUnicodeRanges(PFONTGDI Font, PGLYPHSET glyphset)
Definition: freetype.c:5390
INT FASTCALL IntGdiAddFontResourceEx(_In_ PCUNICODE_STRING FileName, _In_ DWORD cFiles, _In_ DWORD Characteristics, _In_ DWORD dwFlags)
Definition: freetype.c:2292
BOOL FASTCALL ftGdiRealizationInfo(PFONTGDI Font, PREALIZATION_INFO Info)
Definition: freetype.c:6562
ULONG FASTCALL ftGdiGetGlyphOutline(PDC dc, WCHAR wch, UINT iFormat, LPGLYPHMETRICS pgm, ULONG cjBuf, PVOID pvBuf, const MAT2 *pmat2, BOOL bIgnoreRotation)
Definition: freetype.c:4626
BOOL FASTCALL IntGdiRemoveFontMemResource(HANDLE hMMFont)
Definition: freetype.c:2737
NTSTATUS FASTCALL TextIntRealizeFont(HFONT FontHandle, PTEXTOBJ pTextObj)
Definition: freetype.c:6104
HANDLE FASTCALL IntGdiAddFontMemResource(PVOID Buffer, DWORD dwSize, PDWORD pNumAdded)
Definition: freetype.c:2651
INT FASTCALL ftGdiGetTextCharsetInfo(PDC Dc, LPFONTSIGNATURE lpSig, DWORD dwFlags)
Definition: freetype.c:5277
DWORD FASTCALL ftGdiGetFontData(PFONTGDI FontGdi, DWORD Table, DWORD Offset, PVOID Buffer, DWORD Size)
Definition: freetype.c:5562
INT FASTCALL IntGetOutlineTextMetrics(PFONTGDI FontGDI, UINT Size, OUTLINETEXTMETRICW *Otm, BOOL bLocked)
Definition: freetype.c:3264
#define GDI_HANDLE_GET_INDEX(h)
Definition: gdi.h:28
Status
Definition: gdiplustypes.h:25
ASMGENDATA Table[]
Definition: genincdata.c:61
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLuint64EXT * result
Definition: glext.h:11304
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define RtlFillMemory(Dest, Length, Fill)
Definition: winternl.h:599
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
#define KeLeaveCriticalRegion()
Definition: ke_x.h:119
#define KeEnterCriticalRegion()
Definition: ke_x.h:88
static PWSTR PDWORD pdwBytes
Definition: layerapi.c:35
#define ASSERT(a)
Definition: mode.c:44
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
HDC hdc
Definition: main.c:9
FORCEINLINE PVOID ExAllocatePoolZero(ULONG PoolType, SIZE_T NumberOfBytes, ULONG Tag)
Definition: precomp.h:45
static HDC
Definition: imagelist.c:88
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define min(a, b)
Definition: monoChain.cc:55
unsigned int UINT
Definition: ndis.h:50
#define _In_reads_bytes_(s)
Definition: no_sal2.h:170
#define _In_reads_(s)
Definition: no_sal2.h:168
#define _Out_opt_
Definition: no_sal2.h:214
#define _Inout_
Definition: no_sal2.h:162
#define _Out_writes_bytes_opt_(s)
Definition: no_sal2.h:228
#define _Inout_opt_
Definition: no_sal2.h:216
#define _Out_writes_(s)
Definition: no_sal2.h:176
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define _Out_writes_bytes_(s)
Definition: no_sal2.h:178
#define _In_reads_bytes_opt_(s)
Definition: no_sal2.h:224
int Count
Definition: noreturn.cpp:7
#define FASTCALL
Definition: nt_native.h:50
unsigned long FLONG
Definition: ntbasedef.h:378
CONST WCHAR * PCWCH
Definition: ntbasedef.h:423
#define UNICODE_NULL
#define UNICODE_STRING_MAX_CHARS
#define DBG_UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:330
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
__kernel_entry W32KAPI ULONG APIENTRY NtGdiGetKerningPairs(_In_ HDC hdc, _In_ ULONG cPairs, _Out_writes_to_opt_(cPairs, return) KERNINGPAIR *pkpDst)
__kernel_entry W32KAPI HFONT APIENTRY NtGdiHfontCreate(_In_reads_bytes_(cjElfw) const ENUMLOGFONTEXDVW *pelfw, _In_ ULONG cjElfw, _In_ LFTYPE lft, _In_ FLONG fl, _In_opt_ PVOID pvCliData)
Definition: font.c:1275
__kernel_entry W32KAPI ULONG APIENTRY NtGdiGetGlyphOutline(_In_ HDC hdc, _In_ WCHAR wch, _In_ UINT iFormat, _Out_ LPGLYPHMETRICS pgm, _In_ ULONG cjBuf, _Out_writes_bytes_opt_(cjBuf) PVOID pvBuf, _In_ const MAT2 *pmat2, _In_ BOOL bIgnoreRotation)
__kernel_entry W32KAPI BOOL APIENTRY NtGdiRemoveFontResourceW(_In_reads_(cwc) PCWCH pwszFiles, _In_ ULONG cwc, _In_ ULONG cFiles, _In_ ULONG fl, _In_ DWORD dwPidTid, _In_opt_ const DESIGNVECTOR *pdv)
Definition: font.c:528
__kernel_entry W32KAPI DWORD APIENTRY NtGdiGetCharacterPlacementW(_In_ HDC hdc, _In_reads_(nCount) PCWCH pwsz, _In_ INT nCount, _In_ INT nMaxExtent, _Inout_opt_ LPGCP_RESULTSW pgcpw, _In_ DWORD dwFlags)
Definition: font.c:650
#define W32KAPI
Definition: ntgdi.h:9
__kernel_entry W32KAPI ULONG APIENTRY NtGdiGetOutlineTextMetricsInternalW(_In_ HDC hdc, _In_ ULONG cjotm, _Out_writes_bytes_opt_(cjotm) POUTLINETEXTMETRICW potmw, _Out_ PTMDIFF ptmd)
_In_ ULONG cjBuffer
Definition: ntgdi.h:2860
__kernel_entry W32KAPI BOOL APIENTRY NtGdiRemoveFontMemResourceEx(_In_ HANDLE hMMFont)
Definition: font.c:638
__kernel_entry W32KAPI HANDLE APIENTRY NtGdiAddFontMemResourceEx(_In_reads_bytes_(cjBuffer) const VOID *pvBuffer, _In_ DWORD cjBuffer, _In_reads_bytes_opt_(cjDV) const DESIGNVECTOR *pdv, _In_ ULONG cjDV, _Out_ PDWORD pNumFonts)
Definition: font.c:582
#define GDI_CFONT_MAX
Definition: ntgdihdl.h:20
#define CFONT_REALIZATION
Definition: ntgdityp.h:430
DWORD LFTYPE
Definition: ntgdityp.h:189
#define TAG_STRING
Definition: oslist.h:22
DWORD * PDWORD
Definition: pedump.c:68
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:181
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:82
#define _SEH2_VOLATILE
Definition: pseh2_64.h:185
#define _SEH2_END
Definition: pseh2_64.h:171
#define _SEH2_TRY
Definition: pseh2_64.h:71
#define _SEH2_YIELD(__stmt)
Definition: pseh2_64.h:184
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
static void Exit(void)
Definition: sock.c:1330
Definition: polytest.cpp:41
base of all file and directory entries
Definition: entries.h:83
HANDLE hlfntNew
Definition: ntgdihdl.h:330
FLONG flTextAlign
Definition: ntgdihdl.h:324
DWORD dvNumAxes
Definition: wingdi.h:2769
FLONG flType
Definition: engobjects.h:142
Definition: gdi.h:2
Definition: text.h:60
LFTYPE lft
Definition: text.h:64
BASEOBJECT BaseObject
Definition: text.h:63
FLONG fl
Definition: text.h:65
ENUMLOGFONTEXDVW logfont
Definition: text.h:70
FONTOBJ * Font
Definition: text.h:66
EX_PUSH_LOCK lock
Definition: text.h:71
Definition: wingdi.h:2472
LONG cx
Definition: kdterminal.h:27
TEXTMETRICW TextMetric
Definition: ntgdityp.h:370
USHORT MaximumLength
Definition: env_spec_w32.h:370
DESIGNVECTOR elfDesignVector
Definition: wingdi.h:2780
ENUMLOGFONTEXW elfEnumLogfontEx
Definition: wingdi.h:2779
WCHAR elfStyle[LF_FACESIZE]
Definition: wingdi.h:2704
LOGFONTW elfLogFont
Definition: wingdi.h:2702
WCHAR elfFullName[LF_FULLFACESIZE]
Definition: wingdi.h:2703
WCHAR elfScript[LF_FACESIZE]
Definition: wingdi.h:2705
DWORD fsCsb[2]
Definition: wingdi.h:1543
INT * lpCaretPos
Definition: wingdi.h:2435
LPWSTR lpClass
Definition: wingdi.h:2436
LPWSTR lpOutString
Definition: wingdi.h:2432
UINT * lpOrder
Definition: wingdi.h:2433
LPWSTR lpGlyphs
Definition: wingdi.h:2437
LONG lfOrientation
Definition: wingdi.h:1900
LONG lfEscapement
Definition: wingdi.h:1899
LONG tmHeight
Definition: wingdi.h:2383
uint32_t * PULONG
Definition: typedefs.h:59
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
int32_t INT
Definition: typedefs.h:58
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define MAKELONG(a, b)
Definition: typedefs.h:249
uint32_t ULONG
Definition: typedefs.h:59
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
#define GdiHandleTable
Definition: win32nt.h:37
VOID FASTCALL SetLastNtError(_In_ NTSTATUS Status)
Definition: error.c:31
PTEXTOBJ FASTCALL RealizeFontInit(_In_ HFONT hFont)
Definition: font.c:431
HFONT FASTCALL GreCreateFontIndirectW(_In_ const LOGFONTW *lplf)
Definition: font.c:28
DWORD FASTCALL GreGetKerningPairs(_In_ HDC hDC, _In_ ULONG NumPairs, _Out_writes_(NumPairs) LPKERNINGPAIR krnpair)
Definition: font.c:53
ULONG FASTCALL FontGetObject(_Inout_ PTEXTOBJ plfont, _In_ ULONG cjBuffer, _Out_ PVOID pvBuffer)
Definition: font.c:296
DWORD FASTCALL IntGetFontLanguageInfo(_In_ PDC Dc)
Definition: font.c:380
HFONT APIENTRY HfontCreate(_In_ const ENUMLOGFONTEXDVW *pelfw, _In_ ULONG cjElfw, _In_ LFTYPE lft, _In_ FLONG fl, _In_opt_ PVOID pvCliData)
BOOL APIENTRY NtGdiGetRealizationInfo(_In_ HDC hdc, _Out_ PREALIZATION_INFO pri, _In_ HFONT hf)
Definition: font.c:1153
DWORD APIENTRY NtGdiGetFontData(_In_ HDC hDC, _In_ DWORD Table, _In_ DWORD Offset, _Out_writes_bytes_(Size) PVOID Buffer, _In_ DWORD Size)
Definition: font.c:672
DWORD FASTCALL IntGetCharDimensions(_In_ HDC hdc, _Out_opt_ PTEXTMETRICW ptm, _Out_opt_ PDWORD height)
Definition: font.c:335
W32KAPI BOOL APIENTRY NtGdiGetFontResourceInfoInternalW(_In_reads_(cwc) PCWCH pwszFiles, _In_ ULONG cwc, _In_ ULONG cFiles, _In_ UINT cjIn, _Inout_ PDWORD pdwBytes, _Out_writes_bytes_(*pdwBytes) PVOID pvBuf, _In_ DWORD dwType)
Definition: font.c:1041
static BOOL IntCheckFontPathNames(_In_reads_(cwc) PCWCH pwcFiles, _In_ ULONG cFiles, _In_ ULONG cwc)
Definition: font.c:451
DWORD APIENTRY NtGdiGetFontUnicodeRanges(_In_ HDC hdc, _Out_opt_ LPGLYPHSET pgs)
Definition: font.c:732
BOOL FASTCALL GreGetTextExtentW(_In_ HDC hDC, _In_reads_(cwc) PCWCH lpwsz, _In_ INT cwc, _Out_ PSIZE psize, _In_ UINT flOpts)
Definition: text.c:77
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: text.c:133
#define TAG_FINF
Definition: text.h:3
#define LFONT_UnlockFont(plfnt)
Definition: text.h:79
FORCEINLINE PTEXTOBJ TEXTOBJ_LockText(HFONT hfont)
Definition: text.h:83
#define TEXTOBJECT_INIT
Definition: text.h:56
FORCEINLINE VOID TEXTOBJ_UnlockText(PLFONT plfnt)
Definition: text.h:96
#define LFONT_AllocFontWithHandle()
Definition: text.h:76
#define TAG_FONT
Definition: tags.h:12
#define GDITAG_TEXT
Definition: tags.h:172
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_In_ FLONG fl
Definition: winddi.h:1279
_In_ DWORD cjBuf
Definition: winddi.h:3827
#define FO_TYPE_TRUETYPE
Definition: winddi.h:737
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:22
_In_ ULONG_PTR _In_opt_ DESIGNVECTOR * pdv
Definition: winddi.h:3723
_In_ SIZEL _In_ ULONG iFormat
Definition: winddi.h:3468
_In_ ULONG _In_ CLIPOBJ _In_ RECTL _In_ ULONG cjIn
Definition: winddi.h:3532
#define GCP_GLYPHSHAPE
Definition: wingdi.h:833
#define GCP_DIACRITIC
Definition: wingdi.h:831
#define GCP_LIGATE
Definition: wingdi.h:837
#define GCPCLASS_LATIN
Definition: wingdi.h:670
#define GCP_MAXEXTENT
Definition: wingdi.h:838
#define GCP_USEKERNING
Definition: wingdi.h:845
#define GCP_KASHIDA
Definition: wingdi.h:836
#define FLI_GLYPHS
Definition: wingdi.h:846
#define TA_RTLREADING
Definition: wingdi.h:934
#define GDI_ERROR
Definition: wingdi.h:1309
#define GCP_REORDER
Definition: wingdi.h:843
#define GCP_DBCS
Definition: wingdi.h:828
#define GCP_JUSTIFY
Definition: wingdi.h:834
_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
#define ExAllocatePoolWithQuotaTag(a, b, c)
Definition: exfuncs.h:530
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned char BYTE
Definition: xxhash.c:193