All system variables are in the "g" struct, so you only need to pass a pointer to that struct. The file "variables.h" contains the defines of all variables. The calling convention is __cdecl.