ReactOS 0.4.16-dev-983-g23ad936
font.c File Reference
#include <win32k.h>
#include <debug.h>
Include dependency graph for font.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

HFONT APIENTRY HfontCreate (IN PENUMLOGFONTEXDVW pelfw, IN ULONG cjElfw, IN LFTYPE lft, IN FLONG fl, IN PVOID pvCliData)
 
HFONT FASTCALL GreCreateFontIndirectW (LOGFONTW *lplf)
 
DWORD FASTCALL GreGetKerningPairs (HDC hDC, ULONG NumPairs, LPKERNINGPAIR krnpair)
 
ULONG FASTCALL FontGetObject (PTEXTOBJ plfont, ULONG cjBuffer, PVOID pvBuffer)
 
DWORD FASTCALL IntGetCharDimensions (HDC hdc, PTEXTMETRICW ptm, PDWORD height)
 
DWORD FASTCALL IntGetFontLanguageInfo (PDC Dc)
 
PTEXTOBJ FASTCALL RealizeFontInit (HFONT hFont)
 
static BOOL IntCheckFontPathNames (_In_reads_(cwc) WCHAR *pwcFiles, _In_ ULONG cFiles, _In_ ULONG cwc)
 
INT APIENTRY NtGdiAddFontResourceW (_In_reads_(cwc) WCHAR *pwcFiles, _In_ ULONG cwc, _In_ ULONG cFiles, _In_ FLONG fl, _In_ DWORD dwPidTid, _In_opt_ DESIGNVECTOR *pdv)
 
BOOL APIENTRY NtGdiRemoveFontResourceW (_In_reads_(cwc) WCHAR *pwszFiles, _In_ ULONG cwc, _In_ ULONG cFiles, _In_ ULONG fl, _In_ DWORD dwPidTid, _In_opt_ DESIGNVECTOR *pdv)
 
HANDLE APIENTRY NtGdiAddFontMemResourceEx (IN PVOID pvBuffer, IN DWORD cjBuffer, IN DESIGNVECTOR *pdv, IN ULONG cjDV, OUT DWORD *pNumFonts)
 
BOOL APIENTRY NtGdiRemoveFontMemResourceEx (IN HANDLE hMMFont)
 
DWORD APIENTRY NtGdiGetCharacterPlacementW (IN HDC hdc, IN LPWSTR pwsz, IN INT nCount, IN INT nMaxExtent, IN OUT LPGCP_RESULTSW pgcpw, IN DWORD dwFlags)
 
DWORD APIENTRY NtGdiGetFontData (HDC hDC, DWORD Table, DWORD Offset, LPVOID Buffer, DWORD Size)
 
DWORD APIENTRY NtGdiGetFontUnicodeRanges (IN HDC hdc, OUT OPTIONAL LPGLYPHSET pgs)
 
ULONG APIENTRY NtGdiGetGlyphOutline (IN HDC hdc, IN WCHAR wch, IN UINT iFormat, OUT LPGLYPHMETRICS pgm, IN ULONG cjBuf, OUT OPTIONAL PVOID UnsafeBuf, IN LPMAT2 pmat2, IN BOOL bIgnoreRotation)
 
DWORD APIENTRY NtGdiGetKerningPairs (HDC hDC, ULONG NumPairs, LPKERNINGPAIR krnpair)
 
ULONG APIENTRY NtGdiGetOutlineTextMetricsInternalW (HDC hDC, ULONG Data, OUTLINETEXTMETRICW *otm, TMDIFF *Tmd)
 
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)
 
BOOL APIENTRY NtGdiGetRealizationInfo (IN HDC hdc, OUT PREALIZATION_INFO pri, IN HFONT hf)
 
HFONT APIENTRY NtGdiHfontCreate (IN PENUMLOGFONTEXDVW pelfw, IN ULONG cjElfw, IN LFTYPE lft, IN FLONG fl, IN PVOID pvCliData)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Includes

Definition at line 15 of file font.c.

Function Documentation

◆ FontGetObject()

ULONG FASTCALL FontGetObject ( PTEXTOBJ  plfont,
ULONG  cjBuffer,
PVOID  pvBuffer 
)

Definition at line 293 of file font.c.

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}
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
HGDIOBJ hHmgr(VOID)
Definition: baseobj.hpp:95
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
NTSTATUS FASTCALL TextIntRealizeFont(HFONT FontHandle, PTEXTOBJ pTextObj)
Definition: freetype.c:5988
Status
Definition: gdiplustypes.h:25
#define ASSERT(a)
Definition: mode.c:44
_In_ ULONG cjBuffer
Definition: ntgdi.h:2860
#define DPRINT
Definition: sndvol32.h:73
DWORD dvNumAxes
Definition: wingdi.h:2769
BASEOBJECT BaseObject
Definition: text.h:63
FLONG fl
Definition: text.h:65
ENUMLOGFONTEXDVW logfont
Definition: text.h:70
DESIGNVECTOR elfDesignVector
Definition: wingdi.h:2780
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
uint32_t ULONG
Definition: typedefs.h:59
#define TEXTOBJECT_INIT
Definition: text.h:56

Referenced by GreGetObject().

◆ GreCreateFontIndirectW()

HFONT FASTCALL GreCreateFontIndirectW ( LOGFONTW lplf)

Internal

Definition at line 23 of file font.c.

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}
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
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
HFONT APIENTRY HfontCreate(IN PENUMLOGFONTEXDVW pelfw, IN ULONG cjElfw, IN LFTYPE lft, IN FLONG fl, IN PVOID pvCliData)
Definition: font.c:1215

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

◆ GreGetKerningPairs()

DWORD FASTCALL GreGetKerningPairs ( HDC  hDC,
ULONG  NumPairs,
LPKERNINGPAIR  krnpair 
)

Definition at line 48 of file font.c.

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}
static HDC hDC
Definition: 3dtext.c:33
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 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
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD FASTCALL ftGdiGetKerningPairs(PFONTGDI Font, DWORD cPairs, LPKERNINGPAIR pKerningPair)
Definition: freetype.c:6465
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
int Count
Definition: noreturn.cpp:7
Definition: polytest.cpp:41
HANDLE hlfntNew
Definition: ntgdihdl.h:330
Definition: text.h:60
FONTOBJ * Font
Definition: text.h:66
PTEXTOBJ FASTCALL RealizeFontInit(HFONT hFont)
Definition: font.c:422
FORCEINLINE VOID TEXTOBJ_UnlockText(PLFONT plfnt)
Definition: text.h:96
#define GDITAG_TEXT
Definition: tags.h:172
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:22

◆ HfontCreate()

HFONT APIENTRY HfontCreate ( IN PENUMLOGFONTEXDVW  pelfw,
IN ULONG  cjElfw,
IN LFTYPE  lft,
IN FLONG  fl,
IN PVOID  pvCliData 
)

Definition at line 1215 of file font.c.

1221{
1222 HFONT hNewFont;
1223 PLFONT plfont;
1224
1225 if (!pelfw)
1226 {
1227 return NULL;
1228 }
1229
1230 plfont = LFONT_AllocFontWithHandle();
1231 if (!plfont)
1232 {
1233 return NULL;
1234 }
1235 hNewFont = plfont->BaseObject.hHmgr;
1236
1237 plfont->lft = lft;
1238 plfont->fl = fl;
1239 RtlCopyMemory (&plfont->logfont, pelfw, sizeof(ENUMLOGFONTEXDVW));
1240 ExInitializePushLock(&plfont->lock);
1241
1242 if (pelfw->elfEnumLogfontEx.elfLogFont.lfEscapement !=
1243 pelfw->elfEnumLogfontEx.elfLogFont.lfOrientation)
1244 {
1245 /* This should really depend on whether GM_ADVANCED is set */
1248 }
1249 LFONT_UnlockFont(plfont);
1250
1251 if (pvCliData && hNewFont)
1252 {
1253 // FIXME: Use GDIOBJ_InsertUserData
1255 {
1258 Entry->UserData = pvCliData;
1259 }
1261 }
1262
1263 return hNewFont;
1264}
#define ExInitializePushLock
Definition: ex.h:1016
#define GDI_HANDLE_GET_INDEX(h)
Definition: gdi.h:28
#define KeLeaveCriticalRegion()
Definition: ke_x.h:119
#define KeEnterCriticalRegion()
Definition: ke_x.h:88
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
base of all file and directory entries
Definition: entries.h:83
Definition: gdi.h:2
LFTYPE lft
Definition: text.h:64
EX_PUSH_LOCK lock
Definition: text.h:71
LONG lfOrientation
Definition: wingdi.h:1900
LONG lfEscapement
Definition: wingdi.h:1899
int32_t INT
Definition: typedefs.h:58
_In_ WDFCOLLECTION _In_ ULONG Index
#define GdiHandleTable
Definition: win32nt.h:37
#define LFONT_UnlockFont(plfnt)
Definition: text.h:79
#define LFONT_AllocFontWithHandle()
Definition: text.h:76
_In_ FLONG fl
Definition: winddi.h:1279

Referenced by GreCreateFontIndirectW(), and NtGdiHfontCreate().

◆ IntCheckFontPathNames()

static BOOL IntCheckFontPathNames ( _In_reads_(cwc) WCHAR pwcFiles,
_In_ ULONG  cFiles,
_In_ ULONG  cwc 
)
static

Definition at line 442 of file font.c.

