-
Notifications
You must be signed in to change notification settings - Fork 370
Open
Description
Windows-Driver-Frameworks/src/framework/kmdf/src/dma/base/fxdmatransactionbase.cpp
Line 924 in a94b8c3
| if ((transferLength + PAGE_SIZE) < (Length + pageOffset )) { |
To replicate, create a WDFDMAENABLER
#define COMMON_BUFFER_SIZE (4294967296-4096)
WDF_DMA_ENABLER_CONFIG_INIT(&dma, WdfDmaProfileScatterGather64Duplex, COMMON_BUFFER_SIZE);
dma.WdmDmaVersionOverride = 3;
dma.Flags = WDF_DMA_ENABLER_CONFIG_NO_SGLIST_PREALLOCATION;
status = WdfDmaEnablerCreate(device, &dma, WDF_NO_OBJECT_ATTRIBUTES, &context->Dma);
Use DmaRemappingCompatible as 1 in the .inf.
Create a DomainCommonBuffer:
dma = WdfDmaEnablerWdmGetDmaAdapter(context->Dma, WdfDmaDirectionReadFromDevice);
ops = dma->DmaOperations;
domain = ops->GetDmaDomain(dma);
type = MmCached;
status = ops->AllocateDomainCommonBuffer(dma, domain, NULL, COMMON_BUFFER_SIZE,
0, &type, MM_ANY_NODE_OK, &context->LA, &context->Ptr);
RtlZeroMemory(context->Ptr, COMMON_BUFFER_SIZE);
Create a MDL, pass it to WdfDmaTransactionInitialize
context->Mdl = IoAllocateMdl(NULL, COMMON_BUFFER_SIZE, FALSE, FALSE, NULL);
MmInitializeMdl(context->Mdl, context->Ptr, COMMON_BUFFER_SIZE);
MmBuildMdlForNonPagedPool(context->Mdl);
status = WdfDmaTransactionInitialize(transaction, ScatterGatherEntry,
WdfDmaDirectionReadFromDevice, context->Mdl, context->Ptr,
COMMON_BUFFER_SIZE);
The runtime code is STATUS_BUFFER_TOO_SMALL. The expected result is STATUS_SUCCESS.
Using #define COMMON_BUFFER_SIZE (4294967296-8192) works.
Metadata
Metadata
Assignees
Labels
No labels