mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 17:44:45 +00:00
add some asserts
svn path=/trunk/; revision=14498
This commit is contained in:
parent
13027a8afa
commit
f165c00432
1 changed files with 12 additions and 9 deletions
|
@ -4,7 +4,7 @@
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: ntoskrnl/io/mdl.c
|
* FILE: ntoskrnl/io/mdl.c
|
||||||
* PURPOSE: Io manager mdl functions
|
* PURPOSE: Io manager mdl functions
|
||||||
*
|
*
|
||||||
* PROGRAMMERS: David Welch (welch@mcmail.com)
|
* PROGRAMMERS: David Welch (welch@mcmail.com)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ IoAllocateMdl(PVOID VirtualAddress,
|
||||||
PIRP Irp)
|
PIRP Irp)
|
||||||
{
|
{
|
||||||
PMDL Mdl;
|
PMDL Mdl;
|
||||||
|
|
||||||
if (ChargeQuota)
|
if (ChargeQuota)
|
||||||
{
|
{
|
||||||
// Mdl = ExAllocatePoolWithQuota(NonPagedPool,
|
// Mdl = ExAllocatePoolWithQuota(NonPagedPool,
|
||||||
|
@ -48,27 +48,27 @@ IoAllocateMdl(PVOID VirtualAddress,
|
||||||
TAG_MDL);
|
TAG_MDL);
|
||||||
}
|
}
|
||||||
MmInitializeMdl(Mdl, (char*)VirtualAddress, Length);
|
MmInitializeMdl(Mdl, (char*)VirtualAddress, Length);
|
||||||
|
|
||||||
if (Irp)
|
if (Irp)
|
||||||
{
|
{
|
||||||
if (SecondaryBuffer)
|
if (SecondaryBuffer)
|
||||||
{
|
{
|
||||||
ASSERT(Irp->MdlAddress);
|
ASSERT(Irp->MdlAddress);
|
||||||
|
|
||||||
/* FIXME: add to end of list maybe?? */
|
/* FIXME: add to end of list maybe?? */
|
||||||
Mdl->Next = Irp->MdlAddress->Next;
|
Mdl->Next = Irp->MdlAddress->Next;
|
||||||
Irp->MdlAddress->Next = Mdl;
|
Irp->MdlAddress->Next = Mdl;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* What if there's allready an mdl at Irp->MdlAddress?
|
* What if there's allready an mdl at Irp->MdlAddress?
|
||||||
* Is that bad and should we do something about it?
|
* Is that bad and should we do something about it?
|
||||||
*/
|
*/
|
||||||
Irp->MdlAddress = Mdl;
|
Irp->MdlAddress = Mdl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return(Mdl);
|
return(Mdl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,13 +122,16 @@ IoBuildPartialMdl(PMDL SourceMdl,
|
||||||
*/
|
*/
|
||||||
VOID STDCALL
|
VOID STDCALL
|
||||||
IoFreeMdl(PMDL Mdl)
|
IoFreeMdl(PMDL Mdl)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* This unmaps partial mdl's from kernel space but also asserts that non-partial
|
* This unmaps partial mdl's from kernel space but also asserts that non-partial
|
||||||
* mdl's isn't still mapped into kernel space.
|
* mdl's isn't still mapped into kernel space.
|
||||||
*/
|
*/
|
||||||
|
ASSERT(Mdl);
|
||||||
|
ASSERT_IRQL(DISPATCH_LEVEL);
|
||||||
|
|
||||||
MmPrepareMdlForReuse(Mdl);
|
MmPrepareMdlForReuse(Mdl);
|
||||||
|
|
||||||
ExFreePool(Mdl);
|
ExFreePool(Mdl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue