Byte Alignment compile

Greetings,

Which option in the compilation, forces compiler to compile the driver on a
Byte Alignment rather than default word alignment ?

Thanks in advance.

  • Vipul

You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Use something like this:
(Note that ‘MyNewPackValue’ can be anything that you want. Also: 8 == the
new pack value -> which is also the default in Ring3)

#pragma pack(push, MyNewPackValue, 8)

struct ExampleStruct
{
DWORD param1;
char param2;
DWORD param3;
};

#pragma pack(pop, MyNewPackValue)


Dashut Alon.

-----Original Message-----
From: Vipul Jain [mailto:xxxxx@fvc.com]
Sent: Tuesday, August 14, 2001 12:12 AM
To: NT Developers Interest List
Subject: [ntdev] Byte Alignment compile

Greetings,

Which option in the compilation, forces compiler to compile the driver on a
Byte Alignment rather than default word alignment ?

Thanks in advance.

  • Vipul

You are currently subscribed to ntdev as: xxxxx@AppStream.co.il
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Try “/Zp1”.

Youssef.

-----Original Message-----
From: Vipul Jain [mailto:xxxxx@fvc.com]
Sent: Monday, August 13, 2001 3:12 PM
To: NT Developers Interest List
Subject: [ntdev] Byte Alignment compile

Greetings,

Which option in the compilation, forces compiler to compile the driver
on a
Byte Alignment rather than default word alignment ?

Thanks in advance.

  • Vipul

You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Changing the default alignment will probably break interoperability on ia64
and it will degrade performance on x86. Better to pack only the structures
that must be packed…

----- Original Message -----
From: “Youssef Barakat”
To: “NT Developers Interest List”
Sent: Thursday, August 16, 2001 12:01 PM
Subject: [ntdev] RE: Byte Alignment compile

Try “/Zp1”.

Youssef.

-----Original Message-----
From: Vipul Jain [mailto:xxxxx@fvc.com]
Sent: Monday, August 13, 2001 3:12 PM
To: NT Developers Interest List
Subject: [ntdev] Byte Alignment compile

Greetings,

Which option in the compilation, forces compiler to compile the driver
on a
Byte Alignment rather than default word alignment ?

Thanks in advance.
- Vipul


You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@gte.net
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Why not use #pragama PACK compiler directives ONLY around the structures needing to be byte alligned?

Larry

-----Original Message-----
From: Michael and Karen Gilson [mailto:xxxxx@gte.net]
Sent: Thursday, August 16, 2001 2:19 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Byte Alignment compile

Changing the default alignment will probably break interoperability on ia64
and it will degrade performance on x86. Better to pack only the structures
that must be packed…

----- Original Message -----
From: “Youssef Barakat”
To: “NT Developers Interest List”
Sent: Thursday, August 16, 2001 12:01 PM
Subject: [ntdev] RE: Byte Alignment compile

Try “/Zp1”.

Youssef.

-----Original Message-----
From: Vipul Jain [mailto:xxxxx@fvc.com]
Sent: Monday, August 13, 2001 3:12 PM
To: NT Developers Interest List
Subject: [ntdev] Byte Alignment compile

Greetings,

Which option in the compilation, forces compiler to compile the driver
on a
Byte Alignment rather than default word alignment ?

Thanks in advance.
- Vipul


You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@gte.net
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@diebold.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

#pragma pack(1) in the source.
Close it with
#pragma pack()

Use this only around the declaration of the structure which must have byte
alignment.

Max

----- Original Message -----
From: “Vipul Jain”
To: “NT Developers Interest List”
Sent: Tuesday, August 14, 2001 2:11 AM
Subject: [ntdev] Byte Alignment compile

> Greetings,
>
> Which option in the compilation, forces compiler to compile the driver on
a
> Byte Alignment rather than default word alignment ?
>
> Thanks in advance.
> - Vipul
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com