ReactOS 0.4.16-dev-340-g0540c21
font.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS win32 kernel mode subsystem
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: win32ss/gdi/ntgdi/font.c
5 * PURPOSE: Font
6 * PROGRAMMERS: James Tabor <james.tabor@reactos.org>
7 * Timo Kreuzer <timo.kreuzer@reactos.org>
8 * Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
9 */
10
13#include <win32k.h>
14
15#define NDEBUG
16#include <debug.h>
17
19
24{
25 if (lplf)
26 {
27 ENUMLOGFONTEXDVW Logfont;
28
29 RtlCopyMemory( &Logfont.elfEnumLogfontEx.elfLogFont, lplf, sizeof(LOGFONTW));
31 sizeof(Logfont.elfEnumLogfontEx.elfFullName));
33 sizeof(Logfont.elfEnumLogfontEx.elfStyle));
35 sizeof(Logfont.elfEnumLogfontEx.elfScript));
36
37 Logfont.elfDesignVector.dvNumAxes = 0;
38
39 RtlZeroMemory( &Logfont.elfDesignVector, sizeof(DESIGNVECTOR));
40
41 return HfontCreate((PENUMLOGFONTEXDVW)&Logfont, 0, 0, 0, NULL );
42 }
43 else return NULL;
44}
45
49 HDC hDC,
50 ULONG NumPairs,
51 LPKERNINGPAIR krnpair)
52{
53 PDC dc;
54 PDC_ATTR pdcattr;
55 PTEXTOBJ TextObj;
56 PFONTGDI FontGDI;
58 KERNINGPAIR *pKP;
59
60 dc = DC_LockDc(hDC);
61 if (!dc)
62 {
64 return 0;
65 }
66
67 pdcattr = dc->pdcattr;
68 TextObj = RealizeFontInit(pdcattr->hlfntNew);
70
71 if (!TextObj)
72 {
74 return 0;
75 }
76
77 FontGDI = ObjToGDI(TextObj->Font, FONT);
78 TEXTOBJ_UnlockText(TextObj);
79
80 Count = ftGdiGetKerningPairs(FontGDI,0,NULL);
81
82 if ( Count && krnpair )
83 {
84 if (Count > NumPairs)
85 {
87 return 0;
88 }
90 if (!pKP)
91 {
93 return 0;
94 }
95 ftGdiGetKerningPairs(FontGDI,Count,pKP);
96
97 RtlCopyMemory(krnpair, pKP, Count * sizeof(KERNINGPAIR));
98
100 }
101 return Count;
102}
103
104/*
105
106 It is recommended that an application use the GetFontLanguageInfo function
107 to determine whether the GCP_DIACRITIC, GCP_DBCS, GCP_USEKERNING, GCP_LIGATE,
108 GCP_REORDER, GCP_GLYPHSHAPE, and GCP_KASHIDA values are valid for the
109 currently selected font. If not valid, GetCharacterPlacement ignores the
110 value.
111
112 MS must use a preset "compiled in" support for each language based releases.
113 ReactOS uses FreeType, this will need to be supported. ATM this is hard coded
114 for GCPCLASS_LATIN!
115
116 */
117#if 0
118DWORD
120GreGetCharacterPlacementW(
121 HDC hdc,
122 LPCWSTR pwsz,
123 INT nCount,
124 INT nMaxExtent,
125 LPGCP_RESULTSW pgcpw,
127{
128 GCP_RESULTSW gcpwSave;
129 UINT i, nSet, cSet;
130 INT *tmpDxCaretPos;
131 LONG Cx;
132 SIZE Size = {0,0};
133
134 DPRINT1("GreGCPW Start\n");
135
136 if (!pgcpw)
137 {
138 if (GreGetTextExtentW( hdc, pwsz, nCount, &Size, 1))
139 return MAKELONG(Size.cx, Size.cy);
140 return 0;
141 }
142
143 DPRINT1("GreGCPW 1\n");
144
145 RtlCopyMemory(&gcpwSave, pgcpw, sizeof(GCP_RESULTSW));
146
147 cSet = nSet = nCount;
148
149 if ( nCount > gcpwSave.nGlyphs ) cSet = gcpwSave.nGlyphs;
150
151 /* GCP_JUSTIFY may only be used in conjunction with GCP_MAXEXTENT. */
153
154 if ( !gcpwSave.lpDx && gcpwSave.lpCaretPos )
155 tmpDxCaretPos = gcpwSave.lpCaretPos;
156 else
157 tmpDxCaretPos = gcpwSave.lpDx;
158
160 pwsz,
161 cSet,
162 nMaxExtent,
163 ((dwFlags & GCP_MAXEXTENT) ? (PULONG) &cSet : NULL),
164 (PULONG) tmpDxCaretPos,
165 &Size,
166 0) )
167 {
168 return 0;
169 }
170
171 DPRINT1("GreGCPW 2\n");
172
173 nSet = cSet;
174
175 if ( tmpDxCaretPos && nSet > 0)
176 {
177 for (i = (nSet - 1); i > 0; i--)
178 {
179 tmpDxCaretPos[i] -= tmpDxCaretPos[i - 1];
180 }
181 }
182
183 if ( !(dwFlags & GCP_MAXEXTENT) || nSet )
184 {
185 if ( (dwFlags & GCP_USEKERNING) &&
186 ( gcpwSave.lpDx ||
187 gcpwSave.lpCaretPos ) &&
188 nSet >= 2 )
189 {
190 DWORD Count;
191 LPKERNINGPAIR pKP;
192
194 if (Count)
195 {
197 if (pKP)
198 {
199 if ( GreGetKerningPairs( hdc, Count, pKP) != Count)
200 {
202 return 0;
203 }
204
205 if ( (ULONG_PTR)(pKP) < ((ULONG_PTR)(pKP) + (ULONG_PTR)(Count * sizeof(KERNINGPAIR))) )
206 {
207 DPRINT1("We Need to Do Something HERE!\n");
208 }
209
211
212 if ( dwFlags & GCP_MAXEXTENT )
213 {
214 if ( Size.cx > nMaxExtent )
215 {
216 for (Cx = Size.cx; nSet > 0; nSet--)
217 {
218 Cx -= tmpDxCaretPos[nSet - 1];
219 Size.cx = Cx;
220 if ( Cx <= nMaxExtent ) break;
221 }
222 }
223 if ( !nSet )
224 {
225 pgcpw->nGlyphs = 0;
226 pgcpw->nMaxFit = 0;
227 return 0;
228 }
229 }
230 }
231 }
232 }
233
234 if ( (dwFlags & GCP_JUSTIFY) &&
235 ( gcpwSave.lpDx ||
236 gcpwSave.lpCaretPos ) &&
237 nSet )
238 {
239 DPRINT1("We Need to Do Something HERE 2!\n");
240 }
241
242 if ( gcpwSave.lpDx && gcpwSave.lpCaretPos )
243 RtlCopyMemory( gcpwSave.lpCaretPos, gcpwSave.lpDx, nSet * sizeof(LONG));
244
245 if ( gcpwSave.lpCaretPos )
246 {
247 int pos = 0;
248 i = 0;
249 if ( nSet > 0 )
250 {
251 do
252 {
253 Cx = gcpwSave.lpCaretPos[i];
254 gcpwSave.lpCaretPos[i] = pos;
255 pos += Cx;
256 ++i;
257 }
258 while ( i < nSet );
259 }
260 }
261
262 if ( gcpwSave.lpOutString )
263 RtlCopyMemory(gcpwSave.lpOutString, pwsz, nSet * sizeof(WCHAR));
264
265 if ( gcpwSave.lpClass )
266 RtlFillMemory(gcpwSave.lpClass, nSet, GCPCLASS_LATIN);
267
268 if ( gcpwSave.lpOrder )
269 {
270 for (i = 0; i < nSet; i++)
271 gcpwSave.lpOrder[i] = i;
272 }
273
274 if ( gcpwSave.lpGlyphs )
275 {
276 if ( GreGetGlyphIndicesW( hdc, pwsz, nSet, gcpwSave.lpGlyphs, 0, 0) == GDI_ERROR )
277 {
278 nSet = 0;
279 Size.cx = 0;
280 Size.cy = 0;
281 }
282 }
283 pgcpw->nGlyphs = nSet;
284 pgcpw->nMaxFit = nSet;
285 }
286 DPRINT1("GreGCPW Exit\n");
287 return MAKELONG(Size.cx, Size.cy);
288}
289#endif
290
291ULONG
294{
295 ULONG cjMaxSize;
296 ENUMLOGFONTEXDVW *plf;
297
298 ASSERT(plfont);
299 plf = &plfont->logfont;
300
301 if (!(plfont->fl & TEXTOBJECT_INIT))
302 {
304 DPRINT("FontGetObject font not initialized!\n");
305
306 Status = TextIntRealizeFont(plfont->BaseObject.hHmgr, plfont);
307 if (!NT_SUCCESS(Status))
308 {
309 DPRINT1("FontGetObject(TextIntRealizeFont) Status = 0x%lx\n", Status);
310 }
311 }
312
313 /* If buffer is NULL, only the size is requested */
314 if (pvBuffer == NULL) return sizeof(LOGFONTW);
315
316 /* Calculate the maximum size according to number of axes */
317 cjMaxSize = FIELD_OFFSET(ENUMLOGFONTEXDVW,
318 elfDesignVector.dvValues[plf->elfDesignVector.dvNumAxes]);
319
320 if (cjBuffer > cjMaxSize) cjBuffer = cjMaxSize;
321
322 RtlCopyMemory(pvBuffer, plf, cjBuffer);
323
324 return cjBuffer;
325}
326
327DWORD
330{
331 PDC pdc;
332 PDC_ATTR pdcattr;
333 PTEXTOBJ TextObj;
334 SIZE sz;
335 TMW_INTERNAL tmwi;
336 BOOL Good;
337
338 static const WCHAR alphabet[] = {
339 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q',
340 'r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H',
341 'I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',0};
342
343 if(!ftGdiGetTextMetricsW(hdc, &tmwi)) return 0;
344
345 pdc = DC_LockDc(hdc);
346
347 if (!pdc) return 0;
348
349 pdcattr = pdc->pdcattr;
350
351 TextObj = RealizeFontInit(pdcattr->hlfntNew);
352 if ( !TextObj )
353 {
354 DC_UnlockDc(pdc);
355 return 0;
356 }
357 Good = TextIntGetTextExtentPoint(pdc, TextObj, alphabet, 52, 0, NULL, 0, &sz, 0);
358 TEXTOBJ_UnlockText(TextObj);
359 DC_UnlockDc(pdc);
360
361 if (!Good) return 0;
362 if (ptm) *ptm = tmwi.TextMetric;
363 if (height) *height = tmwi.TextMetric.tmHeight;
364
365 return (sz.cx / 26 + 1) / 2;
366}
367
368
369DWORD
372{
373 PDC_ATTR pdcattr;
374 FONTSIGNATURE fontsig;
375 static const DWORD GCP_DBCS_MASK=0x003F0000,
376 GCP_DIACRITIC_MASK=0x00000000,
377 FLI_GLYPHS_MASK=0x00000000,
378 GCP_GLYPHSHAPE_MASK=0x00000040,
379 GCP_KASHIDA_MASK=0x00000000,
380 GCP_LIGATE_MASK=0x00000000,
381 GCP_USEKERNING_MASK=0x00000000,
382 GCP_REORDER_MASK=0x00000060;
383
384 DWORD result=0;
385
386 ftGdiGetTextCharsetInfo( Dc, &fontsig, 0 );
387
388 /* We detect each flag we return using a bitmask on the Codepage Bitfields */
389 if( (fontsig.fsCsb[0]&GCP_DBCS_MASK)!=0 )
391
392 if( (fontsig.fsCsb[0]&GCP_DIACRITIC_MASK)!=0 )
394
395 if( (fontsig.fsCsb[0]&FLI_GLYPHS_MASK)!=0 )
397
398 if( (fontsig.fsCsb[0]&GCP_GLYPHSHAPE_MASK)!=0 )
400
401 if( (fontsig.fsCsb[0]&GCP_KASHIDA_MASK)!=0 )
403
404 if( (fontsig.fsCsb[0]&GCP_LIGATE_MASK)!=0 )
406
407 if( (fontsig.fsCsb[0]&GCP_USEKERNING_MASK)!=0 )
409
410 pdcattr = Dc->pdcattr;
411
412 /* This might need a test for a HEBREW- or ARABIC_CHARSET as well */
413 if ( pdcattr->flTextAlign & TA_RTLREADING )
414 if( (fontsig.fsCsb[0]&GCP_REORDER_MASK)!=0 )
416
417 return result;
418}
419
423{
425 PTEXTOBJ pTextObj;
426
427 pTextObj = TEXTOBJ_LockText(hFont);
428
429 if ( pTextObj && !(pTextObj->fl & TEXTOBJECT_INIT))
430 {
431 Status = TextIntRealizeFont(hFont, pTextObj);
432 if (!NT_SUCCESS(Status))
433 {
434 TEXTOBJ_UnlockText(pTextObj);
435 return NULL;
436 }
437 }
438 return pTextObj;
439}
440
441
444INT
447 IN WCHAR *pwcFiles,
448 IN ULONG cwc,
449 IN ULONG cFiles,
450 IN FLONG fl,
451 IN DWORD dwPidTid,
453{
454 UNICODE_STRING SafeFileName;
455 INT Ret;
456
460
461 DPRINT("NtGdiAddFontResourceW\n");
462
463 /* cwc = Length + trailing zero. */
464 if ((cwc <= 1) || (cwc > UNICODE_STRING_MAX_CHARS))
465 return 0;
466
467 SafeFileName.MaximumLength = (USHORT)(cwc * sizeof(WCHAR));
468 SafeFileName.Length = SafeFileName.MaximumLength - sizeof(UNICODE_NULL);
470 SafeFileName.MaximumLength,
471 TAG_STRING);
472 if (!SafeFileName.Buffer)
473 {
474 return 0;
475 }
476
478 {
479 ProbeForRead(pwcFiles, cwc * sizeof(WCHAR), sizeof(WCHAR));
480 RtlCopyMemory(SafeFileName.Buffer, pwcFiles, SafeFileName.Length);
481 }
483 {
484 ExFreePoolWithTag(SafeFileName.Buffer, TAG_STRING);
485 _SEH2_YIELD(return 0);
486 }
487 _SEH2_END;
488
489 SafeFileName.Buffer[SafeFileName.Length / sizeof(WCHAR)] = UNICODE_NULL;
490 Ret = IntGdiAddFontResource(&SafeFileName, fl);
491
492 ExFreePoolWithTag(SafeFileName.Buffer, TAG_STRING);
493 return Ret;
494}
495
496HANDLE
499 IN PVOID pvBuffer,
502 IN ULONG cjDV,
503 OUT DWORD *pNumFonts)
504{
506 HANDLE Ret;
507 DWORD NumFonts = 0;
508
509 DPRINT("NtGdiAddFontMemResourceEx\n");
512
513 if (!pvBuffer || !cjBuffer)
514 return NULL;
515
517 {
518 ProbeForRead(pvBuffer, cjBuffer, sizeof(BYTE));
520 RtlCopyMemory(Buffer, pvBuffer, cjBuffer);
521 }
523 {
524 if (Buffer != NULL)
525 {
527 }
528 _SEH2_YIELD(return NULL);
529 }
530 _SEH2_END;
531
532 Ret = IntGdiAddFontMemResource(Buffer, cjBuffer, &NumFonts);
534
536 {
537 ProbeForWrite(pNumFonts, sizeof(NumFonts), 1);
538 *pNumFonts = NumFonts;
539 }
541 {
542 /* Leak it? */
543 _SEH2_YIELD(return NULL);
544 }
545 _SEH2_END;
546
547
548 return Ret;
549}
550
551
552BOOL
555 IN HANDLE hMMFont)
556{
557 return IntGdiRemoveFontMemResource(hMMFont);
558}
559
560
561 /*
562 * @unimplemented
563 */
564DWORD
567 IN HDC hdc,
568 IN LPWSTR pwsz,
569 IN INT nCount,
570 IN INT nMaxExtent,
571 IN OUT LPGCP_RESULTSW pgcpw,
573{
575 return 0;
576#if 0
577 return GreGetCharacterPlacementW( hdc,
578 pwsz,
579 nCount,
580 nMaxExtent,
581 pgcpw,
582 dwFlags);
583#endif
584}
585
586DWORD
589 HDC hDC,
590 DWORD Table,
593 DWORD Size)
594{
595 PDC Dc;
596 PDC_ATTR pdcattr;
597 HFONT hFont;
598 PTEXTOBJ TextObj;
599 PFONTGDI FontGdi;
602
603 if (Buffer && Size)
604 {
606 {
608 }
610 {
612 }
614 }
615
616 if (!NT_SUCCESS(Status)) return Result;
617
618 Dc = DC_LockDc(hDC);
619 if (Dc == NULL)
620 {
622 return GDI_ERROR;
623 }
624 pdcattr = Dc->pdcattr;
625
626 hFont = pdcattr->hlfntNew;
627 TextObj = RealizeFontInit(hFont);
628 DC_UnlockDc(Dc);
629
630 if (TextObj == NULL)
631 {
633 return GDI_ERROR;
634 }
635
636 FontGdi = ObjToGDI(TextObj->Font, FONT);
637
639
640 TEXTOBJ_UnlockText(TextObj);
641
642 return Result;
643}
644
645 /*
646 * @implemented
647 */
648DWORD
651 IN HDC hdc,
652 OUT OPTIONAL LPGLYPHSET pgs)
653{
654 PDC pDc;
655 PDC_ATTR pdcattr;
656 HFONT hFont;
657 PTEXTOBJ TextObj;
658 PFONTGDI FontGdi;
659 DWORD Size = 0;
660 PGLYPHSET pgsSafe;
662
663 pDc = DC_LockDc(hdc);
664 if (!pDc)
665 {
667 return 0;
668 }
669
670 pdcattr = pDc->pdcattr;
671
672 hFont = pdcattr->hlfntNew;
673 TextObj = RealizeFontInit(hFont);
674
675 if ( TextObj == NULL)
676 {
678 goto Exit;
679 }
680 FontGdi = ObjToGDI(TextObj->Font, FONT);
681
682 Size = ftGetFontUnicodeRanges( FontGdi, NULL);
683
684 if (Size && pgs)
685 {
687 if (!pgsSafe)
688 {
690 Size = 0;
691 goto Exit;
692 }
693
694 Size = ftGetFontUnicodeRanges( FontGdi, pgsSafe);
695
696 if (Size)
697 {
699 {
700 ProbeForWrite(pgs, Size, 1);
701 RtlCopyMemory(pgs, pgsSafe, Size);
702 }
704 {
706 }
708
709 if (!NT_SUCCESS(Status)) Size = 0;
710 }
712 }
713Exit:
714 TEXTOBJ_UnlockText(TextObj);
715 DC_UnlockDc(pDc);
716 return Size;
717}
718
719ULONG
722 IN HDC hdc,
723 IN WCHAR wch,
726 IN ULONG cjBuf,
727 OUT OPTIONAL PVOID UnsafeBuf,
728 IN LPMAT2 pmat2,
729 IN BOOL bIgnoreRotation)
730{
731 ULONG Ret = GDI_ERROR;
732 PDC dc;
733 PVOID pvBuf = NULL;
734 GLYPHMETRICS gm;
736
737 dc = DC_LockDc(hdc);
738 if (!dc)
739 {
741 return GDI_ERROR;
742 }
743
744 if (UnsafeBuf && cjBuf)
745 {
747 if (!pvBuf)
748 {
750 goto Exit;
751 }
752 }
753
755 wch,
756 iFormat,
757 pgm ? &gm : NULL,
758 cjBuf,
759 pvBuf,
760 pmat2,
761 bIgnoreRotation);
762
763 if (pvBuf)
764 {
766 {
767 ProbeForWrite(UnsafeBuf, cjBuf, 1);
768 RtlCopyMemory(UnsafeBuf, pvBuf, cjBuf);
769 }
771 {
773 }
775
777 }
778
779 if (pgm)
780 {
782 {
783 ProbeForWrite(pgm, sizeof(GLYPHMETRICS), 1);
784 RtlCopyMemory(pgm, &gm, sizeof(GLYPHMETRICS));
785 }
787 {
789 }
791 }
792
793 if (! NT_SUCCESS(Status))
794 {
796 Ret = GDI_ERROR;
797 }
798
799Exit:
801 return Ret;
802}
803
804DWORD
807 ULONG NumPairs,
808 LPKERNINGPAIR krnpair)
809{
810 PDC dc;
811 PDC_ATTR pdcattr;
812 PTEXTOBJ TextObj;
813 PFONTGDI FontGDI;
814 DWORD Count;
815 KERNINGPAIR *pKP;
817
818 dc = DC_LockDc(hDC);
819 if (!dc)
820 {
822 return 0;
823 }
824
825 pdcattr = dc->pdcattr;
826 TextObj = RealizeFontInit(pdcattr->hlfntNew);
828
829 if (!TextObj)
830 {
832 return 0;
833 }
834
835 FontGDI = ObjToGDI(TextObj->Font, FONT);
836 TEXTOBJ_UnlockText(TextObj);
837
838 Count = ftGdiGetKerningPairs(FontGDI,0,NULL);
839
840 if ( Count && krnpair )
841 {
842 if (Count > NumPairs)
843 {
845 return 0;
846 }
848 if (!pKP)
849 {
851 return 0;
852 }
853 ftGdiGetKerningPairs(FontGDI,Count,pKP);
855 {
856 ProbeForWrite(krnpair, Count * sizeof(KERNINGPAIR), 1);
857 RtlCopyMemory(krnpair, pKP, Count * sizeof(KERNINGPAIR));
858 }
860 {
862 }
864 if (!NT_SUCCESS(Status))
865 {
867 Count = 0;
868 }
870 }
871 return Count;
872}
873
874/*
875 From "Undocumented Windows 2000 Secrets" Appendix B, Table B-2, page
876 472, this is NtGdiGetOutlineTextMetricsInternalW.
877 */
878ULONG
881 ULONG Data,
883 TMDIFF *Tmd)
884{
885 PDC dc;
886 PDC_ATTR pdcattr;
887 PTEXTOBJ TextObj;
888 PFONTGDI FontGDI;
889 HFONT hFont = 0;
890 ULONG Size;
891 OUTLINETEXTMETRICW *potm;
893
894 dc = DC_LockDc(hDC);
895 if (!dc)
896 {
898 return 0;
899 }
900 pdcattr = dc->pdcattr;
901 hFont = pdcattr->hlfntNew;
902 TextObj = RealizeFontInit(hFont);
904 if (!TextObj)
905 {
907 return 0;
908 }
909 FontGDI = ObjToGDI(TextObj->Font, FONT);
910 if (!(FontGDI->flType & FO_TYPE_TRUETYPE))
911 {
912 TEXTOBJ_UnlockText(TextObj);
913 return 0;
914 }
915 TextIntUpdateSize(dc, TextObj, FontGDI, TRUE);
916 TEXTOBJ_UnlockText(TextObj);
917 Size = IntGetOutlineTextMetrics(FontGDI, 0, NULL, FALSE);
918 if (!otm) return Size;
919 if (Size > Data)
920 {
922 return 0;
923 }
925 if (!potm)
926 {
928 return 0;
929 }
930 RtlZeroMemory(potm, Size);
931 IntGetOutlineTextMetrics(FontGDI, Size, potm, FALSE);
932
934 {
935 ProbeForWrite(otm, Size, 1);
936 RtlCopyMemory(otm, potm, Size);
937 }
939 {
941 }
943
944 if (!NT_SUCCESS(Status))
945 {
947 Size = 0;
948 }
949
951 return Size;
952}
953
955BOOL
958 IN LPWSTR pwszFiles,
959 IN ULONG cwc,
960 IN ULONG cFiles,
961 IN UINT cjIn,
963 OUT LPVOID pvBuf,
964 IN DWORD dwType)
965{
967 DWORD dwBytes, dwBytesRequested;
968 UNICODE_STRING SafeFileNames;
969 BOOL bRet = FALSE;
970 ULONG cbStringSize;
972
973 /* FIXME: Handle cFiles > 0 */
974
975 /* Check for valid dwType values */
976 if (dwType > 5)
977 {
979 return FALSE;
980 }
981
982 /* Allocate a safe unicode string buffer */
983 cbStringSize = cwc * sizeof(WCHAR);
984 SafeFileNames.MaximumLength = SafeFileNames.Length = (USHORT)cbStringSize - sizeof(WCHAR);
985 SafeFileNames.Buffer = ExAllocatePoolWithTag(PagedPool,
986 cbStringSize,
987 TAG_USTR);
988 if (!SafeFileNames.Buffer)
989 {
991 return FALSE;
992 }
993 RtlZeroMemory(SafeFileNames.Buffer, SafeFileNames.MaximumLength);
994
995 /* Check buffers and copy pwszFiles to safe unicode string */
997 {
998 ProbeForRead(pwszFiles, cbStringSize, 1);
999 ProbeForWrite(pdwBytes, sizeof(DWORD), 1);
1000 if (pvBuf)
1001 ProbeForWrite(pvBuf, cjIn, 1);
1002
1003 dwBytes = *pdwBytes;
1004 dwBytesRequested = dwBytes;
1005
1006 RtlCopyMemory(SafeFileNames.Buffer, pwszFiles, cbStringSize);
1007 if (dwBytes > 0)
1008 {
1010 }
1011 else
1012 {
1014 }
1015 }
1017 {
1019 }
1020 _SEH2_END
1021
1022 if(!NT_SUCCESS(Status))
1023 {
1025 /* Free the string buffer for the safe filename */
1026 ExFreePoolWithTag(SafeFileNames.Buffer, TAG_USTR);
1027 return FALSE;
1028 }
1029
1030 /* Do the actual call */
1031 bRet = IntGdiGetFontResourceInfo(&SafeFileNames,
1032 (pvBuf ? Buffer : NULL),
1033 &dwBytes, dwType);
1034
1035 /* Check if succeeded */
1036 if (bRet)
1037 {
1038 /* Copy the data back to caller */
1039 _SEH2_TRY
1040 {
1041 /* Buffers are already probed */
1042 if (pvBuf && dwBytesRequested > 0)
1043 RtlCopyMemory(pvBuf, Buffer, min(dwBytesRequested, dwBytes));
1044 *pdwBytes = dwBytes;
1045 }
1047 {
1049 }
1050 _SEH2_END
1051
1052 if(!NT_SUCCESS(Status))
1053 {
1055 bRet = FALSE;
1056 }
1057 }
1058
1060 /* Free the string for the safe filenames */
1061 ExFreePoolWithTag(SafeFileNames.Buffer, TAG_USTR);
1062
1063 return bRet;
1064}
1065
1066 /*
1067 * @unimplemented
1068 */
1069BOOL
1072 IN HDC hdc,
1074 IN HFONT hf)
1075{
1076 PDC pDc;
1077 PTEXTOBJ pTextObj;
1078 PFONTGDI pFontGdi;
1079 PDC_ATTR pdcattr;
1080 BOOL Ret = FALSE;
1081 INT i = 0;
1083
1084 pDc = DC_LockDc(hdc);
1085 if (!pDc)
1086 {
1088 return 0;
1089 }
1090 pdcattr = pDc->pdcattr;
1091 pTextObj = RealizeFontInit(pdcattr->hlfntNew);
1092 ASSERT(pTextObj != NULL);
1093 pFontGdi = ObjToGDI(pTextObj->Font, FONT);
1094 TEXTOBJ_UnlockText(pTextObj);
1095 DC_UnlockDc(pDc);
1096
1097 Ret = ftGdiRealizationInfo(pFontGdi, &ri);
1098 if (Ret)
1099 {
1100 if (pri)
1101 {
1103 _SEH2_TRY
1104 {
1105 ProbeForWrite(pri, sizeof(REALIZATION_INFO), 1);
1106 RtlCopyMemory(pri, &ri, sizeof(REALIZATION_INFO));
1107 }
1109 {
1111 }
1112 _SEH2_END
1113
1114 if(!NT_SUCCESS(Status))
1115 {
1117 return FALSE;
1118 }
1119 }
1120 do
1121 {
1122 if (GdiHandleTable->cfPublic[i].hf == hf)
1123 {
1124 GdiHandleTable->cfPublic[i].iTechnology = ri.iTechnology;
1125 GdiHandleTable->cfPublic[i].iUniq = ri.iUniq;
1126 GdiHandleTable->cfPublic[i].dwUnknown = ri.dwUnknown;
1127 GdiHandleTable->cfPublic[i].dwCFCount = GdiHandleTable->dwCFCount;
1128 GdiHandleTable->cfPublic[i].fl |= CFONT_REALIZATION;
1129 }
1130 i++;
1131 }
1132 while ( i < GDI_CFONT_MAX );
1133 }
1134 return Ret;
1135}
1136
1137
1138HFONT
1141 IN PENUMLOGFONTEXDVW pelfw,
1142 IN ULONG cjElfw,
1143 IN LFTYPE lft,
1144 IN FLONG fl,
1145 IN PVOID pvCliData )
1146{
1147 HFONT hNewFont;
1148 PLFONT plfont;
1149
1150 if (!pelfw)
1151 {
1152 return NULL;
1153 }
1154
1155 plfont = LFONT_AllocFontWithHandle();
1156 if (!plfont)
1157 {
1158 return NULL;
1159 }
1160 hNewFont = plfont->BaseObject.hHmgr;
1161
1162 plfont->lft = lft;
1163 plfont->fl = fl;
1164 RtlCopyMemory (&plfont->logfont, pelfw, sizeof(ENUMLOGFONTEXDVW));
1165 ExInitializePushLock(&plfont->lock);
1166
1167 if (pelfw->elfEnumLogfontEx.elfLogFont.lfEscapement !=
1168 pelfw->elfEnumLogfontEx.elfLogFont.lfOrientation)
1169 {
1170 /* This should really depend on whether GM_ADVANCED is set */
1173 }
1174 LFONT_UnlockFont(plfont);
1175
1176 if (pvCliData && hNewFont)
1177 {
1178 // FIXME: Use GDIOBJ_InsertUserData
1180 {
1183 Entry->UserData = pvCliData;
1184 }
1186 }
1187
1188 return hNewFont;
1189}
1190
1191
1192HFONT
1195 IN PENUMLOGFONTEXDVW pelfw,
1196 IN ULONG cjElfw,
1197 IN LFTYPE lft,
1198 IN FLONG fl,
1199 IN PVOID pvCliData )
1200{
1201 ENUMLOGFONTEXDVW SafeLogfont;
1203
1204 /* Silence GCC warnings */
1207
1208 if (!pelfw)
1209 {
1210 return NULL;
1211 }
1212
1213 _SEH2_TRY
1214 {
1215 ProbeForRead(pelfw, sizeof(ENUMLOGFONTEXDVW), 1);
1216 RtlCopyMemory(&SafeLogfont, pelfw, sizeof(ENUMLOGFONTEXDVW));
1217 }
1219 {
1221 }
1222 _SEH2_END
1223
1224 if (!NT_SUCCESS(Status))
1225 {
1226 return NULL;
1227 }
1228
1229 return HfontCreate(&SafeLogfont, cjElfw, lft, fl, pvCliData);
1230}
1231
1232
1233/* EOF */
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
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:1013
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:4227
DWORD FASTCALL ftGdiGetKerningPairs(PFONTGDI Font, DWORD cPairs, LPKERNINGPAIR pKerningPair)
Definition: freetype.c:6382
BOOL FASTCALL ftGdiGetTextMetricsW(HDC hDC, PTMW_INTERNAL ptmwi)
Definition: freetype.c:5267
BOOL FASTCALL TextIntGetTextExtentPoint(PDC dc, PTEXTOBJ TextObj, LPCWSTR String, INT Count, ULONG MaxExtent, LPINT Fit, LPINT Dx, LPSIZE Size, FLONG fl)
Definition: freetype.c:4958
BOOL FASTCALL IntGdiGetFontResourceInfo(PUNICODE_STRING FileName, PVOID pBuffer, DWORD *pdwBytes, DWORD dwType)
Definition: freetype.c:6095
ULONG FASTCALL ftGdiGetGlyphOutline(PDC dc, WCHAR wch, UINT iFormat, LPGLYPHMETRICS pgm, ULONG cjBuf, PVOID pvBuf, LPMAT2 pmat2, BOOL bIgnoreRotation)
Definition: freetype.c:4436
DWORD FASTCALL ftGetFontUnicodeRanges(PFONTGDI Font, PGLYPHSET glyphset)
Definition: freetype.c:5193
BOOL FASTCALL ftGdiRealizationInfo(PFONTGDI Font, PREALIZATION_INFO Info)
Definition: freetype.c:6363
BOOL FASTCALL IntGdiRemoveFontMemResource(HANDLE hMMFont)
Definition: freetype.c:2548
NTSTATUS FASTCALL TextIntRealizeFont(HFONT FontHandle, PTEXTOBJ pTextObj)
Definition: freetype.c:5906
HANDLE FASTCALL IntGdiAddFontMemResource(PVOID Buffer, DWORD dwSize, PDWORD pNumAdded)
Definition: freetype.c:2458
INT FASTCALL IntGdiAddFontResource(PUNICODE_STRING FileName, DWORD Characteristics)
Definition: freetype.c:2290
INT FASTCALL ftGdiGetTextCharsetInfo(PDC Dc, LPFONTSIGNATURE lpSig, DWORD dwFlags)
Definition: freetype.c:5080
DWORD FASTCALL ftGdiGetFontData(PFONTGDI FontGdi, DWORD Table, DWORD Offset, PVOID Buffer, DWORD Size)
Definition: freetype.c:5364
INT FASTCALL IntGetOutlineTextMetrics(PFONTGDI FontGDI, UINT Size, OUTLINETEXTMETRICW *Otm, BOOL bLocked)
Definition: freetype.c:3075
#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
static const WCHAR dc[]
#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
int Count
Definition: noreturn.cpp:7
#define FASTCALL
Definition: nt_native.h:50
unsigned long FLONG
Definition: ntbasedef.h:374
#define UNICODE_NULL
#define UNICODE_STRING_MAX_CHARS
#define DBG_UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:326
_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 HANDLE APIENTRY NtGdiAddFontMemResourceEx(_In_reads_bytes_(cjBuffer) PVOID pvBuffer, _In_ DWORD cjBuffer, _In_reads_bytes_opt_(cjDV) DESIGNVECTOR *pdv, _In_ ULONG cjDV, _Out_ DWORD *pNumFonts)
__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_ LPMAT2 pmat2, _In_ BOOL bIgnoreRotation)
__kernel_entry W32KAPI ULONG APIENTRY NtGdiGetOutlineTextMetricsInternalW(_In_ HDC hdc, _In_ ULONG cjotm, _Out_writes_bytes_opt_(cjotm) OUTLINETEXTMETRICW *potmw, _Out_ TMDIFF *ptmd)
__kernel_entry W32KAPI HFONT APIENTRY NtGdiHfontCreate(_In_reads_bytes_(cjElfw) ENUMLOGFONTEXDVW *pelfw, _In_ ULONG cjElfw, _In_ LFTYPE lft, _In_ FLONG fl, _In_ PVOID pvCliData)
#define W32KAPI
Definition: ntgdi.h:9
_In_ ULONG cjBuffer
Definition: ntgdi.h:2860
__kernel_entry W32KAPI BOOL APIENTRY NtGdiRemoveFontMemResourceEx(_In_ HANDLE hMMFont)
__kernel_entry W32KAPI DWORD APIENTRY NtGdiGetCharacterPlacementW(_In_ HDC hdc, _In_reads_z_(nCount) LPWSTR pwsz, _In_ INT nCount, _In_ INT nMaxExtent, _Inout_ LPGCP_RESULTSW pgcpw, _In_ DWORD dwFlags)
#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:165
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:66
#define _SEH2_VOLATILE
Definition: pseh2_64.h:169
#define _SEH2_END
Definition: pseh2_64.h:155
#define _SEH2_TRY
Definition: pseh2_64.h:55
#define _SEH2_YIELD(__stmt)
Definition: pseh2_64.h:168
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
static void Exit(void)
Definition: sock.c:1330
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
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
uint32_t * LPDWORD
Definition: typedefs.h:59
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 IN
Definition: typedefs.h:39
#define MAKELONG(a, b)
Definition: typedefs.h:249
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_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
W32KAPI BOOL APIENTRY NtGdiGetFontResourceInfoInternalW(IN LPWSTR pwszFiles, IN ULONG cwc, IN ULONG cFiles, IN UINT cjIn, IN OUT LPDWORD pdwBytes, OUT LPVOID pvBuf, IN DWORD dwType)
Definition: font.c:957
DWORD FASTCALL IntGetFontLanguageInfo(PDC Dc)
Definition: font.c:371
DWORD APIENTRY NtGdiGetFontUnicodeRanges(IN HDC hdc, OUT OPTIONAL LPGLYPHSET pgs)
Definition: font.c:650
HFONT APIENTRY HfontCreate(IN PENUMLOGFONTEXDVW pelfw, IN ULONG cjElfw, IN LFTYPE lft, IN FLONG fl, IN PVOID pvCliData)
Definition: font.c:1140
DWORD FASTCALL IntGetCharDimensions(HDC hdc, PTEXTMETRICW ptm, PDWORD height)
Definition: font.c:329
DWORD FASTCALL GreGetKerningPairs(HDC hDC, ULONG NumPairs, LPKERNINGPAIR krnpair)
Definition: font.c:48
BOOL APIENTRY NtGdiGetRealizationInfo(IN HDC hdc, OUT PREALIZATION_INFO pri, IN HFONT hf)
Definition: font.c:1071
HFONT FASTCALL GreCreateFontIndirectW(LOGFONTW *lplf)
Definition: font.c:23
ULONG FASTCALL FontGetObject(PTEXTOBJ plfont, ULONG cjBuffer, PVOID pvBuffer)
Definition: font.c:293
DWORD APIENTRY NtGdiGetFontData(HDC hDC, DWORD Table, DWORD Offset, LPVOID Buffer, DWORD Size)
Definition: font.c:588
PTEXTOBJ FASTCALL RealizeFontInit(HFONT hFont)
Definition: font.c:422
BOOL FASTCALL GreGetTextExtentW(HDC hDC, LPCWSTR lpwsz, INT cwc, LPSIZE psize, UINT flOpts)
Definition: text.c:78
BOOL FASTCALL GreGetTextExtentExW(HDC hDC, LPCWSTR String, ULONG Count, ULONG MaxExtent, PULONG Fit, PULONG Dx, LPSIZE pSize, FLONG fl)
Definition: text.c:135
#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
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193