Windows header files require /Zp8
packing. You must respect the packing specified by the header file.
Win32 - does the CRITICAL_SECTION struct must have a specific (4/8 byte) alignment?
-
30-11-2021 - |
Question
I am working on a project which is using 1 byte alignment by default, including in places that use the CRITICAL_SECTION struct. I am investigating a certain deadlock and I can see that the data in the CRITICAL_SECTION struct which is causing the trouble is invalid .. can the alignment be the trouble ? (I can also see that for this specific CRITICAL_SECTION indeed the alignment is 1 (odd address) ..)
Thanks, Amit
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow