[PATCH 0/2] MR7383: oleaut32: Add missing fixup for SLTG typename offset.
From: Dmitry Timoshkov <dmitry(a)baikal.ru> Fixes regression introduced in 12c79c33a1d9c790201fe3631238c9277424771f. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> --- dlls/oleaut32/typelib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 74fd03cb787..42f4e95b938 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -4556,7 +4556,7 @@ static ITypeLib2* ITypeLib2_Constructor_SLTG(LPVOID pLib, DWORD dwTLBLength) pOtherTypeInfoBlks[i].other_name[w] = '\0'; } pOtherTypeInfoBlks[i].res1a = *(WORD*)(ptr + len + 4); - pOtherTypeInfoBlks[i].name_offs = *(WORD*)(ptr + len + 8); + pOtherTypeInfoBlks[i].name_offs = *(WORD*)(ptr + len + 6); extra = pOtherTypeInfoBlks[i].hlpstr_len = *(WORD*)(ptr + 8 + len); if(extra) { pOtherTypeInfoBlks[i].extra = malloc(extra); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7383
From: Dmitry Timoshkov <dmitry(a)baikal.ru> typeinfo count in an SLTG typelib is written right before typeinfo blocks. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> --- dlls/oleaut32/typelib.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 42f4e95b938..c4f00ca5bea 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -4485,9 +4485,6 @@ static ITypeLib2* ITypeLib2_Constructor_SLTG(LPVOID pLib, DWORD dwTLBLength) return NULL; } - /* There are pHeader->nrOfFileBlks - 2 TypeInfo records in this typelib */ - pTypeLibImpl->TypeInfoCount = pHeader->nrOfFileBlks - 2; - /* This points to pHeader->nrOfFileBlks - 1 of SLTG_BlkEntry */ pBlkEntry = (SLTG_BlkEntry*)(pHeader + 1); @@ -4508,7 +4505,7 @@ static ITypeLib2* ITypeLib2_Constructor_SLTG(LPVOID pLib, DWORD dwTLBLength) pIndex = (SLTG_Index*)(pMagic+1); - pPad9 = (SLTG_Pad9*)(pIndex + pTypeLibImpl->TypeInfoCount); + pPad9 = (SLTG_Pad9*)(pIndex + pHeader->nrOfFileBlks - 2); pFirstBlk = pPad9 + 1; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7383
Huw Davies (@huw) commented about dlls/oleaut32/typelib.c:
return NULL; }
- /* There are pHeader->nrOfFileBlks - 2 TypeInfo records in this typelib */ Could we keep this comment? Move it to where you now use `pHeader->nrOfFileBlks - 2` below.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/7383#note_95318
On Thu Feb 20 10:59:59 2025 +0000, Huw Davies wrote:
Could we keep this comment? Move it to where you now use `pHeader->nrOfFileBlks - 2` below. This comment is misleading: typeinfo count in an SLTG typelib is written separately right before the typeinfo blocks.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/7383#note_95319
On Thu Feb 20 11:03:33 2025 +0000, Dmitry Timoshkov wrote:
This comment is misleading: typeinfo count in an SLTG typelib is written separately right before the typeinfo blocks. Right, fair enough. It's all a little bit magic, but that's likely because we don't quite understand the format.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/7383#note_95323
This merge request was approved by Huw Davies. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7383
On Thu Feb 20 11:10:59 2025 +0000, Huw Davies wrote:
Right, fair enough. It's all a little bit magic, but that's likely because we don't quite understand the format. We could use the logic implemented in winedump, but that probably doesn't worth an effort.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/7383#note_95325
On Thu Feb 20 11:14:00 2025 +0000, Dmitry Timoshkov wrote:
We could use the logic implemented in winedump, but that probably doesn't worth an effort. I certainly wouldn't object to doing something like that, but that needn't block this MR.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/7383#note_95327
participants (3)
-
Dmitry Timoshkov -
Dmitry Timoshkov (@dmitry) -
Huw Davies (@huw)