Link to home
Start Free TrialLog in
Avatar of b2s2
b2s2

asked on

How I can use NT DDK PACKET driver with VC++ ?

I've built the packet driver from ddk/network/packet directory, I've
got a packet32.dll, packet32.lib etc..., the testapp.c works fine. But
when I build my project in VC++ (with MFC) I get "unresolved external
symbol _PacketOpenAdapter" (obviusly for all packet functions), but
I've linked the library packet32.lib and I've put the 'extern "C"' in
all function prototypes in packet32.h, but it still don't work.

Anybody can help me ? How I can use packet32.lib under VC++ 4.2 ?

I've used packet driver that come with MSDN of August 1996, I don't
know if newer version works, anyone knows ?

Regards.
Avatar of nietod
nietod

I'm not familiar with this.  But I guess what is happening is that this is C code and you are trying to call it from C++ by adding the extern "C", is that right?

The problem might be calling convention.  In C++ the standard call calling convention.  As well as the extern "C", you might need to add a declaration that indicates the calling convention as well.  An incorrect calling convetions will obviously cause run-time errors, but it can cause link errors as well, because the standard call (VC's default) calling convention  decorates the name by adding an underscrore to the start and appending a "@XX to the end where the XX is the byte size fo the parameters.  
ASKER CERTIFIED SOLUTION
Avatar of agreen
agreen

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial