4 Nov
2024
4 Nov
'24
11:35 a.m.
From your explanation, it rather looks that VirtualQueryEx() fails because the access rights of the process handle don't have the PROCESS_QUERY_INFORMATION bit set. (tested on Win10 and WriteProcessMemory() succeeds if the PROCESS_QUERY_INFORMATION isn't set). Does the attached patch works as well?
(and calling directly NtWriteVirtualMemory() doesn't look fully correct: it should follow the rest of the code to potentially change protection of some pages) [writevirt.patch](/uploads/e2b61d4a5da0f9990c0488273dd3f834/writevirt.patch). -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6761#note_86497