ReactOS 0.4.15-dev-7994-gb388cb6
fxrequestbufferum.cpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft. All rights reserved.
4
5Module Name:
6
7 FxRequestBufferUm.cpp
8
9Abstract:
10
11 This module implements a memory union object
12
13Author:
14
15
16
17Environment:
18
19 User mode only
20
21Revision History:
22
23--*/
24
25#include "FxSupportPch.hpp"
26
27extern "C" {
28#include "FxRequestBufferUm.tmh"
29}
30
34 __in PFX_DRIVER_GLOBALS FxDriverGlobals,
36 __inout PMDL* MdlToFree,
37 __inout PBOOLEAN UnlockWhenFreed,
39 __in BOOLEAN ReuseMdl,
41 )
42/*++
43
44Routine Description:
45
46 This function attempts to reuse the passed-in MDL (if any) or allocates
47 a new MDL if reuse flag isn't passed-in or if the existing MDL isn't
48 big enough.
49
50Arguments:
51
52Return Value:
53 FxDriverGlobals - Driver globals
54
55 Mdl - on return it contains the MDL allocated/reused
56
57 MdlToFree - pointer to any MDL
58 * to be reused, if the size is <= current size, or
59 * freed and set to newly allocated MDL
60
61 UnlockWhenFreed - whether to unlock pages when freeing MDL
62 (if FALSE, MDL may represent just MDL buffer but the pages
63 might have already been unlocked)
64
65 Operation - Operation to pass to MmLockPages
66
67 ReuseMdl - whether to reuse *MdlToFree
68 Please note that this can be FALSE even when MDL is supplied
69
70 SizeOfMdl - on input contains size of *MdlToFree,
71 on return contains size of *Mdl
72
73Remarks:
74
75 *MdlToFree is modified only when this function frees the passed in MDL
76 Otherwise it leaves it untouched. Caller is responsible for storing
77 properly initialized value and/or freeing what's stored in the value.
78
79 --*/
80{
81 UNREFERENCED_PARAMETER(FxDriverGlobals);
83 UNREFERENCED_PARAMETER(MdlToFree);
84 UNREFERENCED_PARAMETER(UnlockWhenFreed);
86 UNREFERENCED_PARAMETER(ReuseMdl);
88
91}
92
93VOID
97 )
98{
100 u.Memory.Memory = Memory;
101 u.Memory.Offsets = Offsets;
102}
103
static ULONG SizeOfMdl(VOID)
Definition: NtReadFile.c:36
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#define __inout_opt
Definition: dbghelp.h:53
#define __in
Definition: dbghelp.h:35
#define __inout
Definition: dbghelp.h:50
#define __deref_out_opt
Definition: dbghelp.h:29
FP_OP Operation
Definition: fpcontrol.c:150
@ FxRequestBufferMemory
#define _Must_inspect_result_
Definition: ms_sal.h:558
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239
DataType
Definition: simd.h:252
VOID SetMemory(__in IFxMemory *Memory, __in PWDFMEMORY_OFFSET Offsets)
union FxRequestBuffer::@4815 u
PWDFMEMORY_OFFSET Offsets
_Must_inspect_result_ NTSTATUS GetOrAllocateMdl(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __deref_out_opt PMDL *Mdl, __inout PMDL *MdlToFree, __inout PBOOLEAN UnlockWhenFreed, __in LOCK_OPERATION Operation, __in BOOLEAN ReuseMdl=FALSE, __inout_opt size_t *SizeOfMdl=NULL)
unsigned char * PBOOLEAN
Definition: typedefs.h:53
VOID UfxVerifierTrapNotImpl()
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG _In_ _Out_ WDFMEMORY * Memory
Definition: wdfmemory.h:169
enum _LOCK_OPERATION LOCK_OPERATION