Same issue occurred in latest CT 4.90 Lab version(Revision: 004814).
"align" compiler directives are in below source files for jwawindows unit.
Search "{$Align" (7 hits in 5 files)
C:\codetyphon\fpcsrc\packages\winunits-jedi\src\jwawindows.pas (2 hits)
Line 215: {$ALIGN 4}
Line 218: {$ALIGN 4}
C:\codetyphon\fpcsrc\packages\winunits-jedi\src\jwawinldap.pas (1 hit)
Line 510: {$ALIGN ON}
C:\codetyphon\fpcsrc\packages\winunits-jedi\src\jwawinsock2.pas (1 hit)
Line 68: {$ALIGN 4}
C:\codetyphon\fpcsrc\packages\winunits-jedi\src\jwaws2atm.pas (1 hit)
Line 67: {$ALIGN ON}
C:\codetyphon\fpcsrc\packages\winunits-jedi\src\jwaws2spi.pas (2 hits)
Line 70: {$ALIGN OFF}
Line 72: {$ALIGN ON}
jwawindows.pas include other .pas files.
JwaTlHelp32.pas is included by last order.
(PROCESSENTRY32W is declared in JwaTlHelp32.pas)
...
{$I JwaWinSock2.pas} // 324 line
{$I JwaWS2atm.pas} // 326 line
{$I JwaWS2spi.pas} // 330 line
{$I JwaWinLDAP.pas} // 399 line
{$I JwaTlHelp32.pas} // 521 line
....
{$I JwaWinSock2.pas} // 649 line
{$I JwaWS2atm.pas} // 651 line
{$I JwaWS2spi.pas} // 655 line
{$I JwaWinLDAP.pas} // 724 line
{$I JwaTlHelp32.pas} // 849 line
"align" compiler directive in JwaWinLDAP.pas, I think, affect to align of JwaTlHelp32.pas.
jwawindows.pas 211 line
{$IFNDEF COMPILER6_UP}
{$ifndef FPC}
type PCardinal = ^Cardinal;
{$ELSE}
{$ALIGN 4}
{$ENDIF}
{$ELSE}
{$ALIGN 4}
{$ENDIF}
to
{$IFNDEF COMPILER6_UP}
{$ifndef FPC}
type PCardinal = ^Cardinal;
{$ELSE}
{$IFDEF CPU64}
{$ALIGN 8}
{$ELSE}
{$ALIGN 4}
{$ENDIF}
{$ENDIF}
{$ELSE}
{$ALIGN 4}
{$ENDIF}
jwawinldap.pas 211 line
to
{$IFDEF CPU64}
{$ALIGN 8}
{$ELSE}
{$ALIGN ON}
{$ENDIF}
After change source code as above, rebuild package by CodeTyphon Center->FreePascal->FPC 64bit Build Compiler
PROCESSENTRY32W have correct size(568bytes) and my code works for me fine on windows 64bit.
Is it correct?
It seems to be dangerous as I am not sure that all record types must be aligned by 8bytes on 64bit windows.