25#include "fxsupportpch.hpp"
88 oldUnlockValue = *UnlockWhenFreed;
102 *UnlockWhenFreed =
FALSE;
120 if (
u.Memory.Offsets !=
NULL) {
122 u.Memory.Offsets->BufferOffset);
125 pBuf =
u.Memory.Memory->GetBuffer();
132 pBuf =
u.Buffer.Buffer;
148 "Couldn't allocate memory for MDL of length 0x%x %!STATUS!",
length,
status);
156 if (ReuseMdl ==
TRUE) {
165 "Couldn't lock pages for MDL 0x%p %!STATUS!", *
Mdl,
status);
170 if (ReuseMdl ==
FALSE) {
178 *UnlockWhenFreed =
TRUE;
192 if (
u.RefMdl.Offsets ==
NULL ||
193 (
u.RefMdl.Offsets->BufferOffset == 0 &&
u.RefMdl.Offsets->BufferLength == 0)) {
230 "Couldn't allocate memory for MDL of length 0x%x %!STATUS!",
length,
status);
static ULONG SizeOfMdl(VOID)
static __inline VOID MxBuildPartialMdl(_In_ PMDL SourceMdl, _Inout_ PMDL TargetMdl, _In_ PVOID VirtualAddress, _In_ ULONG Length)
static __inline PVOID MxGetMdlVirtualAddress(_In_ PMDL Mdl)
static __inline VOID MxInitializeMdl(_In_ PMDL MemoryDescriptorList, _In_ PVOID BaseVa, _In_ SIZE_T Length)
#define NT_SUCCESS(StatCode)
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
VOID __inline FxMdlFree(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PMDL Mdl)
NTSTATUS FxProbeAndLockWithAccess(__in PMDL Mdl, __in KPROCESSOR_MODE AccessMode, __in LOCK_OPERATION Operation)
@ FxRequestBufferUnspecified
@ FxRequestBufferReferencedMdl
GLuint GLsizei GLsizei * length
#define _Must_inspect_result_
#define TRACE_LEVEL_ERROR
ULONG GetBufferLength(VOID)
VOID SetMemory(__in IFxMemory *Memory, __in PWDFMEMORY_OFFSET Offsets)
NTSTATUS GetOrAllocateMdlWorker(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __deref_out PMDL *Mdl, __in BOOLEAN *ReuseMdl, __in LONG Length, __in PVOID Buffer, __inout size_t *SizeOfMdl, __in BOOLEAN UnlockWhenFreed, __deref_out_opt PMDL *MdlToFree)
PWDFMEMORY_OFFSET Offsets
union FxRequestBuffer::@4813 u
_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)
#define STATUS_INVALID_PARAMETER
#define WDF_PTR_ADD_OFFSET(_ptr, _offset)
_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
enum _LOCK_OPERATION LOCK_OPERATION