Add delete operator

Based on a patch by Sandy Stutsman <sstutsma@redhat.com>

Signed-off-by: Javier Celaya <javier.celaya@flexvdi.com>
Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
Sameeh Jubran 2016-08-09 15:22:26 +03:00 committed by Frediano Ziglio
parent f7298659ce
commit aa48200e49
2 changed files with 12 additions and 0 deletions

View File

@ -70,3 +70,14 @@ void __cdecl operator delete[](void* pObject)
ExFreePool(pObject); ExFreePool(pObject);
} }
} }
void __cdecl operator delete(void *pObject, size_t s)
{
PAGED_CODE();
UNREFERENCED_PARAMETER(s);
if (pObject != NULL) {
ExFreePool(pObject);
}
}

View File

@ -56,4 +56,5 @@ _When_((PoolType & NonPagedPoolMustSucceed) != 0,
"Allocation failures cause a system crash")) "Allocation failures cause a system crash"))
void* __cdecl operator new[](size_t Size, POOL_TYPE PoolType = PagedPool); void* __cdecl operator new[](size_t Size, POOL_TYPE PoolType = PagedPool);
void __cdecl operator delete(void* pObject); void __cdecl operator delete(void* pObject);
void __cdecl operator delete(void *pObject, size_t s);
void __cdecl operator delete[](void* pObject); void __cdecl operator delete[](void* pObject);