Re: Re: RE:[ntdev] Re: RE: [ntdev] Drivers Align Problems.

> So basically, all procedures and datas offsets should be DWORD (4)

aligned? Is this asumption enough for 32 bit processors (x86?)

I’m not sure what you mean by “procedure”. If you are talking the first
instruction address I don’t believe any alignment is *required*, however
they are very often aligned 16 to be on cache line boundaries. The tops of
small internal loops are also often aligned to cache line boundaries. Since
the compiler does this, it has to make an assumption about where the
procedure will start, or it can’t emit the right number of nops.

If you mean structure alignment, as others have mentioned, many DDK
structures are aligned mod 8. I don’t know if that is an absolute
requirement on x86 machines, but I’d be inclined to do that. I have vague
memories of a few places that use low bits in a pointer as flags. If these
actually had structure address in them bad things would happen. (But
perhaps I’m thinking of another machine; I work on a few too many at once.)

Note that x64 machines have a theoretical requirement to align some things
mod 16, but the alignment check is supposed to be disabled on Windows
systems.

Loren