Author: arty
Date: Tue May 8 06:01:59 2012
New Revision: 56540
URL: http://svn.reactos.org/svn/reactos?rev=56540&view=rev
Log:
[NTOSKRNL]
Fix a couple of omissions from my PAGEOP removal;
Make sure to place a wait entry in the address space when faulting
in bss pages.
Restore the original entry in the final cases of section swap out,
because the entry had been replaced with a wait and nothing else
restores it.
Modified:
trunk/reactos/ntoskrnl/mm/section.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] Tue May 8 06:01:59 2012
@@ -60,8 +60,8 @@
#undef MmSetPageEntrySectionSegment
#define MmSetPageEntrySectionSegment(S,O,E) do { \
- DPRINT("SetPageEntrySectionSegment(old,%x,%x,%x)\n", S,(O)->LowPart,E); \
- _MmSetPageEntrySectionSegment(S,O,E,__FILE__,__LINE__); \
+ DPRINT("SetPageEntrySectionSegment(old,%x,%x,%x)\n",(S),(O)->LowPart,E); \
+ _MmSetPageEntrySectionSegment((S),(O),(E),__FILE__,__LINE__); \
} while (0)
extern MMSESSION MmSession;
@@ -1211,6 +1211,7 @@
BOOLEAN HasSwapEntry;
PVOID PAddress;
PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace);
+ SWAPENTRY SwapEntry;
/*
* There is a window between taking the page fault and locking the
@@ -1277,7 +1278,6 @@
if (HasSwapEntry)
{
- SWAPENTRY SwapEntry;
/*
* Is it a wait entry?
*/
@@ -1307,6 +1307,7 @@
MmUnlockSectionSegment(Segment);
MmDeletePageFileMapping(Process, Address, &SwapEntry);
+ MmCreatePageFileMapping(Process, Address, MM_WAIT_ENTRY);
MmUnlockAddressSpace(AddressSpace);
MI_SET_USAGE(MI_USAGE_SECTION);
@@ -1389,6 +1390,9 @@
*/
if (Segment->Image.Characteristics & IMAGE_SCN_CNT_UNINITIALIZED_DATA)
{
+ /* We'll be unlocking the address space below. Prevent us from being preempted
+ * in faulting in the page. */
+ MmCreatePageFileMapping(Process, Address, MM_WAIT_ENTRY);
MmUnlockSectionSegment(Segment);
MI_SET_USAGE(MI_USAGE_SECTION);
if (Process) MI_SET_PROCESS2(Process->ImageFileName);
@@ -1396,14 +1400,16 @@
Status = MmRequestPageMemoryConsumer(MC_USER, FALSE, &Page);
if (!NT_SUCCESS(Status))
{
- MmUnlockAddressSpace(AddressSpace);
- Status = MmRequestPageMemoryConsumer(MC_USER, TRUE, &Page);
- MmLockAddressSpace(AddressSpace);
+ MmUnlockAddressSpace(AddressSpace);
+ Status = MmRequestPageMemoryConsumer(MC_USER, TRUE, &Page);
+ MmLockAddressSpace(AddressSpace);
}
if (!NT_SUCCESS(Status))
{
KeBugCheck(MEMORY_MANAGEMENT);
}
+ /* Remove the wait entry we placed, so that we can map the page */
+ MmDeletePageFileMapping(Process, PAddress, &SwapEntry);
Status = MmCreateVirtualMapping(Process,
PAddress,
Region->Protect,
@@ -1411,9 +1417,9 @@
1);
if (!NT_SUCCESS(Status))
{
- DPRINT("MmCreateVirtualMapping failed, not out of memory\n");
+ DPRINT("MmCreateVirtualMapping failed, not out of memory\n");
KeBugCheck(MEMORY_MANAGEMENT);
- return(Status);
+ return(Status);
}
MmInsertRmap(Page, Process, Address);
@@ -2042,7 +2048,7 @@
Address);
KeBugCheckEx(MEMORY_MANAGEMENT, SwapEntry, Page, (ULONG_PTR)Process, (ULONG_PTR)Address);
}
- MmReleasePageMemoryConsumer(MC_USER, Page);
+ MmReleasePageMemoryConsumer(MC_USER, Page);
MiSetPageEvent(NULL, NULL);
return(STATUS_SUCCESS);
}
@@ -2189,6 +2195,8 @@
Status = MmCreatePageFileMapping(Process,
Address,
SwapEntry);
+ /* We had placed a wait entry upon entry ... replace it before leaving */
+ MmSetPageEntrySectionSegment(Context.Segment, &Context.Offset, Entry);
MmUnlockSectionSegment(Context.Segment);
MmUnlockAddressSpace(AddressSpace);
if (!NT_SUCCESS(Status))
@@ -2202,6 +2210,7 @@
MmLockAddressSpace(AddressSpace);
MmLockSectionSegment(Context.Segment);
Entry = MAKE_SWAP_SSE(SwapEntry);
+ /* We had placed a wait entry upon entry ... replace it before leaving */
MmSetPageEntrySectionSegment(Context.Segment, &Context.Offset, Entry);
MmUnlockSectionSegment(Context.Segment);
MmUnlockAddressSpace(AddressSpace);
Author: tkreuzer
Date: Mon May 7 22:57:41 2012
New Revision: 56537
URL: http://svn.reactos.org/svn/reactos?rev=56537&view=rev
Log:
[WIN32K]
Don't assert on DIB brushes with BR_IS_DIBPALCOLORS, since we already handle this properly.
Modified:
trunk/reactos/win32ss/gdi/eng/engbrush.c
Modified: trunk/reactos/win32ss/gdi/eng/engbrush.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/engbrush.c…
==============================================================================
--- trunk/reactos/win32ss/gdi/eng/engbrush.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/eng/engbrush.c [iso-8859-1] Mon May 7 22:57:41 2012
@@ -309,7 +309,7 @@
/* DIB brushes with DIB_PAL_COLORS usage need a new palette */
if (pbr->flAttrs & BR_IS_DIBPALCOLORS)
{
- ASSERT(FALSE);
+ /* Create a palette with the colors from the DC */
ppalPattern = FixupDIBBrushPalette(psurfPattern->ppal, pebo->ppalDC);
pebo->ppalDIB = ppalPattern;
}
Author: akhaldi
Date: Mon May 7 18:49:59 2012
New Revision: 56533
URL: http://svn.reactos.org/svn/reactos?rev=56533&view=rev
Log:
[WINED3D]
* Remove unneeded powf.c and sqrtf.c.
Removed:
trunk/reactos/dll/directx/wine/wined3d/powf.c
trunk/reactos/dll/directx/wine/wined3d/sqrtf.c
Removed: trunk/reactos/dll/directx/wine/wined3d/powf.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/p…
==============================================================================
--- trunk/reactos/dll/directx/wine/wined3d/powf.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/wined3d/powf.c (removed)
@@ -1,11 +1,0 @@
-/**
- * This file has no copyright assigned and is placed in the Public Domain.
- * This file is part of the w64 mingw-runtime package.
- * No warranty is given; refer to the file DISCLAIMER.PD within this package.
- */
-#include <math.h>
-
-float powf(float x, float y)
-{
- return (float)pow((double)x, (double)y);
-}
Removed: trunk/reactos/dll/directx/wine/wined3d/sqrtf.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/s…
==============================================================================
--- trunk/reactos/dll/directx/wine/wined3d/sqrtf.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/wined3d/sqrtf.c (removed)
@@ -1,11 +1,0 @@
-/**
- * This file has no copyright assigned and is placed in the Public Domain.
- * This file is part of the w64 mingw-runtime package.
- * No warranty is given; refer to the file DISCLAIMER.PD within this package.
- */
-#include <math.h>
-
-float sqrtf(float x)
-{
- return (float)sqrt((double)x);
-}