Discussion:
64 bit structure alignment?
(too old to reply)
Richard Lewis Haggard
2008-08-13 19:38:09 UTC
Permalink
I've just started working on a port of a driver from 32 bit to 64 bit XP and
I think I'm having trouble with alignment in my structures. For example, a
UNICODE_STRING is two shorts and 32 bit pointer. Using WinDbg, I can see
that a pointer to a UNICODE_STRING being supplied by the system to a call
back in my code is using two shorts, four padding bytes and then an 8 byte
pointer to a wide character buffer. My code is not reading this structure
correctly. What settings should I be using at compile time to get my code to
properly interpret structures?
--
Rick
Pastor Dave
2009-05-25 06:19:21 UTC
Permalink
On Wed, 13 Aug 2008 15:38:09 -0400, "Richard Lewis Haggard"
Post by Richard Lewis Haggard
I've just started working on a port of a driver from 32 bit to 64 bit XP and
I think I'm having trouble with alignment in my structures. For example, a
UNICODE_STRING is two shorts and 32 bit pointer. Using WinDbg, I can see
that a pointer to a UNICODE_STRING being supplied by the system to a call
back in my code is using two shorts, four padding bytes and then an 8 byte
pointer to a wide character buffer. My code is not reading this structure
correctly. What settings should I be using at compile time to get my code to
properly interpret structures?
Is there any way you could do another one?
Please see the new thread, "ACPI Driver".

I have both the XP 32 bit & Vista 64 bit drivers
already, but neither will work in XP 64 bit.

Thanks for taking the time to read, if you do!!!

--

Pastor Dave

"The difference between stupidity and genius is that
genius has its limits." - Albert Einstein

Loading...