From: Dmitry Timoshkov dmitry@baikal.ru
Fixes regression introduced in 12c79c33a1d9c790201fe3631238c9277424771f.
Signed-off-by: Dmitry Timoshkov dmitry@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);
From: Dmitry Timoshkov dmitry@baikal.ru
typeinfo count in an SLTG typelib is written right before typeinfo blocks.
Signed-off-by: Dmitry Timoshkov dmitry@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;
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.
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.
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.
This merge request was approved by Huw Davies.
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.
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.