none
How to achieve 32 pack alignment in VS compiler RRS feed

  • Question

  • Hi Experts,

    I am working to develop an Windows driver for 64bit architecture.
    Am trying to fetch the data from the hardware address by using a structure.
    But due to misalignment of the structure,am not able to fetch the data as expected.

    In GCC Compiler,we achieved the alignment by using  __attribute((aligned(32), packed)).
    But in windows Visual Studio Compiler,how can I achieve as it does not have 32 pack.

    It will be very helpful if you people have few minutes for it to answer.

    Thanks in Advance.
    Thursday, April 28, 2016 12:03 PM

Answers

  • please read https://msdn.microsoft.com/en-us/library/83ythb65.aspx on how to do this in a Microsoft compiler or start using the new C++11 keyword alignas

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, April 29, 2016 4:32 PM

All replies

  • Hi Janaki,

    Because you are discussing about windows drive development, I am helping move it to appropriate forum for effective response.

    Thank you for understanding.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, April 29, 2016 8:09 AM
  • please read https://msdn.microsoft.com/en-us/library/83ythb65.aspx on how to do this in a Microsoft compiler or start using the new C++11 keyword alignas

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, April 29, 2016 4:32 PM