mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 11:21:51 +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
91
sdk/lib/drivers/wdf/shared/inc/private/common/fxmdl.h
Normal file
91
sdk/lib/drivers/wdf/shared/inc/private/common/fxmdl.h
Normal file
|
@ -0,0 +1,91 @@
|
|||
//
|
||||
// Copyright (C) Microsoft. All rights reserved.
|
||||
//
|
||||
#ifndef __FXMDL_H__
|
||||
#define __FXMDL_H__
|
||||
|
||||
PMDL
|
||||
FxMdlAllocateDebug(
|
||||
__in PFX_DRIVER_GLOBALS FxDriverGlobals,
|
||||
__in FxObject* Owner,
|
||||
__in PVOID VirtualAddress,
|
||||
__in ULONG Length,
|
||||
__in BOOLEAN SecondaryBuffer,
|
||||
__in BOOLEAN ChargeQuota,
|
||||
__in PVOID CallersAddress
|
||||
);
|
||||
|
||||
VOID
|
||||
FxMdlFreeDebug(
|
||||
__in PFX_DRIVER_GLOBALS FxDriverGlobals,
|
||||
__in PMDL Mdl
|
||||
);
|
||||
|
||||
VOID
|
||||
FxMdlDump(
|
||||
__in PFX_DRIVER_GLOBALS FxDriverGlobals
|
||||
);
|
||||
|
||||
PMDL
|
||||
FORCEINLINE
|
||||
FxMdlAllocate(
|
||||
__in PFX_DRIVER_GLOBALS FxDriverGlobals,
|
||||
__in FxObject* Owner,
|
||||
__in PVOID VirtualAddress,
|
||||
__in ULONG Length,
|
||||
__in BOOLEAN SecondaryBuffer,
|
||||
__in BOOLEAN ChargeQuota
|
||||
)
|
||||
{
|
||||
if (FxDriverGlobals->FxVerifierOn) {
|
||||
return FxMdlAllocateDebug(FxDriverGlobals,
|
||||
Owner,
|
||||
VirtualAddress,
|
||||
Length,
|
||||
SecondaryBuffer,
|
||||
ChargeQuota,
|
||||
_ReturnAddress());
|
||||
}
|
||||
else {
|
||||
return IoAllocateMdl(VirtualAddress,
|
||||
Length,
|
||||
SecondaryBuffer,
|
||||
ChargeQuota,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
__inline
|
||||
FxMdlFree(
|
||||
__in PFX_DRIVER_GLOBALS FxDriverGlobals,
|
||||
__in PMDL Mdl
|
||||
)
|
||||
{
|
||||
if (FxDriverGlobals->FxVerifierOn) {
|
||||
FxMdlFreeDebug(FxDriverGlobals, Mdl);
|
||||
}
|
||||
else {
|
||||
IoFreeMdl(Mdl);
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
__inline
|
||||
FxIrpMdlFree(
|
||||
__in PMDL Mdl
|
||||
)
|
||||
{
|
||||
IoFreeMdl(Mdl);
|
||||
}
|
||||
|
||||
// Do not allow accidental usage by redefining these DDIs to uncompilable names.
|
||||
// Do this after we define our own functions so that our own functions use
|
||||
// the correct DDI.
|
||||
#undef IoAllocateMdl
|
||||
#undef IoFreeMdl
|
||||
|
||||
#define IoAllocateMdl use_FxMdlAllocate_instead
|
||||
#define IoFreeMdl use_FxMdlFree_instead
|
||||
|
||||
#endif __FXMDL_H__
|
Loading…
Add table
Add a link
Reference in a new issue