mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[NTOS:MM]
- Show that PAGE_NOCACHE also works for image and data sections - Show that *MapViewOfSection returns user space addresses CORE-9808 svn path=/trunk/; revision=68352
This commit is contained in:
parent
7346aece52
commit
64379e8f3a
1 changed files with 18 additions and 0 deletions
|
@ -62,6 +62,21 @@
|
||||||
ok_eq_hex(Status, ExpectAtBase ? STATUS_SUCCESS : STATUS_IMAGE_NOT_AT_BASE);\
|
ok_eq_hex(Status, ExpectAtBase ? STATUS_SUCCESS : STATUS_IMAGE_NOT_AT_BASE);\
|
||||||
if (!skip(NT_SUCCESS(Status), "Section not mapped\n")) \
|
if (!skip(NT_SUCCESS(Status), "Section not mapped\n")) \
|
||||||
{ \
|
{ \
|
||||||
|
ok((LONG_PTR)BaseAddress > 0, "BaseAddress = %p\n", BaseAddress); \
|
||||||
|
ok_eq_uint(*(PUCHAR)BaseAddress, ExpectM ? 'M' : 0); \
|
||||||
|
Status = MmUnmapViewOfSection(PsGetCurrentProcess(), BaseAddress); \
|
||||||
|
ok_eq_hex(Status, STATUS_SUCCESS); \
|
||||||
|
} \
|
||||||
|
BaseAddress = NULL; \
|
||||||
|
ViewSize = 0; \
|
||||||
|
Status = MmMapViewOfSection(SectionObject, PsGetCurrentProcess(), \
|
||||||
|
&BaseAddress, 0, 1, &SectionOffset, \
|
||||||
|
&ViewSize, ViewUnmap, 0, \
|
||||||
|
PAGE_READONLY | PAGE_NOCACHE); \
|
||||||
|
ok_eq_hex(Status, ExpectAtBase ? STATUS_SUCCESS : STATUS_IMAGE_NOT_AT_BASE);\
|
||||||
|
if (!skip(NT_SUCCESS(Status), "Section not mapped\n")) \
|
||||||
|
{ \
|
||||||
|
ok((LONG_PTR)BaseAddress > 0, "BaseAddress = %p\n", BaseAddress); \
|
||||||
ok_eq_uint(*(PUCHAR)BaseAddress, ExpectM ? 'M' : 0); \
|
ok_eq_uint(*(PUCHAR)BaseAddress, ExpectM ? 'M' : 0); \
|
||||||
Status = MmUnmapViewOfSection(PsGetCurrentProcess(), BaseAddress); \
|
Status = MmUnmapViewOfSection(PsGetCurrentProcess(), BaseAddress); \
|
||||||
ok_eq_hex(Status, STATUS_SUCCESS); \
|
ok_eq_hex(Status, STATUS_SUCCESS); \
|
||||||
|
@ -452,6 +467,7 @@ TestPhysicalMemorySection(VOID)
|
||||||
ok_eq_hex(Status, STATUS_SUCCESS);
|
ok_eq_hex(Status, STATUS_SUCCESS);
|
||||||
if (!skip(NT_SUCCESS(Status), "No view\n"))
|
if (!skip(NT_SUCCESS(Status), "No view\n"))
|
||||||
{
|
{
|
||||||
|
ok((LONG_PTR)Mapping > 0, "Mapping = %p\n", Mapping);
|
||||||
EqualBytes = RtlCompareMemory(Mapping,
|
EqualBytes = RtlCompareMemory(Mapping,
|
||||||
ZeroPageContents,
|
ZeroPageContents,
|
||||||
PAGE_SIZE);
|
PAGE_SIZE);
|
||||||
|
@ -476,6 +492,7 @@ TestPhysicalMemorySection(VOID)
|
||||||
ok_eq_hex(Status, STATUS_SUCCESS);
|
ok_eq_hex(Status, STATUS_SUCCESS);
|
||||||
if (!skip(NT_SUCCESS(Status), "No view\n"))
|
if (!skip(NT_SUCCESS(Status), "No view\n"))
|
||||||
{
|
{
|
||||||
|
ok((LONG_PTR)Mapping > 0, "Mapping = %p\n", Mapping);
|
||||||
EqualBytes = RtlCompareMemory(Mapping,
|
EqualBytes = RtlCompareMemory(Mapping,
|
||||||
ZeroPageContents,
|
ZeroPageContents,
|
||||||
PAGE_SIZE);
|
PAGE_SIZE);
|
||||||
|
@ -500,6 +517,7 @@ TestPhysicalMemorySection(VOID)
|
||||||
ok_eq_hex(Status, STATUS_SUCCESS);
|
ok_eq_hex(Status, STATUS_SUCCESS);
|
||||||
if (!skip(NT_SUCCESS(Status), "No view\n"))
|
if (!skip(NT_SUCCESS(Status), "No view\n"))
|
||||||
{
|
{
|
||||||
|
ok((LONG_PTR)Mapping > 0, "Mapping = %p\n", Mapping);
|
||||||
EqualBytes = RtlCompareMemory(Mapping,
|
EqualBytes = RtlCompareMemory(Mapping,
|
||||||
MyPage,
|
MyPage,
|
||||||
PAGE_SIZE);
|
PAGE_SIZE);
|
||||||
|
|
Loading…
Reference in a new issue