mirror of
https://github.com/reactos/reactos.git
synced 2024-08-08 04:08:29 +00:00
fix handle table calculations
now we can create 4186000 handles instead of 4100 and VLC doesn't BSOD anymore svn path=/trunk/; revision=34466
This commit is contained in:
parent
ba77ba4484
commit
538c89cbf6
|
@ -209,11 +209,18 @@ ExpFreeHandleTable(IN PHANDLE_TABLE HandleTable)
|
|||
{
|
||||
PEPROCESS Process = HandleTable->QuotaProcess;
|
||||
ULONG i, j;
|
||||
ULONG TableLevel = (ULONG)(HandleTable->TableCode & 3);
|
||||
ULONG_PTR TableBase = HandleTable->TableCode & ~3;
|
||||
ULONG TableLevel;
|
||||
ULONG_PTR TableBase;
|
||||
PHANDLE_TABLE_ENTRY Level1, *Level2, **Level3;
|
||||
PAGED_CODE();
|
||||
|
||||
/* Get the table code */
|
||||
TableBase = *(volatile ULONG_PTR*)&HandleTable->TableCode;
|
||||
|
||||
/* Extract the table level and actual table base */
|
||||
TableLevel = (ULONG)(TableBase & 3);
|
||||
TableBase = TableBase - TableLevel;
|
||||
|
||||
/* Check which level we're at */
|
||||
if (!TableLevel)
|
||||
{
|
||||
|
@ -497,10 +504,17 @@ ExpAllocateHandleTableEntrySlow(IN PHANDLE_TABLE HandleTable,
|
|||
PHANDLE_TABLE_ENTRY Low = NULL, *Mid, **High, *SecondLevel, **ThirdLevel;
|
||||
ULONG NewFree, FirstFree;
|
||||
PVOID Value;
|
||||
ULONG_PTR TableBase = HandleTable->TableCode & ~3;
|
||||
ULONG TableLevel = (ULONG)(TableBase & 3);
|
||||
ULONG_PTR TableBase;
|
||||
ULONG TableLevel;
|
||||
PAGED_CODE();
|
||||
|
||||
/* Get the table code */
|
||||
TableBase = *(volatile ULONG_PTR*)&HandleTable->TableCode;
|
||||
|
||||
/* Extract the table level and actual table base */
|
||||
TableLevel = (ULONG)(TableBase & 3);
|
||||
TableBase = TableBase - TableLevel;
|
||||
|
||||
/* Check how many levels we already have */
|
||||
if (!TableLevel)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue