Hello list, I am trying to get Settlers 3(Siedler 3) working. This game crashes with a Integer divide by 0 exception very early.
Wine version: cvs from September 7. 2004 Settlers 3 version: 1.60 with WinXp-patch.
s3.exe produces a nice crash dump(attached errorlog.txt) and with a little debugging I found out that the crash occurs in RtlEnlargedUnsignedDivide(), file dlls/ntdll/large_int.c
This is what I think is going on: *)s3.exe calls SetWaitableTimer() in dlls/kernel/sync.c
*)NtSetTimer() in dlls/ntdll/sync.c is called, and this is where the problem beginns. NtSetTimer() calls NTDLL_get_server_timeout from time.c
*)The 2nd case occurs(the else if) and RtlEnlargedUnsignedDivide is called. The interesting thing is that TICKSPERSEC is a constant(10000000) and this shouldn't give a divide by zero. But RtlEnlargedUnsignedDivide takes an UINT as 2nd arguemt, and 10000000 is too big for an UINT.
For testing I enabled the C version of RtlEnlargedUnsignedDivide, and this time the exception didn't occur but wineserver blocked(kill -9 was necessary) The same thing happens if I move the divison to NTDLL_get_server_timeout(and do not call RtlEnlargedUnsignedDivide).
I commented the call to NTDLL_get_server_timeout, and s3.exe starts successfully, but I don't think that's the correct way to solve this problem.
I attached the output with normal debug options and a few TRACEs changed to ERRs. NTDLL_get_server_timeout is called quite often.
The SetWaitableTimer call: err:ntdll:SetWaitableTimer called err:ntdll:NtSetTimer (0xf4,0x46d32104,(nil),(nil),00000000,0x000001f4,(nil)) stub err:ntdll:NTDLL_get_server_timeout called err:ntdll:NTDLL_get_server_timeout called err:ntdll:NTDLL_get_server_timeout called ... fixme:dialog:MSGBOX_OnInit system modal msgbox ! Not modal yet. -- The crash message
err:ntdll:NTDLL_get_server_timeout called err:ntdll:NTDLL_get_server_timeout called
Greetings, Stefan Dösinger