Hi,
This is not a Windows driver specific question, however it is related with the driver i’m working because it has a main data structure shared across different operating systems.
I have realized very recently that compilers in Windows have a different struct data alignment, and structure data padding.
What I have realized is that my main structure has different size when compiled in Windows then the size when compiled in Linux.
I think that is because in Linux, word size is 4 bytes and and in windows 8 bytes, please correct me if i’m wrong.
What should I do to have a uniform structure data size across different operating systems?
I discover this while transmiting my main structure data, from a windows system to a unix based system.
I have also read this article about data alignment and padding:
http://en.wikipedia.org/wiki/Data_structure_alignment
And it speaks about praga pack. I wonder if I should use a pragma pack of 1 byte to solve my problems.
What is your opinion about this?
Thanks,
With my best regards,
Nuno Santos