This MR is a subset of MR 6715 [1]. It mainly contains fixes and improvements in dbghelp handling of DEBUG directories in PE header.
Since 6715 may take some time to be finished (may take some more time to have an approved solution), it seems preferable to land these fixes/improvements in Wine before code freeze.
The changes in this MR: - fixes loading dwarf info from PE files compiled by gcc/mingw with --build-id option, - several improvements for SymSrvGetFileIndexInfo (esp. native fails with ERROR_BAD_EXE_FORMAT error code when there is no DEBUG directory; yet, does it fill most of the information out of the PE image... Note that images compiled with gcc/mingw compilation (dwarf debug info, no buildid don't have DEBUG directories) So mimic native's behavior, and fix some code paths accordingly, - some fixes for .dbg handling (not much of an use today anyway).
[1] https://gitlab.winehq.org/wine/wine/-/merge_requests/6715