446{
447 ULONG ich, cRealFiles;
448
449 if (pwcFiles[cwc - 1] != UNICODE_NULL)
450 return FALSE;
451
452 for (ich = cRealFiles = 0; ich < cwc; ++ich)
453 {
454 if (!pwcFiles[ich])
455 ++cRealFiles;
456 }
457
458 return cRealFiles >= cFiles;
459}
#define FALSE
Definition: types.h:117
#define UNICODE_NULL

Referenced by NtGdiAddFontResourceW(), and NtGdiRemoveFontResourceW().

◆ IntGetCharDimensions()

DWORD FASTCALL IntGetCharDimensions ( HDC  hdc,
PTEXTMETRICW  ptm,
PDWORD  height 
)

Definition at line 329 of file font.c.

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}
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL FASTCALL ftGdiGetTextMetricsW(HDC hDC, PTMW_INTERNAL ptmwi)
Definition: freetype.c:5348
BOOL FASTCALL TextIntGetTextExtentPoint(PDC dc, PTEXTOBJ TextObj, LPCWSTR String, INT Count, ULONG MaxExtent, LPINT Fit, LPINT Dx, LPSIZE Size, FLONG fl)
Definition: freetype.c:5039
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
HDC hdc
Definition: main.c:9
LONG cx
Definition: kdterminal.h:27
TEXTMETRICW TextMetric
Definition: ntgdityp.h:370
LONG tmHeight
Definition: wingdi.h:2383
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by co_IntInitializeDesktopGraphics(), IntGetDialogBaseUnits(), MENU_CalcItemSize(), and UserChangeDisplaySettings().

◆ IntGetFontLanguageInfo()

DWORD FASTCALL IntGetFontLanguageInfo ( PDC  Dc)

Definition at line 371 of file font.c.

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}
INT FASTCALL ftGdiGetTextCharsetInfo(PDC Dc, LPFONTSIGNATURE lpSig, DWORD dwFlags)
Definition: freetype.c:5161
GLuint64EXT * result
Definition: glext.h:11304
FLONG flTextAlign
Definition: ntgdihdl.h:324
DWORD fsCsb[2]
Definition: wingdi.h:1543
#define GCP_GLYPHSHAPE
Definition: wingdi.h:833
#define GCP_DIACRITIC
Definition: wingdi.h:831
#define GCP_LIGATE
Definition: wingdi.h:837
#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 GCP_REORDER
Definition: wingdi.h:843
#define GCP_DBCS
Definition: wingdi.h:828

Referenced by NtGdiGetDCDword().

◆ NtGdiAddFontMemResourceEx()

HANDLE APIENTRY NtGdiAddFontMemResourceEx ( IN PVOID  pvBuffer,
IN DWORD  cjBuffer,
IN DESIGNVECTOR pdv,
IN ULONG  cjDV,
OUT DWORD pNumFonts 
)

Definition at line 573 of file font.c.

579{
581 HANDLE Ret;
582 DWORD NumFonts = 0;
583
584 DPRINT("NtGdiAddFontMemResourceEx\n");
587
588 if (!pvBuffer || !cjBuffer)
589 return NULL;
590
592 {
593 ProbeForRead(pvBuffer, cjBuffer, sizeof(BYTE));
595 RtlCopyMemory(Buffer, pvBuffer, cjBuffer);
596 }
598 {
599 if (Buffer != NULL)
600 {
602 }
603 _SEH2_YIELD(return NULL);
604 }
605 _SEH2_END;
606
607 Ret = IntGdiAddFontMemResource(Buffer, cjBuffer, &NumFonts);
609
611 {
612 ProbeForWrite(pNumFonts, sizeof(NumFonts), 1);
613 *pNumFonts = NumFonts;
614 }
616 {
617 /* Leak it? */
618 _SEH2_YIELD(return NULL);
619 }
620 _SEH2_END;
621
622
623 return Ret;
624}
Definition: bufpool.h:45
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
HANDLE FASTCALL IntGdiAddFontMemResource(PVOID Buffer, DWORD dwSize, PDWORD pNumAdded)
Definition: freetype.c:2536
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
#define DBG_UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:326
#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 TAG_FONT
Definition: tags.h:12
_In_ ULONG_PTR _In_opt_ DESIGNVECTOR * pdv
Definition: winddi.h:3723
#define ExAllocatePoolWithQuotaTag(a, b, c)
Definition: exfuncs.h:530
unsigned char BYTE
Definition: xxhash.c:193

◆ NtGdiAddFontResourceW()

INT APIENTRY NtGdiAddFontResourceW ( _In_reads_(cwc) WCHAR pwcFiles,
_In_ ULONG  cwc,
_In_ ULONG  cFiles,
_In_ FLONG  fl,
_In_ DWORD  dwPidTid,
_In_opt_ DESIGNVECTOR pdv 
)

Functions

Definition at line 465 of file font.c.

472{
473 UNICODE_STRING SafeFileName;
474 INT Ret;
475
478
479 DPRINT("NtGdiAddFontResourceW\n");
480
481 /* cwc = Length + trailing zero. */
482 if ((cwc <= 1) || (cwc > UNICODE_STRING_MAX_CHARS))
483 return 0;
484
485 SafeFileName.Length = (USHORT)((cwc - 1) * sizeof(WCHAR));
486 SafeFileName.MaximumLength = SafeFileName.Length + sizeof(UNICODE_NULL);
488 SafeFileName.MaximumLength,
489 TAG_STRING);
490 if (!SafeFileName.Buffer)
491 return 0;
492
494 {
495 ProbeForRead(pwcFiles, cwc * sizeof(WCHAR), sizeof(WCHAR));
496
497 if (!IntCheckFontPathNames(pwcFiles, cFiles, cwc))
498 return 0;
499
500 RtlCopyMemory(SafeFileName.Buffer, pwcFiles, SafeFileName.Length);
501 }
503 {
504 ExFreePoolWithTag(SafeFileName.Buffer, TAG_STRING);
505 _SEH2_YIELD(return 0);
506 }
507 _SEH2_END;
508
509 SafeFileName.Buffer[SafeFileName.Length / sizeof(WCHAR)] = UNICODE_NULL;
510
511 Ret = IntGdiAddFontResourceEx(&SafeFileName, cFiles, fl, 0);
512
513 ExFreePoolWithTag(SafeFileName.Buffer, TAG_STRING);
514 return Ret;
515}
INT FASTCALL IntGdiAddFontResourceEx(_In_ PCUNICODE_STRING FileName, _In_ DWORD cFiles, _In_ DWORD Characteristics, _In_ DWORD dwFlags)
Definition: freetype.c:2291
#define UNICODE_STRING_MAX_CHARS
#define TAG_STRING
Definition: oslist.h:22
unsigned short USHORT
Definition: pedump.c:61
USHORT MaximumLength
Definition: env_spec_w32.h:370
static BOOL IntCheckFontPathNames(_In_reads_(cwc) WCHAR *pwcFiles, _In_ ULONG cFiles, _In_ ULONG cwc)
Definition: font.c:442

Referenced by GdiAddFontResourceW(), and Test_NtGdiAddFontResourceW().

◆ NtGdiGetCharacterPlacementW()

DWORD APIENTRY NtGdiGetCharacterPlacementW ( IN HDC  hdc,
IN LPWSTR  pwsz,
IN INT  nCount,
IN INT  nMaxExtent,
IN OUT LPGCP_RESULTSW  pgcpw,
IN DWORD  dwFlags 
)

Definition at line 641 of file font.c.

648{
650 return 0;
651#if 0
652 return GreGetCharacterPlacementW( hdc,
653 pwsz,
654 nCount,
655 nMaxExtent,
656 pgcpw,
657 dwFlags);
658#endif
659}
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176

◆ NtGdiGetFontData()

DWORD APIENTRY NtGdiGetFontData ( HDC  hDC,
DWORD  Table,
DWORD  Offset,
LPVOID  Buffer,
DWORD  Size 
)

Definition at line 663 of file font.c.

669{
670 PDC Dc;
671 PDC_ATTR pdcattr;
672 HFONT hFont;
673 PTEXTOBJ TextObj;
674 PFONTGDI FontGdi;
677
678 if (Buffer && Size)
679 {
681 {
683 }
685 {
687 }
689 }
690
691 if (!NT_SUCCESS(Status)) return Result;
692
693 Dc = DC_LockDc(hDC);
694 if (Dc == NULL)
695 {
697 return GDI_ERROR;
698 }
699 pdcattr = Dc->pdcattr;
700
701 hFont = pdcattr->hlfntNew;
702 TextObj = RealizeFontInit(hFont);
703 DC_UnlockDc(Dc);
704
705 if (TextObj == NULL)
706 {
708 return GDI_ERROR;
709 }
710
711 FontGdi = ObjToGDI(TextObj->Font, FONT);
712
714
715 TEXTOBJ_UnlockText(TextObj);
716
717 return Result;
718}
HFONT hFont
Definition: main.c:53
DWORD FASTCALL ftGdiGetFontData(PFONTGDI FontGdi, DWORD Table, DWORD Offset, PVOID Buffer, DWORD Size)
Definition: freetype.c:5446
ASMGENDATA Table[]
Definition: genincdata.c:61
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:181
#define STATUS_SUCCESS
Definition: shellext.h:65
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
#define GDI_ERROR
Definition: wingdi.h:1309
_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 GetFontData().

◆ NtGdiGetFontResourceInfoInternalW()

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 at line 1032 of file font.c.

1040{
1042 DWORD dwBytes, dwBytesRequested;
1043 UNICODE_STRING SafeFileNames;
1044 BOOL bRet = FALSE;
1045 ULONG cbStringSize;
1046 LPVOID Buffer;
1047
1048 /* FIXME: Handle cFiles > 0 */
1049
1050 /* Check for valid dwType values */
1051 if (dwType > 5)
1052 {
1054 return FALSE;
1055 }
1056
1057 /* Allocate a safe unicode string buffer */
1058 cbStringSize = cwc * sizeof(WCHAR);
1059 SafeFileNames.MaximumLength = SafeFileNames.Length = (USHORT)cbStringSize - sizeof(WCHAR);
1060 SafeFileNames.Buffer = ExAllocatePoolWithTag(PagedPool,
1061 cbStringSize,
1062 TAG_USTR);
1063 if (!SafeFileNames.Buffer)
1064 {
1066 return FALSE;
1067 }
1068 RtlZeroMemory(SafeFileNames.Buffer, SafeFileNames.MaximumLength);
1069
1070 /* Check buffers and copy pwszFiles to safe unicode string */
1071 _SEH2_TRY
1072 {
1073 ProbeForRead(pwszFiles, cbStringSize, 1);
1074 ProbeForWrite(pdwBytes, sizeof(DWORD), 1);
1075 if (pvBuf)
1076 ProbeForWrite(pvBuf, cjIn, 1);
1077
1078 dwBytes = *pdwBytes;
1079 dwBytesRequested = dwBytes;
1080
1081 RtlCopyMemory(SafeFileNames.Buffer, pwszFiles, cbStringSize);
1082 if (dwBytes > 0)
1083 {
1085 }
1086 else
1087 {
1089 }
1090 }
1092 {
1094 }
1095 _SEH2_END
1096
1097 if(!NT_SUCCESS(Status))
1098 {
1100 /* Free the string buffer for the safe filename */
1101 ExFreePoolWithTag(SafeFileNames.Buffer, TAG_USTR);
1102 return FALSE;
1103 }
1104
1105 /* Do the actual call */
1106 bRet = IntGdiGetFontResourceInfo(&SafeFileNames,
1107 (pvBuf ? Buffer : NULL),
1108 &dwBytes, dwType);
1109
1110 /* Check if succeeded */
1111 if (bRet)
1112 {
1113 /* Copy the data back to caller */
1114 _SEH2_TRY
1115 {
1116 /* Buffers are already probed */
1117 if (pvBuf && dwBytesRequested > 0)
1118 RtlCopyMemory(pvBuf, Buffer, min(dwBytesRequested, dwBytes));
1119 *pdwBytes = dwBytes;
1120 }
1122 {
1124 }
1125 _SEH2_END
1126
1127 if(!NT_SUCCESS(Status))
1128 {
1130 bRet = FALSE;
1131 }
1132 }
1133
1135 /* Free the string for the safe filenames */
1136 ExFreePoolWithTag(SafeFileNames.Buffer, TAG_USTR);
1137
1138 return bRet;
1139}
#define TAG_USTR
Definition: libsupp.c:997
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
BOOL FASTCALL IntGdiGetFontResourceInfo(PUNICODE_STRING FileName, PVOID pBuffer, DWORD *pdwBytes, DWORD dwType)
Definition: freetype.c:6178
static PWSTR PDWORD pdwBytes
Definition: layerapi.c:35
#define min(a, b)
Definition: monoChain.cc:55
VOID FASTCALL SetLastNtError(_In_ NTSTATUS Status)
Definition: error.c:31
#define TAG_FINF
Definition: text.h:3
_In_ ULONG _In_ CLIPOBJ _In_ RECTL _In_ ULONG cjIn
Definition: winddi.h:3532

◆ NtGdiGetFontUnicodeRanges()

DWORD APIENTRY NtGdiGetFontUnicodeRanges ( IN HDC  hdc,
OUT OPTIONAL LPGLYPHSET  pgs 
)

Definition at line 725 of file font.c.

