For 9x/ME:
Implement it similar to https://fanael.github.io/stockfish-on-windows-98.html#dynamic-dispatch. Another impl is in KernelEx
For NT before 4:
Reverse what NT4+ do. https://www.geoffchappell.com/studies/windows/km/ntoskrnl/inc/api/pebteb/teb/index.htm shows that for NT3.1 CountOfOwnedCriticalSections didn't exist, or is potentially stored somewhere else. Figure out and implement the right fallback.
For 9x/ME:
Implement it similar to https://fanael.github.io/stockfish-on-windows-98.html#dynamic-dispatch. Another impl is in KernelEx
For NT before 4:
Reverse what NT4+ do. https://www.geoffchappell.com/studies/windows/km/ntoskrnl/inc/api/pebteb/teb/index.htm shows that for NT3.1
CountOfOwnedCriticalSectionsdidn't exist, or is potentially stored somewhere else. Figure out and implement the right fallback.