Author: janderwald Date: Fri Aug 8 09:43:43 2008 New Revision: 35184
URL: http://svn.reactos.org/svn/reactos?rev=35184&view=rev Log: - store all loaded global fonts under HKLM\Software\Microsoft\Windows NT\CurrentVersion\Fonts
Modified: trunk/reactos/subsystems/win32/win32k/objects/text.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/text.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/text.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/text.c [iso-8859-1] Fri Aug 8 09:43:43 2008 @@ -268,7 +268,7 @@ { FONTGDI *FontGDI; NTSTATUS Status; - HANDLE FileHandle; + HANDLE FileHandle, KeyHandle; OBJECT_ATTRIBUTES ObjectAttributes; PVOID Buffer = NULL; IO_STATUS_BLOCK Iosb; @@ -279,6 +279,7 @@ PSECTION_OBJECT SectionObject; ULONG ViewSize = 0; FT_Fixed XScale, YScale; + UNICODE_STRING FontRegPath = RTL_CONSTANT_STRING(L"\REGISTRY\Machine\Software\Microsoft\Windows NT\CurrentVersion\Fonts");
/* Open the font file */
@@ -384,7 +385,7 @@
- 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);
/* Add this font resource to the font table */ @@ -405,9 +406,20 @@ { IntLockGlobalFonts; 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; } - return 1; }