[Bug 47940] Morrowind + MGE XE: MGE XE Doe not inject itself into Morrowind

WineHQ Bugzilla wine-bugs at winehq.org
Fri Nov 22 18:18:48 CST 2019


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

--- Comment #20 from Lorenzo Ferrillo <lorenzofer at live.it> ---
Yes actually, I was debugging it just now.

in the heap.c in the wine  MSVCRT  folder, the needed function have a signature
in the MSVCRT_func style. So malloc is actually MSVCRT_malloc in the code.

Then in the msvcrt.spec it is defined as @cdecl malloc(long) MSVCRT_malloc

and so on.

the issue is  that dbghelp doesn't expect this and instead expect the normal
non prefixed name.

This is not  a problem with wine dbghelp as native windows dbghelp as the same
behaviour.

In fact if I add aq void* CDECL malloc(MSVCRT_size_t size) in heap.c with the
same body of MSVCRT_malloc function MWSE detect it and store it's pointer.

However this is clearly not the right way as we got unneccessary duplicated
code, and if MWSE use this function to do some internal hooking (and not just
using it to allocate memory as it would be better to just directly link to the
function without using dbghelp), it will silently fail to hook into the game.


Installing the native CRT may be a workaround, but I still need to check it.

-- 
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