Microsoft KB Archive/300154

= FIX: Data Alignment Switched to 4-Byte on MIPS ATL Projects =

Article ID: 300154

Article Last Modified on 12/27/2003

-

APPLIES TO


 * Microsoft Windows CE Platform Builder 2.12

-



This article was previously published under Q300154



SYMPTOMS
When you are using the Active Template Library (ATL) in a project that targets the MIPS processor, data alignment in structures is permanently switched to 4-byte instead of the default 8-byte.



CAUSE
Atlwin.h, which is included in all ATL projects, performs a #pragma pack(push,4) before the _WndProcThunk struct definition but never does the corresponding #pragma pack(pop). As a result, the data alignment is permanently switched to 4-byte throughout the project, unless explicitly changed. ... struct _WndProcThunk {   WORD    m_pFuncHi; WORD   m_lui_t0;       // lui      t0,PFUNC_HIGH WORD   m_pFuncLo; WORD   m_ori_t0;       // ori      t0,t0,PFUNC_LOW WORD   m_pThisHi; WORD   m_lui_a0;       // lui      a0,PTHIS_HIGH DWORD  m_jr_t0;        // jr       t0    WORD    m_pThisLo; WORD   m_ori_a0;       // ori      a0,PTHIS_LOW };
 * 1) elif defined(_MIPS_)
 * 2) pragma pack(push,4)

... The #pragma pack(pop) statement, which should have been placed immediately after the structure definition, is missing.
 * 1) elif defined(_THUMB_)



RESOLUTION
To resolve this problem, edit Atlwin.h to insert the missing line immediately after the _WndProcThunk structure definition, inside the #elif defined(_MPIS_) conditional block.
 * 1) pragma pack(pop)



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

This problem was corrected in Platform Builder 3.0.

Keywords: kbbug kbfix KB300154

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.