Best way to inject a DLL patch

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
MartinDJR
Newbie
Newbie
Posts: 3
Joined: Sat Dec 12, 2020 2:42 pm

Best way to inject a DLL patch

Post by MartinDJR »

Hello

I have an application that requires certain functions (for example "midiInGetDevCaps()") to be patched because Wine's implementation does not return the values expected by the application:

Code: Select all

int patched_midiInGetDevCaps(int dev, MIDIINCAPS *caps, int len)
{
    int result = original_midiInGetDevCaps(dev, caps, len);
    if(...) /* Check if the data must be patched */
    {
        caps->wPid = ... /* Patch the data */
        ...
    }
    return result;
}
What is the best way to perform such kind of patches?

Thanks.
spoon0042
Level 6
Level 6
Posts: 570
Joined: Thu Dec 24, 2009 11:00 am

Re: Best way to inject a DLL patch

Post by spoon0042 »

It may be easiest to just modify wine and build it yourself. It may be possible to "shim" some dll that only modifies certain calls but that seems... I don't know really.

That's assuming that the program you're trying to run is broken somehow. If it's wine that's doing something wrong you would probably want to file a bug.
Locked