http://bugs.winehq.org/show_bug.cgi?id=16013
--- Comment #11 from Anastasius Focht focht@gmx.net 2009-01-06 14:54:00 --- Hello,
now that's some progress ;-) With sfc corrected and AJ's addition of updspapi.dll is looks a lot better.
Actually I didn't even think about adding updspapi.dll to Wine because it's neither documented in MSDN nor part of any (P)SDK hence my initial suggestion to leave that private M$ stuff alone (SEH)... Now I see the elegance of the solution but this also requires more work on setupapi. I'm sure you are already busy fixing setupapi :-)
In the meantime I provide another bugfix. In my analysis of the missing catroot folder/file problem (comment #8) I was a bit puzzled of that unusual exception handling (see the first trace log there).
It actually turns out the be a bug in Wine msvcrt._except_handler3().
To keep the story short: while looping through the scope table looking for filter/handlers, the new trylevel index must be taken from previousTryLevel of the current scope table entry. This also applies to the call_finally_block case.
E.g. pScopeTable->previousTryLevel should be corrected to pScopeTable[trylevel].previousTryLevel to have next try block filter/handler properly evaluated ...
Following shows the trace log with my correction (compare with comment #8 trace):
--- snip ---- 001f:Call KERNEL32.FindFirstFileW(006005d0 L"C:\windows\system32\CatRoot\{F750E6C3-38EE-11D1-85E5-00C04FC295EE}\*.cat",0032b348) ret=01085767 001f:Ret KERNEL32.FindFirstFileW() retval=ffffffff ret=01085767 001f:Call KERNEL32.GetLastError() ret=0108577a 001f:Ret KERNEL32.GetLastError() retval=00000003 ret=0108577a 001f:Call KERNEL32.GetLastError() ret=01085780 001f:Ret KERNEL32.GetLastError() retval=00000003 ret=01085780 001f:Call KERNEL32.RaiseException(e00bffff,00000000,00000000,00000000) ret=010857a6 001f:trace:seh:raise_exception code=e00bffff flags=0 addr=0x7b844f58 001f:trace:seh:raise_exception eax=7b82cc91 ebx=7b8c3940 ecx=00000000 edx=00000010 esi=0032b330 edi=0032b2b0 001f:trace:seh:raise_exception ebp=0032b298 esp=0032b234 cs=0023 ds=002b es=002b fs=0063 gs=006b flags=00000246 001f:trace:seh:call_stack_handlers calling handler at 0x1066099 code=e00bffff flags=0 001f:Call msvcrt._except_handler3(0032b244,0032b5a4,0032aed0,0032ad70) ret=7bc729a5 001f:trace:seh:_except_handler3 exception e00bffff flags=0 at 0x7b844f58 handler=0x1066099 0x32aed0 0x32ad70 semi-stub 001f:trace:seh:_except_handler3 reached TRYLEVEL_END, returning ExceptionContinueSearch 001f:Ret msvcrt._except_handler3() retval=00000001 ret=7bc729a5 001f:trace:seh:call_stack_handlers handler at 0x1066099 returned 1 001f:trace:seh:call_stack_handlers calling handler at 0x1066099 code=e00bffff flags=0 001f:Call msvcrt._except_handler3(0032b244,0032b5e0,0032aed0,0032ad70) ret=7bc729a5 001f:trace:seh:_except_handler3 exception e00bffff flags=0 at 0x7b844f58 handler=0x1066099 0x32aed0 0x32ad70 semi-stub 001f:trace:seh:_except_handler3 filter = 0x1086156 001f:trace:seh:_except_handler3 filter returned EXECUTE_HANDLER 001f:trace:seh:_global_unwind2 (0x32b5e0) 001f:Call ntdll.RtlUnwind(0032b5e0,00000000,00000000,00000000) ret=60660ffa 001f: eax=606586dd ebx=6068b808 ecx=00000000 edx=7bcb6648 esi=e00bffff edi=01066099 ebp=0032abc8 esp=0032abb0 ds=002b es=002b fs=0063 gs=006b flags=00000202 001f:trace:seh:__regs_RtlUnwind code=c0000027 flags=2 001f:trace:seh:__regs_RtlUnwind calling handler at 0x7bc3b2a8 code=c0000027 flags=2 001f:trace:seh:__regs_RtlUnwind handler at 0x7bc3b2a8 returned 1 001f:trace:seh:__regs_RtlUnwind calling handler at 0x1066099 code=c0000027 flags=2 001f:Call msvcrt._except_handler3(0032a600,0032b5a4,0032a830,0032a5ac) ret=7bc729a5 001f:trace:seh:_except_handler3 exception c0000027 flags=2 at 0x60660ffa handler=0x1066099 0x32a830 0x32a5ac semi-stub 001f:trace:seh:msvcrt_local_unwind2 (0x32b5a4,0,-1) 001f:Call ntdll.NtCurrentTeb() ret=60660d8c 001f:Ret ntdll.NtCurrentTeb() retval=7ffd8000 ret=60660d8c 001f:trace:seh:msvcrt_local_unwind2 __try block cleanup level 0 handler 0x10857f0 ebp 0x32b5b4 001f:Call KERNEL32.GetLastError() ret=01085198 001f:Ret KERNEL32.GetLastError() retval=00000003 ret=01085198 001f:Call ntdll.RtlFreeHeap(005c0000,00000000,006005d0) ret=010851a9 001f:Ret ntdll.RtlFreeHeap() retval=00000001 ret=010851a9 001f:Call KERNEL32.SetLastError(00000003) ret=010851b0 001f:Ret KERNEL32.SetLastError() retval=00000003 ret=010851b0 001f:trace:seh:msvcrt_local_unwind2 unwound OK 001f:trace:seh:_except_handler3 unwound current frame, returning ExceptionContinueSearch 001f:Ret msvcrt._except_handler3() retval=00000001 ret=7bc729a5 001f:trace:seh:__regs_RtlUnwind handler at 0x1066099 returned 1 001f:Ret ntdll.RtlUnwind() retval=00000000 ret=60660ffa 001f: eax=00000000 ebx=6068b808 ecx=00000000 edx=7bcb6648 esi=e00bffff edi=01066099 ebp=0032abc8 esp=0032abb0 ds=002b es=002b fs=0063 gs=006b flags=00000202 001f:trace:seh:msvcrt_local_unwind2 (0x32b5e0,1,0) 001f:Call ntdll.NtCurrentTeb() ret=60660d8c 001f:Ret ntdll.NtCurrentTeb() retval=7ffd8000 ret=60660d8c 001f:trace:seh:msvcrt_local_unwind2 __try block cleanup level 1 handler 0x1086149 ebp 0x32b5f0 001f:Call KERNEL32.HeapDestroy(005c0000) ret=01085c10 001f:Ret KERNEL32.HeapDestroy() retval=00000001 ret=01085c10 ... 001f:Call user32.MessageBoxA(00000000,010fd640 "Path not found\r\n",010b42e0 " Setup Error",00011010) ret=0106e226 --- snip ----
The handler now gets properly picked up and the exception is handled fine (message box). Unfortunately this means that the accidental "self-healing" of missing catroot folder/file is gone now. :-| The xmllite installer will display the message box and abort (which is correct).
If an addition to Wine install script is not feasible, a winetricks step might be a way to overcome this problem.
Regards