[PATCH 0/1] MR10416: oleaut32: Handle reference tables when processing SLTG records
https://bugs.winehq.org/show_bug.cgi?id=59549 When processing SLTG record structures, references to other structures were not handled correctly. That causes an error "err:typelib:sltg_get_typelib_ref Unable to find reference". I added the handling of references to the SLTG_ProcessRecord() function. as they were already in other functions available. Testing: 1) With MS Money 2000: before the bug fix several error were logged, with the fix applied the errors were gone. 2) I created a small IDL with a record type and a second nested record type that referenced the first record, compiled it to an SLTG-tlb using widl. Then I dumped the tlb before and after the fix with a small C program. The output before the fix showed the error message and a corrupted structure in the dump. After the fix, the error was not shown anymore and the nested record was fully shown. Please see details with logs in the bug. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10416
From: Wolfgang Hartl <wolfo.dev@wolke7.net> --- dlls/oleaut32/typelib.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index c4f00ca5bea..e9997a86d24 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -4345,7 +4345,17 @@ static void SLTG_ProcessRecord(char *pBlk, ITypeInfoImpl *pTI, const char *pNameTable, SLTG_TypeInfoHeader *pTIHeader, const SLTG_TypeInfoTail *pTITail, const BYTE *hlp_strings) { - SLTG_DoVars(pBlk, pBlk + pTITail->vars_off, pTI, pTITail->cVars, pNameTable, NULL, hlp_strings); + sltg_ref_lookup_t *ref_lookup = NULL; + + if (pTIHeader->href_table != 0xffffffff) + ref_lookup = SLTG_DoRefs((SLTG_RefInfo*)((char *)pTIHeader + pTIHeader->href_table), + pTI->pTypeLib, (char *)pNameTable); + + if (pTITail->vars_off != 0xffff) + SLTG_DoVars(pBlk, pBlk + pTITail->vars_off, pTI, pTITail->cVars, + pNameTable, ref_lookup, hlp_strings); + + free(ref_lookup); } static void SLTG_ProcessAlias(char *pBlk, ITypeInfoImpl *pTI, -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10416
This merge request was approved by Huw Davies. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10416
participants (3)
-
Huw Davies (@huw) -
Wolfgang Hartl -
Wolfgang Hartl (@wolfo.dev)