On Sat, Jul 23, 2005 at 10:22:09AM +0200, Alexandre Julliard wrote:
Glenn Wurster gwurster@scs.carleton.ca writes:
GDI is a very good example of the problem of throwing an exception where the application never intended one to be thrown. If ESP is bad we clobber something. GDI, however, is not the only example. If we fix it so that GDI does not throw exceptions, then we have to fix it so that we only throw exceptions when windows throws exceptions. Nothing more, nothing less - otherwise we have the issue of potentially having a bad ESP and clobbering something. The issue of never throwing an exception unless Windows would have is a larger problem and involves more than just GDI code. We can't enforce ESP usage on windows programs, so we have to come to terms with the fact that they may not use the ESP register as we would like.
Sure, but that's a very rare case, since messing with ESP means you can't debug the code on Windows either. It would of course be possible to use a separate stack for exceptions, in fact we used to do that, but it has other problems and it's not how Windows does it.
Actually, you can debug the code on Windows. Visual Studio lets you set breakpoints and single step through it quite nicely. I did that (on an XP computer at least) while examining this problem to see what the Windows behaviour was. I got no complaints. The only difference was that the applications exception handler would not be called. I don't know exactly how Windows does does the exception handling. It would be nice if Wine did not totally crash though.
So yes, the general rule is to avoid having exceptions where Windows doesn't. Things like DOS memory could be fixed if we found an app that really breaks because of that, but until we do I wouldn't worry too much about it.
I'll try and develop a patch for the current GDI engine so at least things work since it sounds like things are a long way off on any sort of new engine. If someone is indeed working on a new GDI engine, than I'd be interested in finding out more and perhaps helping out, although I don't have a lot of time on my hands.
Glenn.