Re: Using npcap libs to save packet causes memory fault
The in parameter requires a 16-bit number in TCP/IP network byte order. As the cast is from char* to u-short* the order of bytes ptrCurrent_Field[0] and ptrCurrent_Field[1] is important and isn't dealt with by ntoh().
Re: Using npcap libs to save packet causes memory fault
shortTTL = ntohs(*((u_short*)ptrCurrent_Field));
...worked and it looks neater than the workaround I used. Thanks a lot to all who replied. It gives me a pointer (pun intended) for something to learn more about.