mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 01:15:09 +00:00
[KMTESTS:MM]
MmAllocatePagesForMdlEx() was added on Windows 2003 SP1. Import it for "older" systems. svn path=/trunk/; revision=69318
This commit is contained in:
parent
bff3154159
commit
49b29b7594
1 changed files with 38 additions and 18 deletions
|
@ -30,6 +30,19 @@ _MiAddressToPte(PVOID Address)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static
|
||||||
|
_Must_inspect_result_
|
||||||
|
_IRQL_requires_max_ (DISPATCH_LEVEL)
|
||||||
|
PMDL
|
||||||
|
(NTAPI
|
||||||
|
*pMmAllocatePagesForMdlEx)(
|
||||||
|
_In_ PHYSICAL_ADDRESS LowAddress,
|
||||||
|
_In_ PHYSICAL_ADDRESS HighAddress,
|
||||||
|
_In_ PHYSICAL_ADDRESS SkipBytes,
|
||||||
|
_In_ SIZE_T TotalBytes,
|
||||||
|
_In_ MEMORY_CACHING_TYPE CacheType,
|
||||||
|
_In_ ULONG Flags);
|
||||||
|
|
||||||
static
|
static
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
ValidateMapping(
|
ValidateMapping(
|
||||||
|
@ -84,11 +97,16 @@ TestMap(
|
||||||
PPFN_NUMBER MdlPages;
|
PPFN_NUMBER MdlPages;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
|
||||||
|
if (skip(pMmAllocatePagesForMdlEx != NULL, "MmAllocatePagesForMdlEx unavailable\n"))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ZeroPhysical.QuadPart = 0;
|
ZeroPhysical.QuadPart = 0;
|
||||||
MaxPhysical.QuadPart = 0xffffffffffffffffLL;
|
MaxPhysical.QuadPart = 0xffffffffffffffffLL;
|
||||||
|
|
||||||
/* Create a one-page MDL and map it */
|
/* Create a one-page MDL and map it */
|
||||||
Mdl = MmAllocatePagesForMdlEx(ZeroPhysical,
|
Mdl = pMmAllocatePagesForMdlEx(ZeroPhysical,
|
||||||
MaxPhysical,
|
MaxPhysical,
|
||||||
ZeroPhysical,
|
ZeroPhysical,
|
||||||
PAGE_SIZE,
|
PAGE_SIZE,
|
||||||
|
@ -153,7 +171,7 @@ TestMap(
|
||||||
MmFreePagesFromMdl(Mdl);
|
MmFreePagesFromMdl(Mdl);
|
||||||
|
|
||||||
/* Map all pages */
|
/* Map all pages */
|
||||||
Mdl = MmAllocatePagesForMdlEx(ZeroPhysical,
|
Mdl = pMmAllocatePagesForMdlEx(ZeroPhysical,
|
||||||
MaxPhysical,
|
MaxPhysical,
|
||||||
ZeroPhysical,
|
ZeroPhysical,
|
||||||
TotalPtes * PAGE_SIZE,
|
TotalPtes * PAGE_SIZE,
|
||||||
|
@ -196,7 +214,7 @@ TestMap(
|
||||||
MmFreePagesFromMdl(Mdl);
|
MmFreePagesFromMdl(Mdl);
|
||||||
|
|
||||||
/* Try to map more pages than we reserved */
|
/* Try to map more pages than we reserved */
|
||||||
Mdl = MmAllocatePagesForMdlEx(ZeroPhysical,
|
Mdl = pMmAllocatePagesForMdlEx(ZeroPhysical,
|
||||||
MaxPhysical,
|
MaxPhysical,
|
||||||
ZeroPhysical,
|
ZeroPhysical,
|
||||||
(TotalPtes + 1) * PAGE_SIZE,
|
(TotalPtes + 1) * PAGE_SIZE,
|
||||||
|
@ -226,6 +244,8 @@ START_TEST(MmReservedMapping)
|
||||||
{
|
{
|
||||||
PVOID Mapping;
|
PVOID Mapping;
|
||||||
|
|
||||||
|
pMmAllocatePagesForMdlEx = KmtGetSystemRoutineAddress(L"MmAllocatePagesForMdlEx");
|
||||||
|
|
||||||
/* one byte - single page */
|
/* one byte - single page */
|
||||||
Mapping = MmAllocateMappingAddress(1, 'MRmK');
|
Mapping = MmAllocateMappingAddress(1, 'MRmK');
|
||||||
ok(Mapping != NULL, "MmAllocateMappingAddress failed\n");
|
ok(Mapping != NULL, "MmAllocateMappingAddress failed\n");
|
||||||
|
|
Loading…
Reference in a new issue