Author: ion Date: Wed Sep 19 01:56:28 2012 New Revision: 57330
URL: http://svn.reactos.org/svn/reactos?rev=57330&view=rev Log: [WIN32K]: And all along I thought I had committed this... I guess it must work pretty well if I never noticed the difference :). This patch makes Win32k use session space instead of system space, now that we've had session space for a while. tkreuzer: review?
Modified: trunk/reactos/win32ss/gdi/eng/mapping.c trunk/reactos/win32ss/gdi/ntgdi/gdiobj.c trunk/reactos/win32ss/user/ntuser/misc/usrheap.c
Modified: trunk/reactos/win32ss/gdi/eng/mapping.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/mapping.c?r... ============================================================================== --- trunk/reactos/win32ss/gdi/eng/mapping.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/eng/mapping.c [iso-8859-1] Wed Sep 19 01:56:28 2012 @@ -10,10 +10,6 @@
#define NDEBUG #include <debug.h> - -// HACK!!! -#define MmMapViewInSessionSpace MmMapViewInSystemSpace -#define MmUnmapViewInSessionSpace MmUnmapViewInSystemSpace
HANDLE ghSystem32Directory; HANDLE ghRootDirectory; @@ -127,6 +123,48 @@
return pSection; } + +PVOID +NTAPI +EngCreateSectionHack( + IN ULONG fl, + IN SIZE_T cjSize, + IN ULONG ulTag) +{ + NTSTATUS Status; + PENGSECTION pSection; + PVOID pvSectionObject; + LARGE_INTEGER liSize; + + /* Allocate a section object */ + pSection = EngAllocMem(0, sizeof(ENGSECTION), 'stsU'); + if (!pSection) return NULL; + + liSize.QuadPart = cjSize; + Status = MmCreateSection(&pvSectionObject, + SECTION_ALL_ACCESS, + NULL, + &liSize, + PAGE_READWRITE, + SEC_COMMIT | 1, + NULL, + NULL); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to create a section Status=0x%x\n", Status); + EngFreeMem(pSection); + return NULL; + } + + /* Set the fields of the section */ + pSection->ulTag = ulTag; + pSection->pvSectionObject = pvSectionObject; + pSection->pvMappedBase = NULL; + pSection->cjViewSize = cjSize; + + return pSection; +} +
BOOL @@ -250,7 +288,7 @@ if (cjSize == 0) return NULL;
/* Allocate a section object */ - pSection = EngCreateSection(fl, cjSize, ulTag); + pSection = EngCreateSectionHack(fl, cjSize, ulTag); if (!pSection) { *ppvSection = NULL; @@ -408,10 +446,10 @@
pFileView->cjView = 0;
- /* Map the section in session space */ - Status = MmMapViewInSessionSpace(pFileView->pSection, - &pFileView->pvKView, - &pFileView->cjView); + /* FIXME: Use system space because ARM3 doesn't support executable sections yet */ + Status = MmMapViewInSystemSpace(pFileView->pSection, + &pFileView->pvKView, + &pFileView->cjView); if (!NT_SUCCESS(Status)) { DPRINT1("Failed to map a section Status=0x%x\n", Status); @@ -430,8 +468,8 @@ PFILEVIEW pFileView = (PFILEVIEW)h; NTSTATUS Status;
- /* Unmap the section */ - Status = MmUnmapViewInSessionSpace(pFileView->pvKView); + /* FIXME: Use system space because ARM3 doesn't support executable sections yet */ + Status = MmUnmapViewInSystemSpace(pFileView->pvKView); if (!NT_SUCCESS(Status)) { DPRINT1("MmUnmapViewInSessionSpace failed: 0x%lx\n", Status);
Modified: trunk/reactos/win32ss/gdi/ntgdi/gdiobj.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/gdiobj.c?... ============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/gdiobj.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/gdiobj.c [iso-8859-1] Wed Sep 19 01:56:28 2012 @@ -59,8 +59,6 @@ #define ASSERT_SHARED_OBJECT_TYPE(objt) #define ASSERT_EXCLUSIVE_OBJECT_TYPE(objt) #endif - -#define MmMapViewInSessionSpace MmMapViewInSystemSpace
#if defined(_M_IX86) || defined(_M_AMD64) #define InterlockedOr16 _InterlockedOr16 @@ -166,7 +164,7 @@ NULL, &liSize, PAGE_READWRITE, - SEC_COMMIT, + SEC_COMMIT | 0x1, NULL, NULL); if (!NT_SUCCESS(status))
Modified: trunk/reactos/win32ss/user/ntuser/misc/usrheap.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/misc/us... ============================================================================== --- trunk/reactos/win32ss/user/ntuser/misc/usrheap.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/misc/usrheap.c [iso-8859-1] Wed Sep 19 01:56:28 2012 @@ -188,7 +188,7 @@ NULL, &SizeHeap, PAGE_EXECUTE_READWRITE, /* Would prefer PAGE_READWRITE, but thanks to RTL heaps... */ - SEC_RESERVE, + SEC_RESERVE | 1, NULL, NULL);
@@ -198,9 +198,9 @@ return FALSE; }
- Status = MmMapViewInSystemSpace(*SectionObject, - SystemBase, - &HeapSize); + Status = MmMapViewInSessionSpace(*SectionObject, + SystemBase, + &HeapSize); if (!NT_SUCCESS(Status)) { ObDereferenceObject(*SectionObject);