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
Post Reply
MartinDJR
Newbie
Newbie
Posts: 2
Joined: Sat Dec 12, 2020 2:42 pm

Best way to inject a DLL patch

Post by MartinDJR » Sun Dec 13, 2020 4:40 am

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 5
Level 5
Posts: 450
Joined: Thu Dec 24, 2009 11:00 am

Re: Best way to inject a DLL patch

Post by spoon0042 » Sun Dec 20, 2020 7:08 pm

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.

Post Reply