http://bugs.winehq.org/show_bug.cgi?id=17991
Summary: QueryPathOfRegTypeLib fails to locate typelib when (major.minor) = (0xffff.0xffff) Product: Wine Version: 1.1.18 Platform: Other OS/Version: other Status: UNCONFIRMED Severity: normal Priority: P2 Component: oleaut32 AssignedTo: wine-bugs@winehq.org ReportedBy: focht@gmx.net
Hello,
oleauto32.QueryPathOfRegTypeLib() doesn't work correctly when (major.minor) = (0xffff.0xffff). These parameters are passed by .NET Framework/CLR when regasm.exe utility is used to export and register typelibs from .NET assemblies. E.g. something like this:
--- snip --- $ wine regasm.exe foo.dll /codebase /tlb --- snip ---
WINEDEBUG=+tid,+seh,+ole,+reg
--- snip --- ... 0021:trace:typelib:QueryPathOfRegTypeLib ({00020430-0000-0000-c000-000000000046}, ffff.ffff, 0x0, 0x32d634) 0021:trace:reg:NtOpenKey (0x21c,L"Typelib\{00020430-0000-0000-C000-000000000046}",20019,0x32cfcc) 0021:trace:reg:NtOpenKey <- 0x22c 0021:trace:reg:RegEnumKeyExA (0x22c,0,0x32cfd4,0x32cfd0(16),(nil),(nil),(nil),(nil)) 0021:trace:ole:find_typelib_key found L"Typelib\{00020430-0000-0000-C000-000000000046}": 1.0 0021:trace:reg:RegEnumKeyExA (0x22c,1,0x32cfd4,0x32cfd0(16),(nil),(nil),(nil),(nil)) 0021:trace:ole:find_typelib_key found L"Typelib\{00020430-0000-0000-C000-000000000046}": 2.0 0021:trace:reg:RegEnumKeyExA (0x22c,2,0x32cfd4,0x32cfd0(16),(nil),(nil),(nil),(nil)) 0021:trace:ole:GetErrorInfo (0, 0x32cb70, (nil)) 0021:trace:ole:CreateErrorInfo (0x32aab8) 0021:trace:ole:IErrorInfoImpl_QueryInterface (0x1d4110)->( IID: {22f03340-547d-101b-8e65-08002b2bd119},0x32aab8) 0021:trace:ole:ICreateErrorInfoImpl_AddRef (0x1d4110) 0021:trace:ole:IErrorInfoImpl_AddRef (0x1d4110)->(count=1) 0021:trace:ole:IErrorInfoImpl_QueryInterface -- Interface: (0x32aab8)->(0x1d4114) 0021:trace:ole:IErrorInfoImpl_Release (0x1d4110)->(count=2) 0021:trace:ole:ICreateErrorInfoImpl_SetDescription (0x1d4110): L"Type library exporter encountered an error while processing 'SlingSDK'. Error: Common Language Runtime Internal error: 0x8002801d" 0021:trace:ole:ICreateErrorInfoImpl_SetHelpFile (0x1d4110,L"complib.hlp") 0021:trace:ole:ICreateErrorInfoImpl_SetHelpContext (0x1d4110,4451) 0021:trace:ole:ICreateErrorInfoImpl_QueryInterface (0x1d4110) 0021:trace:ole:IErrorInfoImpl_QueryInterface (0x1d4110)->( IID: {1cf2b120-547d-101b-8e65-08002b2bd119},0x32aab4) 0021:trace:ole:IErrorInfoImpl_AddRef (0x1d4110)->(count=1) 0021:trace:ole:IErrorInfoImpl_QueryInterface -- Interface: (0x32aab4)->(0x1d4110) 0021:trace:ole:SetErrorInfo (0, 0x1d4110) 0021:trace:ole:IErrorInfoImpl_AddRef (0x1d4110)->(count=2) 0021:trace:ole:ICreateErrorInfoImpl_Release (0x1d4110) 0021:trace:ole:IErrorInfoImpl_Release (0x1d4110)->(count=3) 0021:trace:ole:IErrorInfoImpl_Release (0x1d4110)->(count=2) 0021:trace:ole:GetErrorInfo (0, 0x32cb3c, 0x1d4110) 0021:trace:ole:IErrorInfoImpl_GetSource (0x1d4110)->(pBstrSource=0x1d4298) 0021:trace:ole:IErrorInfoImpl_GetDescription (0x1d4110)->(pBstrDescription=0x1d4294) 0021:trace:ole:IErrorInfoImpl_GetHelpFile (0x1d4110)->(pBstrHelpFile=0x1d429c) 0021:trace:ole:IErrorInfoImpl_GetHelpContext (0x1d4110)->(pdwHelpContext=0x1d42a0) 0021:trace:ole:IErrorInfoImpl_GetGUID (0x1d4110)->(count=1) 0021:trace:ole:IErrorInfoImpl_Release (0x1d4110)->(count=1) 0021:trace:ole:IErrorInfoImpl_Release -- destroying IErrorInfo(0x1d4110) 0021:trace:seh:raise_exception code=e06d7363 flags=1 addr=0x7b8437e8 ip=0x7b84386b tid=0021 0021:trace:seh:raise_exception info[0]=19930520 0021:trace:seh:raise_exception info[1]=0032cb1c 0021:trace:seh:raise_exception info[2]=7a35d570 0021:trace:seh:raise_exception eax=7b82ca2d ebx=7b8c2bf8 ecx=00000000 edx=00004000 esi=00004000 edi=00000000 0021:trace:seh:raise_exception ebp=0032ca98 esp=0032ca34 cs=0023 ds=002b es=002b fs=0063 gs=006b --- snip ---
MSDN doesn't mention such condition so this obviously needs some test case to find out what logic is used to select the best match (first? last? lowest? highest?).
dll/oleaut32/typelib.c:find_typelib_key() needs to be fixed accordingly. "wMaj" needs to be made an "out" parameter too to actually return best matching maj.min pair
With this part fixed it goes further - only to stumble into next bug ;-)
Regards