[Winpcap-users] library calling convention

Chris Morgan chmorgan at gmail.com
Mon Jan 31 09:06:20 PST 2011


Thank you for the information. I'm not sure the calling convention is
affecting the 64bit functions but correcting sharppcap to use cdecl
should fix 32bit issues a few users have reported.

Chris


On Jan 31, 2011, at 11:49 AM, Gianluca Varenni
<Gianluca.Varenni at riverbed.com> wrote:

> Windows actually supports 3 calling conventions for C code: cdecl, stdcall and fastcall. The one used by WinPcap is _cdecl.
>
> Have  a nice day
> GV
>
> -----Original Message-----
> From: winpcap-users-bounces at winpcap.org [mailto:winpcap-users-bounces at winpcap.org] On Behalf Of Chris Morgan
> Sent: Friday, January 28, 2011 7:29 AM
> To: winpcap-users at winpcap.org
> Subject: [Winpcap-users] library calling convention
>
> 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
> _______________________________________________
> Winpcap-users mailing list
> Winpcap-users at winpcap.org
> https://www.winpcap.org/mailman/listinfo/winpcap-users
> _______________________________________________
> Winpcap-users mailing list
> Winpcap-users at winpcap.org
> https://www.winpcap.org/mailman/listinfo/winpcap-users


More information about the Winpcap-users mailing list