I had a look at your piece of code. This code is working with bits (DWord). I am only average VB
.Net dev and still can not find way of doing it yet.
At present, I can help only with code breakdown meaning and I hope it would be helpful to you.
1.(cksum >> 16) means cksum's bits is shifted 16 places to the right.
2.(cksum & 0xffff) means cksum AND with hex value FFFF (binary - 111111111111)
3.(~cksum) means cksum added one compliment to its value ie, 2 (10) will equals to 3 (11). When you change it to 16 bits unsigned value (UInt16) this infacts turn it to a negative number.
I wonder what is this code for any how, you probably know C# syntax is similar to C/C++ so it can handle the low level programming. As VB
is more to higher level language, I guess I can not find way of doing it in VB
yet, from my point of view, this code is more suited to C# or C/C++. If you can do it please let me knows ... good luck.