mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 00:13:04 +00:00
[WDF] Add Windows Driver Framework files
Takern from Microsoft GitHub repo:
d9c6040fe9
Licensed under MIT
This commit is contained in:
parent
545df81502
commit
8a978a179f
475 changed files with 285099 additions and 0 deletions
107
sdk/lib/drivers/wdf/shared/inc/private/common/fxstump.hpp
Normal file
107
sdk/lib/drivers/wdf/shared/inc/private/common/fxstump.hpp
Normal 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_
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue