in reply to Re^2: Correct call for dll with Win32::API
in thread Correct call for dll with Win32::API
If int HCE300_Read(int TrackNo, char *ReadData); is the prototype, then it uses the default calling convention. It my understanding that's __cdecl for MS compilers. Win32::API uses the __stdcall calling convention since that's what the Win32 API (kernel32.dll, etc) uses.
| Argument-passing order | Stack-maintenance responsibility | |
|---|---|---|
| __stdcall | Right to left | Called function pops its own arguments from the stack |
| __cdecl | Right to left | Calling function pops the arguments from the stack |
Win32::API expects the DLL function to reset the stack, but the DLL function expects its caller to reset the stack.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Correct call for dll with Win32::API
by walto (Pilgrim) on Dec 04, 2008 at 20:38 UTC | |
by BrowserUk (Patriarch) on Dec 04, 2008 at 20:53 UTC | |
by walto (Pilgrim) on Dec 05, 2008 at 05:40 UTC | |
by BrowserUk (Patriarch) on Dec 05, 2008 at 13:48 UTC | |
by ikegami (Patriarch) on Dec 05, 2008 at 14:00 UTC | |
| |
by walto (Pilgrim) on Dec 06, 2008 at 07:01 UTC | |
by ikegami (Patriarch) on Dec 04, 2008 at 20:57 UTC |