Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

72 lines
1.5 KiB

#ifndef mynew_h
#define mynew_h
#ifndef _NEW_DELETE_OPERATORS_
#define _NEW_DELETE_OPERATORS_
/*****************************************************************************
* ::new()
*****************************************************************************
* New function for creating objects with a specified allocation tag.
*/
inline PVOID operator new
(
size_t iSize,
POOL_TYPE poolType
)
{
PVOID result = ExAllocatePoolWithTag(poolType,iSize,'3mrD');
if (result)
{
RtlZeroMemory(result,iSize);
}
return result;
}
/*****************************************************************************
* ::new()
*****************************************************************************
* New function for creating objects with a specified allocation tag.
*/
inline PVOID operator new
(
size_t iSize,
POOL_TYPE poolType,
ULONG tag
)
{
PVOID result = ExAllocatePoolWithTag(poolType,iSize,tag);
if (result)
{
RtlZeroMemory(result,iSize);
}
return result;
}
/*****************************************************************************
* ::delete()
*****************************************************************************
* Delete function.
*/
inline void __cdecl operator delete
(
PVOID pVoid
)
{
if (pVoid)
{
ExFreePool(pVoid);
}
}
#endif //!_NEW_DELETE_OPERATORS_
#endif