[Bug 37355] Multiple software protection schemes need ntoskrnl ' MmMapLockedPagesSpecifyCache' implementation (Tages Protection v5.x, BattleEye's 'bedaisy.sys')

wine-bugs at winehq.org wine-bugs at winehq.org
Sat May 12 13:30:20 CDT 2018


https://bugs.winehq.org/show_bug.cgi?id=37355

--- Comment #16 from Anastasius Focht <focht at gmx.net> ---
Hello,

--- quote ---
Correct me if I am wrong, but the specific problem this issue is referring to
is still not STAGED.  While MmMapLockedPages and MmUnmapLockedPages are
implemented, MmMapLockedPagesSpecifyCache still is not implemented.
--- quote ---

it's the other way around: 

https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/ntoskrnl.exe/ntoskrnl.exe.spec#l697

--- snip ---
 697 @ stub MmMapLockedPages
 698 @ stdcall MmMapLockedPagesSpecifyCache(ptr long long ptr long long)
 699 @ stub MmMapLockedPagesWithReservedMapping
--- snip ---

https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/ntoskrnl.exe/ntoskrnl.c#l2188

--- snip ---
2188 /***********************************************************************
2189  *           MmMapLockedPagesSpecifyCache  (NTOSKRNL.EXE.@)
2190  */
2191 PVOID WINAPI  MmMapLockedPagesSpecifyCache(PMDLX MemoryDescriptorList,
KPROCESSOR_MODE AccessMode, MEMORY_CACHING_TYPE CacheType,
2192                                            PVOID BaseAddress, ULONG
BugCheckOnFailure, MM_PAGE_PRIORITY Priority)
2193 {
2194     FIXME("(%p, %u, %u, %p, %u, %u): stub\n", MemoryDescriptorList,
AccessMode, CacheType, BaseAddress, BugCheckOnFailure, Priority);
2195 
2196     return NULL;
2197 }
--- snip ---

The current 'MmMapLockedPagesSpecifyCache()' implementation is not useful at
all. The proper way would be to provide a simple-minded implementation of it
and  use it for 'MmMapLockedPages()' like this:

--- snip ---
PVOID WINAPI MmMapLockedPages(PMDL MemoryDescriptorList, KPROCESSOR_MODE
AccessMode)
{
    return MmMapLockedPagesSpecifyCache( Mdl, AccessMode, MmCached, NULL,
                                         TRUE, HighPagePriority);
}
--- snip ---

The reason why this ticket is marked 'staged' with that single patch is to have
a dedicated ticket reference for this kind of API functionality.

Patchsets such as
https://github.com/wine-staging/wine-staging/tree/master/patches/ntoskrnl-Stub
are rather harmful to integrate at once.
You can't dissect properly on regressions if they cover API functionality that
is not closely coupled.

Regards

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list