- Fix ExAllocateFromZone. I understand it's deprecated, but it having a broken implementation which can't work at all because the one who coded this function failed to understand basic algorithms of linked lists is nonsense.

svn path=/trunk/; revision=59494
This commit is contained in:
Aleksey Bragin 2013-07-16 19:57:12 +00:00
parent 30d0129f75
commit ee87f2a4f6
2 changed files with 4 additions and 2 deletions

View file

@ -3350,9 +3350,10 @@ static __inline PVOID
ExAllocateFromZone(
IN PZONE_HEADER Zone)
{
PVOID Result = (PVOID)Zone->FreeList.Next;
if (Zone->FreeList.Next)
Zone->FreeList.Next = Zone->FreeList.Next->Next;
return (PVOID) Zone->FreeList.Next;
return Result;
}
static __inline PVOID

View file

@ -276,9 +276,10 @@ static __inline PVOID
ExAllocateFromZone(
IN PZONE_HEADER Zone)
{
PVOID Result = (PVOID)Zone->FreeList.Next;
if (Zone->FreeList.Next)
Zone->FreeList.Next = Zone->FreeList.Next->Next;
return (PVOID) Zone->FreeList.Next;
return Result;
}
static __inline PVOID