[WDF] Add Windows Driver Framework files

Takern from Microsoft GitHub repo:
d9c6040fe9

Licensed under MIT
This commit is contained in:
Victor Perevertkin 2020-09-24 23:51:15 +03:00
parent 545df81502
commit 8a978a179f
No known key found for this signature in database
GPG key ID: C750B7222E9C7830
475 changed files with 285099 additions and 0 deletions

View file

@ -0,0 +1,107 @@
/*++
Copyright (c) Microsoft Corporation
Module Name:
FxStump.hpp
Abstract:
Author:
Revision History:
--*/
#ifndef _FXSTUMP_HPP_
#define _FXSTUMP_HPP_
struct FxStump {
protected:
FxStump(
VOID
)
{
}
public:
PVOID
operator new(
__in size_t Size,
__in PFX_DRIVER_GLOBALS FxDriverGlobals
)
{
return FxPoolAllocate(FxDriverGlobals, NonPagedPool, Size);
}
PVOID
operator new(
__in size_t Size,
__in PFX_DRIVER_GLOBALS FxDriverGlobals,
__in POOL_TYPE PoolType
)
{
return FxPoolAllocate(FxDriverGlobals, PoolType, Size);
}
VOID
operator delete(
__in PVOID pointer
)
{
if (pointer) {
FxPoolFree(pointer);
}
}
#if (FX_CORE_MODE == FX_CORE_USER_MODE)
PVOID
operator new[](
__in size_t Size,
__in PFX_DRIVER_GLOBALS FxDriverGlobals
)
{
return FxPoolAllocate(FxDriverGlobals, NonPagedPool, Size);
}
VOID
operator delete[](
__in PVOID pointer
)
{
if (pointer) {
FxPoolFree(pointer);
}
}
#endif
};
struct FxGlobalsStump : public FxStump {
private:
PFX_DRIVER_GLOBALS m_Globals;
public:
FxGlobalsStump(
__in PFX_DRIVER_GLOBALS FxDriverGlobals
)
{
m_Globals = FxDriverGlobals;
}
PFX_DRIVER_GLOBALS
GetDriverGlobals(
VOID
)
{
return m_Globals;
}
};
#endif // _FXSTUMP_HPP_