mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 18:33:10 +00:00
- store all loaded global fonts under HKLM\Software\Microsoft\Windows NT\CurrentVersion\Fonts
svn path=/trunk/; revision=35184
This commit is contained in:
parent
acbdcaaf87
commit
fbb7095a67
1 changed files with 15 additions and 3 deletions
|
@ -268,7 +268,7 @@ IntGdiAddFontResource(PUNICODE_STRING FileName, DWORD Characteristics)
|
||||||
{
|
{
|
||||||
FONTGDI *FontGDI;
|
FONTGDI *FontGDI;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
HANDLE FileHandle;
|
HANDLE FileHandle, KeyHandle;
|
||||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
PVOID Buffer = NULL;
|
PVOID Buffer = NULL;
|
||||||
IO_STATUS_BLOCK Iosb;
|
IO_STATUS_BLOCK Iosb;
|
||||||
|
@ -279,6 +279,7 @@ IntGdiAddFontResource(PUNICODE_STRING FileName, DWORD Characteristics)
|
||||||
PSECTION_OBJECT SectionObject;
|
PSECTION_OBJECT SectionObject;
|
||||||
ULONG ViewSize = 0;
|
ULONG ViewSize = 0;
|
||||||
FT_Fixed XScale, YScale;
|
FT_Fixed XScale, YScale;
|
||||||
|
UNICODE_STRING FontRegPath = RTL_CONSTANT_STRING(L"\\REGISTRY\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts");
|
||||||
|
|
||||||
/* Open the font file */
|
/* Open the font file */
|
||||||
|
|
||||||
|
@ -384,7 +385,7 @@ IntGdiAddFontResource(PUNICODE_STRING FileName, DWORD Characteristics)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DPRINT("Font loaded: %s (%s)\n", Face->family_name, Face->style_name);
|
DPRINT1("Font loaded: %s (%s)\n", Face->family_name, Face->style_name);
|
||||||
DPRINT("Num glyphs: %u\n", Face->num_glyphs);
|
DPRINT("Num glyphs: %u\n", Face->num_glyphs);
|
||||||
|
|
||||||
/* Add this font resource to the font table */
|
/* Add this font resource to the font table */
|
||||||
|
@ -405,9 +406,20 @@ IntGdiAddFontResource(PUNICODE_STRING FileName, DWORD Characteristics)
|
||||||
{
|
{
|
||||||
IntLockGlobalFonts;
|
IntLockGlobalFonts;
|
||||||
InsertTailList(&FontListHead, &Entry->ListEntry);
|
InsertTailList(&FontListHead, &Entry->ListEntry);
|
||||||
|
InitializeObjectAttributes(&ObjectAttributes, &FontRegPath, OBJ_CASE_INSENSITIVE, NULL, NULL);
|
||||||
|
Status = ZwOpenKey(&KeyHandle, KEY_WRITE, &ObjectAttributes);
|
||||||
|
if (NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
LPWSTR pName = wcsrchr(FileName->Buffer, L'\\');
|
||||||
|
if (pName)
|
||||||
|
{
|
||||||
|
pName++;
|
||||||
|
ZwSetValueKey(KeyHandle, &Entry->FaceName, 0, REG_SZ, pName, (wcslen(pName) + 1) * sizeof(WCHAR));
|
||||||
|
}
|
||||||
|
ZwClose(KeyHandle);
|
||||||
|
}
|
||||||
IntUnLockGlobalFonts;
|
IntUnLockGlobalFonts;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue