56 "A NULL Descriptor is not allowed");
73 "A NULL Buffer is not allowed");
77 else if (
Descriptor->u.BufferType.Length != 0) {
80 "Buffer is NULL, but a length (0x%x) is specified",
98 "A NULL MDL is not allowed");
102 else if (
Descriptor->u.MdlType.BufferLength != 0) {
105 "MDL is NULL, but a length (0x%x) is specified",
125 "A NULL WDFMEMORY handle is not allowed");
141 "Memory offset values are not valid %!STATUS!",
status);
168 if (
u.Memory.Offsets ==
NULL ||
169 (
u.Memory.Offsets->BufferOffset == 0 &&
u.Memory.Offsets->BufferLength == 0)) {
170 return (
ULONG)
u.Memory.Memory->GetBufferSize();
177 if (
u.Memory.Offsets->BufferLength == 0) {
178 return ((
ULONG)
u.RefMdl.Memory->GetBufferSize() - (
ULONG)
u.RefMdl.Offsets->BufferOffset);
181 return (
ULONG)
u.Memory.Offsets->BufferLength;
194 if (
u.RefMdl.Offsets ==
NULL ||
195 (
u.RefMdl.Offsets->BufferOffset == 0 &&
u.RefMdl.Offsets->BufferLength == 0)) {
196 return (
ULONG)
u.RefMdl.Memory->GetBufferSize();
203 if (
u.RefMdl.Offsets->BufferLength == 0) {
204 return ((
ULONG)
u.RefMdl.Memory->GetBufferSize() - (
ULONG)
u.RefMdl.Offsets->BufferOffset);
207 return (
ULONG)
u.RefMdl.Offsets->BufferLength;
212 return u.Buffer.Length;
231 if (
u.Memory.Offsets !=
NULL) {
233 u.Memory.Offsets->BufferOffset);
236 *
Buffer =
u.Memory.Memory->GetBuffer();
256 if (
u.RefMdl.Offsets !=
NULL) {
258 u.RefMdl.Offsets->BufferOffset);
286 if (PPBuffer ==
NULL) {
295 pBuffer =
u.Memory.Memory->GetBuffer();
298 if (
u.Memory.Offsets !=
NULL) {
299 if (
u.Memory.Offsets->BufferLength > 0) {
302 if (
u.Memory.Offsets->BufferOffset > 0) {
319 *PPBuffer =
u.Buffer.Buffer;
324 *PPMdl =
u.RefMdl.Mdl;
326 if (
u.RefMdl.Offsets !=
NULL &&
u.RefMdl.Offsets->BufferLength > 0) {
_Must_inspect_result_ NTSTATUS ValidateMemoryOffsets(__in_opt PWDFMEMORY_OFFSET Offsets)
static __inline PVOID MxGetSystemAddressForMdlSafe(__inout PMDL Mdl, __in ULONG Priority)
#define NT_SUCCESS(StatCode)
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
FxObjectHandleGetPtr(GetFxDriverGlobals(DriverGlobals), Fdo, FX_TYPE_DEVICE,(PVOID *)&pFdo)
@ MemoryDescriptorNullAllowed
@ MemoryDescriptorNoBufferAllowed
@ FxRequestBufferUnspecified
@ FxRequestBufferReferencedMdl
#define _Must_inspect_result_
#define TRACE_LEVEL_ERROR
ULONG GetBufferLength(VOID)
VOID SetMemory(__in IFxMemory *Memory, __in PWDFMEMORY_OFFSET Offsets)
VOID AssignValues(__deref_out_opt PVOID *PPBuffer, __deref_out_opt PMDL *PPMdl, __out PULONG BufferLength)
VOID SetMdl(__in PMDL Mdl, __in ULONG Length)
_Must_inspect_result_ NTSTATUS GetBuffer(__deref_out PVOID *Buffer)
union FxRequestBuffer::@4813 u
NTSTATUS ValidateMemoryDescriptor(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_MEMORY_DESCRIPTOR Descriptor, __in ULONG Flags=0x0)
__inline VOID SetBuffer(__in PVOID Buffer, __in ULONG Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_INVALID_PARAMETER
#define STATUS_INSUFFICIENT_RESOURCES
#define WDF_PTR_ADD_OFFSET(_ptr, _offset)
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
@ WdfMemoryDescriptorTypeBuffer
@ WdfMemoryDescriptorTypeHandle
@ WdfMemoryDescriptorTypeMdl
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
_Must_inspect_result_ _In_ ULONG Flags