ReactOS  0.4.15-dev-2947-g59e1b78
fxmdl.h
Go to the documentation of this file.
1 //
2 // Copyright (C) Microsoft. All rights reserved.
3 //
4 #ifndef __FXMDL_H__
5 #define __FXMDL_H__
6 
7 PMDL
9  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
15  __in PVOID CallersAddress
16  );
17 
18 VOID
20  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
21  __in PMDL Mdl
22  );
23 
24 VOID
25 FxMdlDump(
26  __in PFX_DRIVER_GLOBALS FxDriverGlobals
27  );
28 
29 PMDL
32  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
38  )
39 {
40  if (FxDriverGlobals->FxVerifierOn) {
41  return FxMdlAllocateDebug(FxDriverGlobals,
42  Owner,
44  Length,
47  _ReturnAddress());
48  }
49  else {
51  Length,
54  NULL);
55  }
56 }
57 
58 VOID
59 __inline
61  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
62  __in PMDL Mdl
63  )
64 {
65  if (FxDriverGlobals->FxVerifierOn) {
66  FxMdlFreeDebug(FxDriverGlobals, Mdl);
67  }
68  else {
69  IoFreeMdl(Mdl);
70  }
71 }
72 
73 VOID
74 __inline
76  __in PMDL Mdl
77  )
78 {
79  IoFreeMdl(Mdl);
80 }
81 
82 // Do not allow accidental usage by redefining these DDIs to uncompilable names.
83 // Do this after we define our own functions so that our own functions use
84 // the correct DDI.
85 #undef IoAllocateMdl
86 #undef IoFreeMdl
87 
88 #define IoAllocateMdl use_FxMdlAllocate_instead
89 #define IoFreeMdl use_FxMdlFree_instead
90 
91 #endif // __FXMDL_H__
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
_Must_inspect_result_ _In_ BOOLEAN ChargeQuota
Definition: iofuncs.h:651
VOID FxMdlDump(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: wdfpoolkm.cpp:239
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)
Definition: wdfpoolkm.cpp:81
#define IoAllocateMdl
Definition: fxmdl.h:88
unsigned char BOOLEAN
_Must_inspect_result_ _In_ WDFDMATRANSACTION _In_ PFN_WDF_PROGRAM_DMA _In_ WDF_DMA_DIRECTION _In_ PMDL _In_ PVOID VirtualAddress
#define IoFreeMdl
Definition: fxmdl.h:89
VOID __inline FxIrpMdlFree(__in PMDL Mdl)
Definition: fxmdl.h:75
VOID __inline FxMdlFree(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PMDL Mdl)
Definition: fxmdl.h:60
_In_ ULONG _In_ BOOLEAN SecondaryBuffer
Definition: iofuncs.h:659
#define FORCEINLINE
Definition: wdftypes.h:67
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ SaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ OwnerSize PSID Owner
Definition: rtlfuncs.h:1556
#define NULL
Definition: types.h:112
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
void * _ReturnAddress(void)
unsigned int ULONG
Definition: retypes.h:1
PMDL FORCEINLINE FxMdlAllocate(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObject *Owner, __in PVOID VirtualAddress, __in ULONG Length, __in BOOLEAN SecondaryBuffer, __in BOOLEAN ChargeQuota)
Definition: fxmdl.h:31
VOID FxMdlFreeDebug(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PMDL Mdl)
Definition: wdfpoolkm.cpp:167
#define __in
Definition: dbghelp.h:35