> On Fr, 2006-11-03 at 11:42 -0500, [EMAIL PROTECTED] wrote:
>> Finally, I managed to figure out the proper fix for the crash on
>> regsvr32 msvbvm60.dll
>
> Great!
> Thanks for your investigation.
>
> I have no Idea about ole, but...
>
>> MESSAGE("\thelpstring: %s\n", debugstr_w(pfd->HelpString));
>> - MESSAGE("\tentry: %s\n", debugstr_w(pfd->Entry));
>> + if (HIWORD(pfd->Entry) == 0)
>> + MESSAGE("\tentry (ordinal): 0x%04x\n", (INT)pfd->Entry);
>> + else if (pfd->Entry != (void *)-1)
>> + MESSAGE("\tentry (string): %s\n", debugstr_w(pfd->Entry));
>> + else
>> + MESSAGE("\tentry (invalid): -1\n");
>
> Pointers with "HIWORD() == 0" are already handled by debugstr_w().
> You will get a "#" followed by the number.
>
> I suggest to reuse the old code:
> MESSAGE("\tentry: %s\n", (entry == -1) ? "-1 (invalid)" :
> debugstr_w(pfd->Entry));
>
> Another Idea is to check only for "-1" and use
> the previous code unmodified for all other cases.
>
>
> --
>
> By by ... Detlef
>
>
>
>
New version of the patch, with suggested changes.
Changelog:
* Fix regression on MSFT typelib parsing of function records by allocating
a string copy only when indicated by FKCCIC flag, and preserving the
meaning of value as function ordinal otherwise.
Alex VillacĂs Lasso
--- wine-0.9.24-cvs/dlls/oleaut32/typelib.c 2006-11-03 17:34:09.000000000 -0500
+++ wine-0.9.24-cvs-patch/dlls/oleaut32/typelib.c 2006-11-03 17:36:35.000000000 -0500
@@ -1173,7 +1173,7 @@
dump_FUNCDESC(&(pfd->funcdesc));
MESSAGE("\thelpstring: %s\n", debugstr_w(pfd->HelpString));
- MESSAGE("\tentry: %s\n", debugstr_w(pfd->Entry));
+ MESSAGE("\tentry: %s\n", (pfd->Entry == (void *)-1) ? "invalid" : debugstr_w(pfd->Entry));
}
static void dump_TLBFuncDesc(const TLBFuncDesc * pfd)
{
@@ -1813,7 +1813,9 @@
{
if ( pFuncRec->FKCCIC & 0x2000 )
{
- (*pptfd)->Entry = SysAllocString((WCHAR*)pFuncRec->OptAttr[2]);
+ if (HIWORD(pFuncRec->OptAttr[2]) != 0)
+ ERR("ordinal 0x%08x invalid, HIWORD != 0\n", pFuncRec->OptAttr[2]);
+ (*pptfd)->Entry = (BSTR)pFuncRec->OptAttr[2];
}
else
{
@@ -1832,6 +1834,10 @@
}
}
}
+ else
+ {
+ (*pptfd)->Entry = (BSTR)-1;
+ }
}
}
@@ -4437,7 +4443,8 @@
pCustDataNext = pCustData->next;
TLB_Free(pCustData);
}
- SysFreeString(pFInfo->Entry);
+ if (HIWORD(pFInfo->Entry) != 0 && pFInfo->Entry != (BSTR)-1)
+ SysFreeString(pFInfo->Entry);
SysFreeString(pFInfo->HelpString);
SysFreeString(pFInfo->Name);