| 02b513ef | 25-Jul-2026 |
Peter Kovacs <petko@apache.org> |
sal/vcl: Win64 (x64) runtime source fixes -- thread key + window pointers
Pointer-width fixes on the runtime boot path (all compile unchanged on x86; dmake-backportable):
- sal osl/thread.h: oslThr
sal/vcl: Win64 (x64) runtime source fixes -- thread key + window pointers
Pointer-width fixes on the runtime boot path (all compile unchanged on x86; dmake-backportable):
- sal osl/thread.h: oslThreadKey sal_uInt32 -> sal_uIntPtr. The w32 osl_createThreadKey returns a heap PTLS* stuffed into the key; on LLP64 that 64-bit pointer was truncated, so osl_getThreadKeyData dereferenced garbage (first crash: cppu getIdContainer during InitVCL). Not present in origin/windows-amd64 (their thread.h/.c match trunk) -- authored here. - vcl win/saldata: ImplSet/GetWindowLong -> LONG_PTR + Set/GetWindowLongPtrW, SetWindowPtr/SetSalObjWindowPtr (LONG)->(LONG_PTR) (frame pointer stored in the window's extra bytes was truncated -> sign-extended garbage in UpdateFrameGeometry) (ref 9b64d14c8d); SAL_FRAME/OBJECT_WNDEXTRA sizeof(DWORD) -> sizeof(ULONG_PTR) so the 8-byte pointer fits the reserve (added beyond the reference, which relied on Windows over-allocating); ImplSendMessage BOOL -> LRESULT (WinSalInstance::CreateFrame/CreateObject route the new SalFrame*/SalObject* back as the SAL_MSG_CREATE* message result -- BOOL truncated it, causing an AV in SalFrame::SetCallback; also fixes the latent HDC/HWND truncations at the other call sites).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> (cherry picked from commit cc0a3ed6d1e1f10040e030b974c4b0ab9c6fbf17) (cherry picked from commit 1ac44d4c16cd8c7fb00879e708b1c066c88ccc26)
show more ...
|