For 32 bit DLLs (such as KERNEL32, GDI32, and USER32), use the stdcall calling convention.

For 16 bit DLLs, there are two supported calling conventions, pascal and cdecl. The calling convention specifies how parameters are passed on the stack to a DLL.

  • pascal. The pascal calling convention is the default calling convention for exported functions from C DLLs. KERNEL (KRNL286.EXE in standard mode and KRNL386.EXE in enhanced mode), USER (USER.EXE), and GDI (GDI.EXE) all use the pascal calling convention.
  • cdecl. The cdecl calling convention is supported by BASIC+, but is not typically used to export functions from DLLs.

If you are unsure of the calling convention for a function in a 16-bit DLL, assume that it is pascal.

  • No labels