Hi all, This is a question about some weird behaviour I found while building a DLL.
#define EXTERNC extern "c"
#define APIEXPORTS __declspec(dllexport)
#define STDCALL __stdcall
EXTERNC APIEXPORTS STDCALL InvokeCommand(int* c, uint8_t* buff, uint16_t opcode, double* args)
Size of Args = 3*(sizeof(pointer 32bit)) + sizeof(uint16_t) = 14. BUT: Looking at the dumpbin output from this export gives the following decorated name:
_InvokeCommand@16
According to MSDN (I am compiling in VS cpp):
"Leading underscore (_) and a trailing at sign (@) followed by the number of bytes in the parameter list in decimal"
but then the name should have been ...@14 not 16. Each of the three pointers being 4 bytes, and the uint16_t being two. Can anyone explain this behaviour?
EDIT: InvokeMessageProcess(int*, uint8_t*, int8_t*); gave the correct behaviour of _InvokeMessageProcess@12 !! Seems inconsistent!