+
+/**
+ * MmMapLockedPagesSpecifyCache:
+ * @Mdl: Pointer to the #MDL specification structure to map.
+ * %NULL value is forbidden.
+ * @AccessMode: Access at which to lock the pages. %KernelMode required by libcaptive.
+ * @CacheType: Suggested caching type. %MmNonCached, %MmCached or %MmWriteCombined required by libcaptive.
+ * @BaseAddress: Required block base address if @AccessMode is %UserMode. Ignored by libcaptive.
+ * @BugCheckOnFailure: Whether to call KeBugCheck() instead of returning %NULL. Ignored by libcaptive.
+ * @Priority: Suggested pages priority. %LowPagePriority, %NormalPagePriority or %HighPagePriority required by libcaptive.
+ *
+ * Leaves the pages at their original location as they are never moved anyway
+ * by libcaptive. This call is just a wrapper around MmMapLockedPages() in libcaptive.
+ *
+ * Returns: Address of the mapped pages base.
+ * This offset does not neet to be %PAGE_SIZE aligned.
+ */
+PVOID MmMapLockedPagesSpecifyCache(IN PMDL Mdl,
+ IN KPROCESSOR_MODE AccessMode,IN MEMORY_CACHING_TYPE CacheType,IN PVOID BaseAddress,
+ IN ULONG BugCheckOnFailure,IN MM_PAGE_PRIORITY Priority)
+{
+ g_return_val_if_fail(Mdl!=NULL,NULL);
+ g_return_val_if_fail(AccessMode==KernelMode /* || AccessMode==UserMode */ ,NULL);
+ g_return_val_if_fail(0
+ || CacheType==MmNonCached
+ || CacheType==MmCached
+ || CacheType==MmWriteCombined,
+ NULL);
+ g_return_val_if_fail(0
+ || Priority==LowPagePriority
+ || Priority==NormalPagePriority
+ || Priority==HighPagePriority,
+ NULL);
+
+ return MmMapLockedPages(Mdl,AccessMode);
+}