Re: Why, in Wine, are some unimplemented APIs not marked as stubs but instead commented out?

zhengxianwei <[email protected]> Tue, 6 May 2025 17:15:52 +0800
Newsgroups gmane.comp.emulators.wine.devel
Message-ID <CABeGAqUfeWH4S4kX0xYjWMSLYhXP=9MEV=A6JTuCW2Ap7Z2BPw@mail.gmail.com>
Thank you—after your explanation, the choice between using a stub or
commenting out an unimplemented API makes much more sense

On Tue, May 6, 2025 at 5:03 PM Stefan Dösinger <[email protected]>
wrote:

>
>
> > Am 06.05.2025 um 10:13 schrieb Zhiyi Zhang <[email protected]>:
> >
> > If it's a stub, applications that link to it but don't actually call it
> works. If it's commented out,
> > application might be able to handle its absence and fallback to other
> functions. Either way, if
> > a application actually calls the function, it fails. So for such cases,
> you would need to implement the function.
>
> I'll try to phrase it a bit differently: Many applications dynamically
> check if a function is available (via GetProcAddress). An @ stub will lead
> such an application to believe the function is there, attempt to call it,
> and crash. If the function is absent, it will fall back to alternatives and
> have a decent chance of working.
>
> This mostly concerns functions that are only available on some Windows
> versions. Usually they are introduced on newer Windows versions, but there
> are functions that exist on Windows 9x but not on the Windows NT line.
>
>