MmMapLockedPagesSpecifyCache: MmCached vs. MmNonCached

Hello,

In one of the IOCTLs handled in the driver I’m calling to MmMapLockedPagesSpecifyCache
The goal is to map a contiguous buffer pre allocated by WdfDmaEnablerCreate, WdfCommonBufferCreate to the application.

Currently I’m using MmCached.
Can you please tell in what case I should use MmNonCached ?

From what I know, in case of MmCached, the cache is always coherent. Am I right ?

Thank you,
Zvika

Put simply, you should never use MmNonCached. If you have memory that resides on a device (as opposed to system RAM), then there are situations where you have to think about it.

Thank you very much Tim.