Author: fireball
Date: Thu Sep 25 06:24:51 2008
New Revision: 36506
URL: http://svn.reactos.org/svn/reactos?rev=36506&view=rev
Log:
- Fix one more totally "out of ideas how to create sections" MmCreateSection usage. Not only the MaximumSize is mandatory for file-backed sections, but an allocation type must be specified (SEC_COMMIT, and it's not the same as some humble "0" passed there as a value).
- Fix ReactOS's MmCreateDataFileSection to ignore 0 value in the MaximumSize (it has an additional check for MaximumSize being non-NULL, but this should be removed in future).
Modified:
trunk/reactos/ntoskrnl/mm/section.c
trunk/reactos/subsystems/win32/win32k/objects/text.c
Modified: trunk/reactos/ntoskrnl/mm/section.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/section.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] Thu Sep 25 06:24:51 2008
@@ -2455,9 +2455,9 @@
* FIXME: Revise this once a locking order for file size changes is
* decided
*/
- if (UMaximumSize != NULL)
- {
- MaximumSize = *UMaximumSize;
+ if ((UMaximumSize != NULL) && (UMaximumSize->QuadPart != 0))
+ {
+ MaximumSize = *UMaximumSize;
}
else
{
@@ -3383,7 +3383,7 @@
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);
Modified: trunk/reactos/subsystems/win32/win32k/objects/text.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/text.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/text.c [iso-8859-1] Thu Sep 25 06:24:51 2008
@@ -278,6 +278,7 @@
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 @@
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);