open-mpi/hwloc

LoadLibrary("kernel32.dll") should be LoadLibrary(TEXT("kernel32.dll")) in topology-windows.c

MKoep opened this issue · 5 comments

MKoep commented

LoadLibrary automatically switches between LoadLibraryW and LoadLibraryA when UNICODE is enabled or disabled but the given string "kernel32.dll" does not and the call fails. The TEXT macro fixes this.

GetModuleHandle has the same issue.

Looks like it works fine. Before I push this, can you give me a real name to thank in the changelog. And confirm that without this change some binding or topology querying functions fail?

MKoep commented

Looks like it works fine. Before I push this, can you give me a real name to thank in the changelog.

Martin is ok ;-)

And confirm that without this change some binding or topology querying functions fail?

Without this change all method pointers in hwloc_win_get_function_ptrs are nullptr. The depricated GetVersionEx is used which returns an old version.

We have a system with a AMD Ryzen Threadripper 2920X 12-Core CPU. Without this change and when compiled in unicode, the L3 Caches are missing.

Thanks a lot, I am backporting this to stable branches. It will be in the next release, either 2.10.1 or 2.11 within a couple weeks.

Took a bit longer that expected, but I am posting 2.11rc1 right now with this fix.