/* Collection of code snippets by Arne Vajhøj */
/* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) */
#include <windows.h>

__declspec(dllexport) DWORD get_sp()
{
    CONTEXT ctx;
    BOOL stat;
    ctx.ContextFlags = (CONTEXT_FULL);
    stat = GetThreadContext(GetCurrentThread(), &ctx);
    return stat ? ctx.Esp : -1;
}
