Author: fireball Date: Tue Jul 16 19:57:12 2013 New Revision: 59494
URL: http://svn.reactos.org/svn/reactos?rev=59494&view=rev Log: [DDK] - 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.
Modified: trunk/reactos/include/ddk/ntddk.h trunk/reactos/include/xdk/exfuncs.h
Modified: trunk/reactos/include/ddk/ntddk.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntddk.h?rev=594... ============================================================================== --- trunk/reactos/include/ddk/ntddk.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/ntddk.h [iso-8859-1] Tue Jul 16 19:57:12 2013 @@ -3350,9 +3350,10 @@ 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
Modified: trunk/reactos/include/xdk/exfuncs.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/exfuncs.h?rev=5... ============================================================================== --- trunk/reactos/include/xdk/exfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/exfuncs.h [iso-8859-1] Tue Jul 16 19:57:12 2013 @@ -276,9 +276,10 @@ 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