It may not be the problem, but you should be suspicous of any cross platform code using bitfields to pick out bits like this. The C standard does not define whether bitfields are allocated starting from the most or least significant bits of the variable. Different compilers may interpret this code differently!
UCHAR HeaderLength :4; // Header length in 32-bit words
Some compilers will use the high nibble, others the lower nibble. Its much safer to use masks and shifts:
Either
HeaderLength = (uchar_var & 0xF0) >> 4
or
HeaderLength = (uchar_var & 0x0F)
as appropriate. Stephen C. Steel Kerr Vayne Systems Ltd.