ntdll/kernelbase: Add accurate node count feature to prevent memory access violations initializing multiple physical nodes as a single logical one on multi-node systems

A much cleaner result (written by hand) that we can reuse where needed later (i.e. GetNumaProcessorNode which also crashes with a similar MAV on multi-node systems).

Took me a while to understand where I should put everything, not even sure I got it right. Let me know.

I thought I was going to need FileNumaNodeInformation but turns out it's not really needed. I can remove it if you want.

This is what I see when I try to get a node count read:

0024:fixme:ntdll:init_numa_info node affinity; using node 0.
GetNumaHighestNodeNumber: 1

I only see this fixme if I try to access FILE_NUMA_NODE_INFORMATION. I would really prefer such a behavior for our compatibility layer on any multi-node system.

A big thanks to @besentv and @zfigura for their invaluable feedback on this.

Merge request reports

Loading