• Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Hard 'C' Question

Put a sizeof somewhere in your code to check the size. I.e. sizeof(LPVOID), and sizeof(LPLISTENTRY) you'd expect to return 4. And also do the same for the whole structure to make sure they're the same.

If structures don't match across modules compiled seperately, then chances are it's alignment (i.e. one is set to align members to bytes, the other to align to 4 bytes). If not that, then another explanation could be if any part of the structure has #ifs which evaluate differently. sizeof should tell you if that's the case.
 

Advertisers

Back
Top