mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 08:55:19 +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
|
||||
|
||||
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
|
||||
BOOLEAN
|
||||
ValidateMapping(
|
||||
|
@ -84,16 +97,21 @@ TestMap(
|
|||
PPFN_NUMBER MdlPages;
|
||||
ULONG i;
|
||||
|
||||
if (skip(pMmAllocatePagesForMdlEx != NULL, "MmAllocatePagesForMdlEx unavailable\n"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ZeroPhysical.QuadPart = 0;
|
||||
MaxPhysical.QuadPart = 0xffffffffffffffffLL;
|
||||
|
||||
/* Create a one-page MDL and map it */
|
||||
Mdl = MmAllocatePagesForMdlEx(ZeroPhysical,
|
||||
MaxPhysical,
|
||||
ZeroPhysical,
|
||||
PAGE_SIZE,
|
||||
MmCached,
|
||||
0);
|
||||
Mdl = pMmAllocatePagesForMdlEx(ZeroPhysical,
|
||||
MaxPhysical,
|
||||
ZeroPhysical,
|
||||
PAGE_SIZE,
|
||||
MmCached,
|
||||
0);
|
||||
if (skip(Mdl != NULL, "No MDL\n"))
|
||||
{
|
||||
return;
|
||||
|
@ -153,12 +171,12 @@ TestMap(
|
|||
MmFreePagesFromMdl(Mdl);
|
||||
|
||||
/* Map all pages */
|
||||
Mdl = MmAllocatePagesForMdlEx(ZeroPhysical,
|
||||
MaxPhysical,
|
||||
ZeroPhysical,
|
||||
TotalPtes * PAGE_SIZE,
|
||||
MmCached,
|
||||
0);
|
||||
Mdl = pMmAllocatePagesForMdlEx(ZeroPhysical,
|
||||
MaxPhysical,
|
||||
ZeroPhysical,
|
||||
TotalPtes * PAGE_SIZE,
|
||||
MmCached,
|
||||
0);
|
||||
if (skip(Mdl != NULL, "No MDL\n"))
|
||||
{
|
||||
return;
|
||||
|
@ -196,12 +214,12 @@ TestMap(
|
|||
MmFreePagesFromMdl(Mdl);
|
||||
|
||||
/* Try to map more pages than we reserved */
|
||||
Mdl = MmAllocatePagesForMdlEx(ZeroPhysical,
|
||||
MaxPhysical,
|
||||
ZeroPhysical,
|
||||
(TotalPtes + 1) * PAGE_SIZE,
|
||||
MmCached,
|
||||
0);
|
||||
Mdl = pMmAllocatePagesForMdlEx(ZeroPhysical,
|
||||
MaxPhysical,
|
||||
ZeroPhysical,
|
||||
(TotalPtes + 1) * PAGE_SIZE,
|
||||
MmCached,
|
||||
0);
|
||||
if (skip(Mdl != NULL, "No MDL\n"))
|
||||
{
|
||||
return;
|
||||
|
@ -226,6 +244,8 @@ START_TEST(MmReservedMapping)
|
|||
{
|
||||
PVOID Mapping;
|
||||
|
||||
pMmAllocatePagesForMdlEx = KmtGetSystemRoutineAddress(L"MmAllocatePagesForMdlEx");
|
||||
|
||||
/* one byte - single page */
|
||||
Mapping = MmAllocateMappingAddress(1, 'MRmK');
|
||||
ok(Mapping != NULL, "MmAllocateMappingAddress failed\n");
|
||||
|
|
Loading…
Reference in a new issue