I read the source code of FastMM4, and notice this interesting function
function GetThreadID: Cardinal;
{$ifdef 32Bit}
asm
mov eax, FS:[$24]
end;
{$else}
begin
Result := GetCurrentThreadID;
end;
{$endif}
I've tested it, and it works, so my question is any explanation why it works?
NtCurrentTeb/ZwCurrentTeb
to attain certain grade of flexibility of private implementation. – Ceaseless