__declspec(align) works in the kernel.? If you look at ntddk.h/wdm.h, PIRP and other structures have this tag on them, so by inspection that would indicate it is supported in kernel mode.? I would assume it is the linker who enforces this.? The compiler “just” (haha!) turns instructions into opcodes.
?
d
?
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@conexant.com
Sent: Monday, January 31, 2005 5:58 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] How to align static data structures in a driver?
?
Hi All,
Say I have a huge structure of shorts declared globally:
static short myArray={1, 2, 3, 4, 5, …, 16000}
I want myArray[0] to be 8-Byte aligned. Is there a way to tell the DDK compiler this requirement? I know in later application compilers there is a __declspec(align) directive. Will this also work in a driver?
Who actually does the alignment in this case, is it the compiler, or the linker, or both in conjunction enforce the alignment?
Thanks,
James
********************** Legal Disclaimer ****************************
“This email may contain confidential and privileged material for the sole use of the intended recipient. Any unauthorized review, use or distribution by others is strictly prohibited. If you have received the message in error, please advise the sender by reply email and delete the message. Thank you.”
**********************************************************************
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com