mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 04:13:34 +00:00
- 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). svn path=/trunk/; revision=36506
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user