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

Stefan Dösinger <[email protected]> Tue, 6 May 2025 12:03:33 +0300
Newsgroups gmane.comp.emulators.wine.devel
Message-ID <[email protected]>

> 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.
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEQxb0tqoFWyeVMl1sPRO8yFRPGiIFAmgZ0GUACgkQPRO8yFRP
GiJjQA/+LdUYNEteDmoA8rI1xW+s4wOHZvu6BglgWndV9zBfsyNsjIi+apHHBYnD
J5iE7CmPDFy1/uF2gUZ/6SYDOAq3ivb3jnveUI0tqEJUFBiaTYFzFq79x+bnGDq9
LXJLKcrRlv6z78neuwcF/V9luiKHHCO3Pd0EmthI76Dir8GxcadmX+55k+HRXHbY
qveWupotM6xxJ60wjl80sO2aGfcTIOIgqtzeiD1qA6LTSbTBYK2Gs8pVJqnan/RU
LBESCiyxUSSSAGC8aDZndNbbids6xWiBr9xFNHjW/YwHjm9Gz+sfdhEERzV5lxbh
Onvcq4dudmkupNQE6jFyIDszYq5b4GeLasY5VqYPBb51JbtGqCgCoy03GX0enlb/
FvAJ69UhhBnggGznJe3TiVO9qAaUXo09M36uy69celHuPn7jB5y/FRXb/FHjGG18
a8PfbKvHvDm/UjTjPxlZTYe4uXw8BZ5JdI/IkkGwJOpZh1l1XQUe+T/Fi3B50928
n/BUOiV0HjDLkMOtZRdlC+yeJTGyCUfHq13bxnKEGf5iCyowFlNOO+XjF3V6OAzr
nyIlZXCa04nzunciWH6FxLFhEExT7JevOhuLfJiBJsUbnEsbPfFrA8fyMWcpCaCE
FgIqFmNY3bc3MnQN5s+ocAqSlFs2SBwmLaozFxCygbrt/H7xYGM=
=dezL
-----END PGP SIGNATURE-----