diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index d439803efec..b4f9ac04c63 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -2455,9 +2455,9 @@ MmCreateDataFileSection(PROS_SECTION_OBJECT *SectionObject, * FIXME: Revise this once a locking order for file size changes is * decided */ - if (UMaximumSize != NULL) + if ((UMaximumSize != NULL) && (UMaximumSize->QuadPart != 0)) { - MaximumSize = *UMaximumSize; + MaximumSize = *UMaximumSize; } else { @@ -3383,7 +3383,7 @@ MmCreateImageSection(PROS_SECTION_OBJECT *SectionObject, ImageSectionObject, NULL)) { /* - * An other thread has initialized the some image in the background + * An other thread has initialized the same image in the background */ ExFreePool(ImageSectionObject->Segments); ExFreePool(ImageSectionObject); diff --git a/reactos/subsystems/win32/win32k/objects/text.c b/reactos/subsystems/win32/win32k/objects/text.c index a4e59a2978f..8adc45b27ee 100644 --- a/reactos/subsystems/win32/win32k/objects/text.c +++ b/reactos/subsystems/win32/win32k/objects/text.c @@ -278,6 +278,7 @@ IntGdiAddFontResource(PUNICODE_STRING FileName, DWORD Characteristics) PFONT_ENTRY Entry; PSECTION_OBJECT SectionObject; ULONG ViewSize = 0; + LARGE_INTEGER SectionSize; FT_Fixed XScale, YScale; UNICODE_STRING FontRegPath = RTL_CONSTANT_STRING(L"\\REGISTRY\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts"); @@ -294,13 +295,14 @@ IntGdiAddFontResource(PUNICODE_STRING FileName, DWORD Characteristics) if (!NT_SUCCESS(Status)) { - DPRINT("Could not font file: %wZ\n", FileName); + DPRINT("Could not load font file: %wZ\n", FileName); return 0; } + SectionSize.QuadPart = 0LL; Status = MmCreateSection((PVOID)&SectionObject, SECTION_ALL_ACCESS, - NULL, NULL, PAGE_READONLY, - 0, FileHandle, NULL); + NULL, &SectionSize, PAGE_READONLY, + SEC_COMMIT, FileHandle, NULL); if (!NT_SUCCESS(Status)) { DPRINT("Could not map file: %wZ\n", FileName);