728{
729 PDC pDc;
730 PDC_ATTR pdcattr;
731 HFONT hFont;
732 PTEXTOBJ TextObj;
733 PFONTGDI FontGdi;
734 DWORD Size = 0;
735 PGLYPHSET pgsSafe;
737
738 pDc = DC_LockDc(hdc);
739 if (!pDc)
740 {
742 return 0;
743 }
744
745 pdcattr = pDc->pdcattr;
746
747 hFont = pdcattr->hlfntNew;
748 TextObj = RealizeFontInit(hFont);
749
750 if ( TextObj == NULL)
751 {
753 goto Exit;
754 }
755 FontGdi = ObjToGDI(TextObj->Font, FONT);
756
757 Size = ftGetFontUnicodeRanges( FontGdi, NULL);
758
759 if (Size && pgs)
760 {
762 if (!pgsSafe)
763 {
765 Size = 0;
766 goto Exit;
767 }
768
769 Size = ftGetFontUnicodeRanges( FontGdi, pgsSafe);
770
771 if (Size)
772 {
774 {
775 ProbeForWrite(pgs, Size, 1);
776 RtlCopyMemory(pgs, pgsSafe, Size);
777 }
779 {
781 }
783
784 if (!NT_SUCCESS(Status)) Size = 0;
785 }
787 }
788Exit:
789 TEXTOBJ_UnlockText(TextObj);
790 DC_UnlockDc(pDc);
791 return Size;
792}
DWORD FASTCALL ftGetFontUnicodeRanges(PFONTGDI Font, PGLYPHSET glyphset)
Definition: freetype.c:5274
static void Exit(void)
Definition: sock.c:1330

◆ NtGdiGetGlyphOutline()

ULONG APIENTRY NtGdiGetGlyphOutline ( IN HDC  hdc,
IN WCHAR  wch,
IN UINT  iFormat,
OUT LPGLYPHMETRICS  pgm,
IN ULONG  cjBuf,
OUT OPTIONAL PVOID  UnsafeBuf,
IN LPMAT2  pmat2,
IN BOOL  bIgnoreRotation 
)

Definition at line 796 of file font.c.

805{
806 ULONG Ret = GDI_ERROR;
807 PDC dc;
808 PVOID pvBuf = NULL;
809 GLYPHMETRICS gm;
811
812 dc = DC_LockDc(hdc);
813 if (!dc)
814 {
816 return GDI_ERROR;
817 }
818
819 if (UnsafeBuf && cjBuf)
820 {
822 if (!pvBuf)
823 {
825 goto Exit;
826 }
827 }
828
830 wch,
831 iFormat,
832 pgm ? &gm : NULL,
833 cjBuf,
834 pvBuf,
835 pmat2,
836 bIgnoreRotation);
837
838 if (pvBuf)
839 {
841 {
842 ProbeForWrite(UnsafeBuf, cjBuf, 1);
843 RtlCopyMemory(UnsafeBuf, pvBuf, cjBuf);
844 }
846 {
848 }
850
852 }
853
854 if (pgm)
855 {
857 {
858 ProbeForWrite(pgm, sizeof(GLYPHMETRICS), 1);
859 RtlCopyMemory(pgm, &gm, sizeof(GLYPHMETRICS));
860 }
862 {
864 }
866 }
867
868 if (! NT_SUCCESS(Status))
869 {
871 Ret = GDI_ERROR;
872 }
873
874Exit:
876 return Ret;
877}
ULONG FASTCALL ftGdiGetGlyphOutline(PDC dc, WCHAR wch, UINT iFormat, LPGLYPHMETRICS pgm, ULONG cjBuf, PVOID pvBuf, LPMAT2 pmat2, BOOL bIgnoreRotation)
Definition: freetype.c:4511
FORCEINLINE PVOID ExAllocatePoolZero(ULONG PoolType, SIZE_T NumberOfBytes, ULONG Tag)
Definition: precomp.h:45
_In_ DWORD cjBuf
Definition: winddi.h:3827
_In_ SIZEL _In_ ULONG iFormat
Definition: winddi.h:3468

◆ NtGdiGetKerningPairs()

DWORD APIENTRY NtGdiGetKerningPairs ( HDC  hDC,
ULONG  NumPairs,
LPKERNINGPAIR  krnpair 
)

Definition at line 881 of file font.c.

884{
885 PDC dc;
886 PDC_ATTR pdcattr;
887 PTEXTOBJ TextObj;
888 PFONTGDI FontGDI;
889 DWORD Count;
890 KERNINGPAIR *pKP;
892
893 dc = DC_LockDc(hDC);
894 if (!dc)
895 {
897 return 0;
898 }
899
900 pdcattr = dc->pdcattr;
901 TextObj = RealizeFontInit(pdcattr->hlfntNew);
903
904 if (!TextObj)
905 {
907 return 0;
908 }
909
910 FontGDI = ObjToGDI(TextObj->Font, FONT);
911 TEXTOBJ_UnlockText(TextObj);
912
913 Count = ftGdiGetKerningPairs(FontGDI,0,NULL);
914
915 if ( Count && krnpair )
916 {
917 if (Count > NumPairs)
918 {
920 return 0;
921 }
923 if (!pKP)
924 {
926 return 0;
927 }
928 ftGdiGetKerningPairs(FontGDI,Count,pKP);
930 {
931 ProbeForWrite(krnpair, Count * sizeof(KERNINGPAIR), 1);
932 RtlCopyMemory(krnpair, pKP, Count * sizeof(KERNINGPAIR));
933 }
935 {
937 }
939 if (!NT_SUCCESS(Status))
940 {
942 Count = 0;
943 }
945 }
946 return Count;
947}

