Isolated from a failure in https://github.com/dlang/druntime/pull/2570:
If compiling these files
--- process.d
import std.windows.syserror;
import thread;
import std.file;
--- thread.d
import core.sys.windows.windows;
HMODULE dllModule;
---
yields
phobos\std\internal\windows\advapi32.d(32): Deprecation: core.sys.windows.windef.DECLARE_HANDLE!("HMODULE", void*).HMODULE is not visible from module advapi32
Removing imports or changing the order of imports in std.process makes the message disappear.
I suspect this happens with package protection somehow getting invalid when seen through a public import.
I've tried to dustmite the issue further, but that moves the problem elsewhere (due to removed module names).
Comment #1 by razvan.nitu1305 — 2023-04-18T14:03:14Z
Is this issue still valid? I don't have access to a windows machine.
Comment #2 by r.sagitario — 2023-04-19T20:09:50Z
Since dmd 2.087 until 2.103, the error message is
c:\d\dmd-2.087.0\windows\bin\..\..\src\phobos\std\internal\windows\advapi32.d(32): Error: undefined identifier HMODULE, did you mean alias HMODULE?
```
That message is a bit confusing, but the import of core.sys.windows.windef is actually missing in advapi32.d. So this is a phobos issue.
Comment #3 by r.sagitario — 2023-04-19T20:22:20Z
On second thought, advapi32 is correct, it imports core.sys.windows.winnt which publicly imports core.sys.windows.windef. So still a dmd problem.
Comment #4 by razvan.nitu1305 — 2023-04-20T09:10:23Z
Likely it's the same heisenbug. The easy reproduction using released versions in issue 23818 should be kept because this is one of those bugs you can only reproduce with very weird exact requirements. So I don't know if either should be closed as duplicates.
Comment #6 by razvan.nitu1305 — 2023-04-28T11:49:05Z
We can close this one as a link to it is going to be present in issue 23818
*** This issue has been marked as a duplicate of issue 23818 ***