On Mon Feb 26 19:58:49 2024 +0000, Alexandre Julliard wrote:
There's no such import lib on Windows, it would be better to use some other existing library.
We need a DLL, not already loaded, that forwards to another DLL, also not already loaded[^1].
Most forwarder DLLs forward to known DLLs (e.g., combase.dll, setupapi.dll), which are already transitively loaded at process startup, in some Windows versions or another.
Therefore, *all* of the following DLLs are ruled out (assuming we want to test on Windows 7 as well):
```mermaid graph LR classDef default text-decoration:line-through kernel32_test.exe --> kernel32.dll --> kernelbase.dll --> ntdll.dll kernel32_test.exe --> user32.dll --> gdi32.dll --> win32u.dll --> ntdll.dll user32.dll --> sechost.dll user32.dll --> advapi32.dll user32.dll --> kernelbase.dll user32.dll --> win32u.dll kernel32_test.exe --> advapi32.dll --> kernelbase.dll advapi32.dll --> sechost.dll advapi32.dll --> msvcrt.dll --> ntdll.dll kernel32_test.exe -. "(w7)" .-> ole32.dll kernel32_test.exe -. "(w7)" .-> shlwapi.dll --> userenv.dll kernel32_test.exe -. "(w7)" .-> sspicli.dll --> secur32.dll ```
Others are relatively obscure, or are not guaranteed to forward to specific DLLs[^2] (or contain forwarders at all) or even exist at all[^3] across Windows versions. Some others (e.g., ncrypt.dll) are seemingly pinned by some unrelated mechanism once loaded by some other forwarder DLL.
There might be something I haven't discovered yet and I can continue scavenging applicable DLLs, but then I wonder if I would end up doing a whack-a-mole here and writing tests that aren't guaranteed to be run on future Windows updates anyway.
Alternatively, shall I just skip it on Windows 7?
[^1]: We can't test refcounts dropping to zero if someone else is holding the DLL. [^2]: E.g., ole32.dll [^3]: E.g., olepro32.dll, olecli32.dll, combase.dll