Browse Source

* fix win32,win64 parts, fixes #40439. All records to under pshpack4 in header.

marcoonthegit 1 year ago
parent
commit
e084d3259f
2 changed files with 3 additions and 3 deletions
  1. 2 2
      packages/winunits-base/src/richedit.pp
  2. 1 1
      rtl/win/wininc/struct.inc

+ 2 - 2
packages/winunits-base/src/richedit.pp

@@ -19,7 +19,7 @@ uses Messages, Windows;
 {$ENDIF FPC_DOTTEDUNITS}
 
 {$IFDEF FPC}
-{$PACKRECORDS C}
+{$PACKRECORDS 4} // MS header contains pshpack4 under ifdef win32
 {$ENDIF}
 
 Const
@@ -700,7 +700,7 @@ Const
 
      EDITSTREAMCALLBACK = function (dwCookie:DWORD_PTR; pbBuff:LPBYTE; cb:LONG; var pcb:LONG):DWORD;
 
-     _editstream = record
+     _editstream = packed record
           dwCookie : DWORD_PTR;
           dwError : DWORD;
           pfnCallback : EDITSTREAMCALLBACK;

+ 1 - 1
rtl/win/wininc/struct.inc

@@ -2535,7 +2535,7 @@ Const
      TDRIVERINFO3 = DRIVER_INFO_3;
      PDRIVERINFO3 = ^DRIVER_INFO_3;
 
-     EDITSTREAM = record
+     EDITSTREAM = packed record
           dwCookie : DWORD_PTR;
           dwError : DWORD;
           pfnCallback : EDITSTREAMCALLBACK;