Author: fireball
Date: Tue Sep 23 15:44:31 2008
New Revision: 36439
URL:
http://svn.reactos.org/svn/reactos?rev=36439&view=rev
Log:
- Fix ~4.4 million handle limit bug due to memory corruption. ReactOS can now create 16
million handles as expected (thanks Alex).
Modified:
trunk/reactos/ntoskrnl/ex/handle.c
Modified: trunk/reactos/ntoskrnl/ex/handle.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/handle.c?rev=3…
==============================================================================
--- trunk/reactos/ntoskrnl/ex/handle.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ex/handle.c [iso-8859-1] Tue Sep 23 15:44:31 2008
@@ -268,8 +268,7 @@
/* Free the third level table */
ExpFreeTablePagedPool(Process,
Level3,
- HIGH_LEVEL_ENTRIES *
- sizeof(PHANDLE_TABLE_ENTRY));
+ SizeOfHandle(HIGH_LEVEL_ENTRIES));
}
/* Free the actual table and check if we need to release quota */
@@ -540,7 +539,7 @@
{
/* We need a new high level table */
High = ExpAllocateTablePagedPool(HandleTable->QuotaProcess,
- HIGH_LEVEL_ENTRIES);
+ SizeOfHandle(HIGH_LEVEL_ENTRIES));
if (!High) return FALSE;
/* Allocate a new mid level table as well */
@@ -550,7 +549,7 @@
/* We failed, free the high level table as welll */
ExpFreeTablePagedPool(HandleTable->QuotaProcess,
High,
- HIGH_LEVEL_ENTRIES);
+ SizeOfHandle(HIGH_LEVEL_ENTRIES));
return FALSE;
}