◆ NtGdiGetOutlineTextMetricsInternalW()

ULONG APIENTRY NtGdiGetOutlineTextMetricsInternalW ( HDC  hDC,
ULONG  Data,
OUTLINETEXTMETRICW otm,
TMDIFF Tmd 
)

Definition at line 955 of file font.c.

959{
960 PDC dc;
961 PDC_ATTR pdcattr;
962 PTEXTOBJ TextObj;
963 PFONTGDI FontGDI;
964 HFONT hFont = 0;
965 ULONG Size;
966 OUTLINETEXTMETRICW *potm;
968
969 dc = DC_LockDc(hDC);
970 if (!dc)
971 {
973 return 0;
974 }
975 pdcattr = dc->pdcattr;
976 hFont = pdcattr->hlfntNew;
977 TextObj = RealizeFontInit(hFont);
979 if (!TextObj)
980 {
982 return 0;
983 }
984 FontGDI = ObjToGDI(TextObj->Font, FONT);
985 if (!(FontGDI->flType & FO_TYPE_TRUETYPE))
986 {
987 TEXTOBJ_UnlockText(TextObj);
988 return 0;
989 }
990 TextIntUpdateSize(dc, TextObj, FontGDI, TRUE);
991 TEXTOBJ_UnlockText(TextObj);
992 Size = IntGetOutlineTextMetrics(FontGDI, 0, NULL, FALSE);
993 if (!otm) return Size;
994 if (Size > Data)
995 {
997 return 0;
998 }
1000 if (!potm)
1001 {
1003 return 0;
1004 }
1005 RtlZeroMemory(potm, Size);
1006 IntGetOutlineTextMetrics(FontGDI, Size, potm, FALSE);
1007
1008 _SEH2_TRY
1009 {
1010 ProbeForWrite(otm, Size, 1);
1011 RtlCopyMemory(otm, potm, Size);
1012 }
1014 {
1016 }
1017 _SEH2_END
1018
1019 if (!NT_SUCCESS(Status))
1020 {
1022 Size = 0;
1023 }
1024
1026 return Size;
1027}
#define TRUE
Definition: types.h:120
BOOL FASTCALL TextIntUpdateSize(PDC dc, PTEXTOBJ TextObj, PFONTGDI FontGDI, BOOL bDoLock)
Definition: freetype.c:4302
INT FASTCALL IntGetOutlineTextMetrics(PFONTGDI FontGDI, UINT Size, OUTLINETEXTMETRICW *Otm, BOOL bLocked)
Definition: freetype.c:3149
FLONG flType
Definition: engobjects.h:142
#define FO_TYPE_TRUETYPE
Definition: winddi.h:737

◆ NtGdiGetRealizationInfo()

BOOL APIENTRY NtGdiGetRealizationInfo ( IN HDC  hdc,
OUT PREALIZATION_INFO  pri,
IN HFONT  hf 
)

Definition at line 1146 of file font.c.

1150{
1151 PDC pDc;
1152 PTEXTOBJ pTextObj;
1153 PFONTGDI pFontGdi;
1154 PDC_ATTR pdcattr;
1155 BOOL Ret = FALSE;
1156 INT i = 0;
1158
1159 pDc = DC_LockDc(hdc);
1160 if (!pDc)
1161 {
1163 return 0;
1164 }
1165 pdcattr = pDc->pdcattr;
1166 pTextObj = RealizeFontInit(pdcattr->hlfntNew);
1167 ASSERT(pTextObj != NULL);
1168 pFontGdi = ObjToGDI(pTextObj->Font, FONT);
1169 TEXTOBJ_UnlockText(pTextObj);
1170 DC_UnlockDc(pDc);
1171
1172 Ret = ftGdiRealizationInfo(pFontGdi, &ri);
1173 if (Ret)
1174 {
1175 if (pri)
1176 {
1178 _SEH2_TRY
1179 {
1180 ProbeForWrite(pri, sizeof(REALIZATION_INFO), 1);
1181 RtlCopyMemory(pri, &ri, sizeof(REALIZATION_INFO));
1182 }
1184 {
1186 }
1187 _SEH2_END
1188
1189 if(!NT_SUCCESS(Status))
1190 {
1192 return FALSE;
1193 }
1194 }
1195 do
1196 {
1197 if (GdiHandleTable->cfPublic[i].hf == hf)
1198 {
1199 GdiHandleTable->cfPublic[i].iTechnology = ri.iTechnology;
1200 GdiHandleTable->cfPublic[i].iUniq = ri.iUniq;
1201 GdiHandleTable->cfPublic[i].dwUnknown = ri.dwUnknown;
1202 GdiHandleTable->cfPublic[i].dwCFCount = GdiHandleTable->dwCFCount;
1203 GdiHandleTable->cfPublic[i].fl |= CFONT_REALIZATION;
1204 }
1205 i++;
1206 }
1207 while ( i < GDI_CFONT_MAX );
1208 }
1209 return Ret;
1210}
BOOL FASTCALL ftGdiRealizationInfo(PFONTGDI Font, PREALIZATION_INFO Info)
Definition: freetype.c:6446
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 GDI_CFONT_MAX
Definition: ntgdihdl.h:20
#define CFONT_REALIZATION
Definition: ntgdityp.h:430

Referenced by GdiRealizationInfo().

◆ NtGdiHfontCreate()

HFONT APIENTRY NtGdiHfontCreate ( IN PENUMLOGFONTEXDVW  pelfw,
IN ULONG  cjElfw,
IN LFTYPE  lft,
IN FLONG  fl,
IN PVOID  pvCliData 
)

Definition at line 1269 of file font.c.

1275{
1276 ENUMLOGFONTEXDVW SafeLogfont;
1278
1279 /* Silence GCC warnings */
1282
1283 if (!pelfw)
1284 {
1285 return NULL;
1286 }
1287
1288 _SEH2_TRY
1289 {
1290 ProbeForRead(pelfw, sizeof(ENUMLOGFONTEXDVW), 1);
1291 RtlCopyMemory(&SafeLogfont, pelfw, sizeof(ENUMLOGFONTEXDVW));
1292 }
1294 {
1296 }
1297 _SEH2_END
1298
1299 if (!NT_SUCCESS(Status))
1300 {
1301 return NULL;
1302 }
1303
1304 return HfontCreate(&SafeLogfont, cjElfw, lft, fl, pvCliData);
1305}

◆ NtGdiRemoveFontMemResourceEx()

BOOL APIENTRY NtGdiRemoveFontMemResourceEx ( IN HANDLE  hMMFont)

Definition at line 629 of file font.c.

631{
632 return IntGdiRemoveFontMemResource(hMMFont);
633}
BOOL FASTCALL IntGdiRemoveFontMemResource(HANDLE hMMFont)
Definition: freetype.c:2622

◆ NtGdiRemoveFontResourceW()

BOOL APIENTRY NtGdiRemoveFontResourceW ( _In_reads_(cwc) WCHAR pwszFiles,
_In_ ULONG  cwc,
_In_ ULONG  cFiles,
_In_ ULONG  fl,
_In_ DWORD  dwPidTid,
_In_opt_ DESIGNVECTOR pdv 
)

Definition at line 519 of file font.c.

526{
527 UNICODE_STRING SafeFileName;
528 BOOL Ret;
529
532
533 DPRINT("NtGdiRemoveFontResourceW\n");
534
535 /* cwc = Length + trailing zero. */
536 if ((cwc <= 1) || (cwc > UNICODE_STRING_MAX_CHARS))
537 return FALSE;
538
539 SafeFileName.Length = (USHORT)((cwc - 1) * sizeof(WCHAR));
540 SafeFileName.MaximumLength = SafeFileName.Length + sizeof(UNICODE_NULL);
542 SafeFileName.MaximumLength,
543 TAG_STRING);
544 if (!SafeFileName.Buffer)
545 return FALSE;
546
548 {
549 ProbeForRead(pwszFiles, cwc * sizeof(WCHAR), sizeof(WCHAR));
550
551 if (!IntCheckFontPathNames(pwszFiles, cFiles, cwc))
552 return FALSE;
553
554 RtlCopyMemory(SafeFileName.Buffer, pwszFiles, SafeFileName.Length);
555 }
557 {
558 ExFreePoolWithTag(SafeFileName.Buffer, TAG_STRING);
559 _SEH2_YIELD(return FALSE);
560 }
561 _SEH2_END;
562
563 SafeFileName.Buffer[SafeFileName.Length / sizeof(WCHAR)] = UNICODE_NULL;
564
565 Ret = IntGdiRemoveFontResource(&SafeFileName, cFiles, fl);
566
567 ExFreePoolWithTag(SafeFileName.Buffer, TAG_STRING);
568 return Ret;
569}
BOOL FASTCALL IntGdiRemoveFontResource(_In_ PCUNICODE_STRING FileName, _In_ DWORD cFiles, _In_ DWORD dwFlags)
Definition: freetype.c:2338

Referenced by RemoveFontResourceExW().

◆ RealizeFontInit()