[Winpcap-users] library calling convention

Chris Morgan chmorgan at gmail.com
Fri Jan 28 07:28:36 PST 2011


Hello.

I'm the developer of sharppcap, a .net wrapper to libpcap/winpcap.

One user has reported seeing issues when calling any winpcap
functions. The error points to an issue on the sharppcap side related
to the calling convention being used. I can't reproduce these issues
here.

Currently the calling convention of the pcap_dispatch() callback is
flagged as cdecl but I don't believe I've specified the same on the
rest of the api. The user also says that specifying cdecl for all
functions resolves the issue, a PInvokeStackImbalance exception.

While it was my understanding that windows api used stdcall, linux
uses cdecl, I can't figure out how to determine the calling convention
used by winpcap functions and was hoping someone could help to fill in
the blanks. The other interesting question that I have is why I'm not
seeing any issues with Win7 64bit, not sure what specific os
configuration this user is using.

Chris


More information about the Winpcap-users mailing list