mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 01:24:38 +00:00
don't count references for the default quota block and fixed warnings
svn path=/trunk/; revision=16947
This commit is contained in:
parent
f4ff4e648a
commit
1ae15efc80
1 changed files with 13 additions and 12 deletions
|
@ -19,17 +19,18 @@ VOID
|
|||
STDCALL
|
||||
PspInheritQuota(PEPROCESS Process, PEPROCESS ParentProcess)
|
||||
{
|
||||
PEPROCESS_QUOTA_BLOCK QuotaBlock;
|
||||
|
||||
if (ParentProcess != NULL)
|
||||
QuotaBlock = ParentProcess->QuotaBlock;
|
||||
{
|
||||
PEPROCESS_QUOTA_BLOCK QuotaBlock = ParentProcess->QuotaBlock;
|
||||
|
||||
ASSERT(QuotaBlock != NULL);
|
||||
|
||||
InterlockedIncrementUL(&QuotaBlock->ReferenceCount);
|
||||
|
||||
Process->QuotaBlock = QuotaBlock;
|
||||
}
|
||||
else
|
||||
QuotaBlock = &PspDefaultQuotaBlock;
|
||||
|
||||
ASSERT(QuotaBlock != NULL);
|
||||
|
||||
InterlockedIncrement(&QuotaBlock->ReferenceCount);
|
||||
Process->QuotaBlock = QuotaBlock;
|
||||
Process->QuotaBlock = &PspDefaultQuotaBlock;
|
||||
}
|
||||
|
||||
VOID
|
||||
|
@ -38,10 +39,10 @@ PspDestroyQuotaBlock(PEPROCESS Process)
|
|||
{
|
||||
PEPROCESS_QUOTA_BLOCK QuotaBlock = Process->QuotaBlock;
|
||||
|
||||
if (InterlockedDecrement(&QuotaBlock->ReferenceCount) == 0)
|
||||
if (QuotaBlock != &PspDefaultQuotaBlock &&
|
||||
InterlockedDecrementUL(&QuotaBlock->ReferenceCount) == 0)
|
||||
{
|
||||
if (QuotaBlock != &PspDefaultQuotaBlock)
|
||||
ExFreePool(QuotaBlock);
|
||||
ExFreePool(QuotaBlock);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue