http://bugs.winehq.org/show_bug.cgi?id=58162
--- Comment #5 from Patrick Hibbs hibbsncc1701@gmail.com --- Created attachment 78543 --> http://bugs.winehq.org/attachment.cgi?id=78543 POC patch
(In reply to Alexandre Julliard from comment #4)
(In reply to Patrick Hibbs from comment #3)
I don't see how making a call that Wine already performs internally, detourable, is a problem. It's just an IAT lookup, something that depending on your compiler / linker version and settings could be done accidentally already.
If it's called already then it should work. GetFullPathNameW is already marked as DECLSPEC_HOTPATCH so it should be detourable. There must be something else going on here.
Replacing the direct call to GetFullPathNameW() on https://gitlab.winehq.org/wine/wine/-/blob/f7503d0a996ae1243dd6c87b39a914362... with a GetModuleHandleEx(), GetProcAddress(), and function pointer call combo fixes this bug. (See attached patch file.)
So it appears that the issue is something that the compiler is doing when it sees that direct call.