Stdcall vs Cdecl Calling Convention in Teststand

Updated Mar 5, 2020

Reported In

Software

  • TestStand

Issue Details

When calling DLLs in TestStand does it matter if I use _stdcall or _cdecl calling convention?

Solution

It depends what you're trying to do and who your callers are. The difference between _cdecl and _stdcall is going to determine which function cleans up the stack:

  • With _stdcall the callee cleans up the parameters on the stack
  • With _cdecl, the caller cleans up  the parameters on the stack
TestStand can handle both of these  calling conventions so the depends on what you are trying to accomplish.