[PATCH v2 0/1] MR777: ntoskrnl: MmAllocateContiguousMemorySpecifyCache semi-stub
This should help to get the nox android emulator to run fixes bug https://bugs.winehq.org/show_bug.cgi?id=46760 -- v2: MmAllocateContiguousMemorySpecifyCache semi-stub https://gitlab.winehq.org/wine/wine/-/merge_requests/777
From: Etaash Mathamsetty <etaash.mathamsetty(a)gmail.com> use NULL for lpAddress --- dlls/ntoskrnl.exe/ntoskrnl.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 031e9900544..8d97f3ae46d 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -2777,8 +2777,23 @@ PVOID WINAPI MmAllocateContiguousMemorySpecifyCache( SIZE_T size, PHYSICAL_ADDRESS BoundaryAddressMultiple, MEMORY_CACHING_TYPE CacheType ) { - FIXME(": stub\n"); - return NULL; + DWORD protect = PAGE_READWRITE; + FIXME( ": ( %Iu %s %s %s %x ) semi-stub\n", size, wine_dbgstr_longlong(lowest_valid_address.QuadPart), + wine_dbgstr_longlong(highest_valid_address.QuadPart), + wine_dbgstr_longlong(BoundaryAddressMultiple.QuadPart), CacheType ); + switch (CacheType) + { + case MmNonCached: + protect |= PAGE_NOCACHE; + break; + case MmWriteCombined: + protect |= PAGE_NOCACHE; + protect |= PAGE_WRITECOMBINE; + break; + default: + break; + } + return VirtualAlloc( NULL, size, MEM_RESERVE|MEM_COMMIT, protect ); } /*********************************************************************** -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/777
Jinoh Kang (@iamahuman) commented about dlls/ntoskrnl.exe/ntoskrnl.c:
MEMORY_CACHING_TYPE CacheType ) { - FIXME(": stub\n"); - return NULL; + DWORD protect = PAGE_READWRITE; + FIXME( ": ( %Iu %s %s %s %x ) semi-stub\n", size, wine_dbgstr_longlong(lowest_valid_address.QuadPart), + wine_dbgstr_longlong(highest_valid_address.QuadPart), + wine_dbgstr_longlong(BoundaryAddressMultiple.QuadPart), CacheType ); + switch (CacheType) + { + case MmNonCached: + protect |= PAGE_NOCACHE; + break; + case MmWriteCombined: + protect |= PAGE_NOCACHE; + protect |= PAGE_WRITECOMBINE;
```suggestion:-1+0 protect |= PAGE_WRITECOMBINE; ``` `PAGE_NOCACHE` and `PAGE_WRITECOMBINE` are mutually exclusive. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/777#note_7696
participants (3)
-
Etaash Mathamsetty -
Etaash Mathamsetty (@etaash.mathamsetty) -
Jinoh Kang (@iamahuman)