[fpc-pascal] StackTop and StackBottom are bogus in a Win32/64 Dll

OBones obones at free.fr
Fri Jul 6 17:06:07 CEST 2012


Hello all,

I'm writing Dlls here and am also doing low level analysis of the stack 
and its content.
To do that, I use the StackTop and StackBottom global variables which 
used to work fine in an exe file.
Problem is, when in a DLL, StackTop is always zero and StackBottom is 
the exact opposite of StackLength.
I thus looked as to where this might come from, and discovered that it 
comes from the fact that StackTop is only ever calculated from within 
Exe_entry which obviously is not called for a DLL.

Is anyone else seeing this?
Do you have a suggestion as to how to workaround this?

Regards



More information about the fpc-pascal mailing list