Now you can look at MSDN for DllMain where the third parameter is called lpvReserved and indeed has a documentation when it has what kind of value.
That doesn't seem to make sense, the lpvReserved is, as its name says, reserved and MS has never documented what the values of that parameter mean. I don't see getting that parameter value as being very useful.
And as Thaddy said: please don't use Delphi 2 as a point of comparison with FPC for such things.
Excuse me for stating this but, I really don't put much stock, if any at all, in what Thaddy says. What he stated in this thread
No. Delphi 3 and higher behave the same as FreePascal. It is just D2 that was not yet compatible with MS API's in the proper way,
Is a good reason.
As far as comparing with Delphi 2, TTBOMK, much later versions of Delphi still use DllProc, therefore it seems that, in this particular case, comparing to Delphi 2 or even a much later version of Delphi makes no difference.
Again, TTBOMK, no version of Delphi uses the mechanism (Dll_Process_Detach_Hook, Dll_Thread_Attach_Hook, Dll_Thread_Detach_Hook) implemented by FPC. Because of that, Dll source code requires more than just trivial changes to make it acceptable to Delphi (regardless of version) and FPC.
All that said, thank you for making it clear what the meaning of the parameter to the hook procedures mean. I appreciate your clarifying that.