Alexandre Julliard schrieb:
I fail to see in how far returning an error is hiding a bug. Imho if the library detects an error[*] it should pass the information to the application and let the application handle it. The library doesn't know if the application maybe can cope with it. Just ultimately crash is a bad idea imo.
Many applications ignore returned error codes (especially if you have to call GetLastError()) if the programmer was under the assumption that there will be never a possibility to cause an error. While this assumption may be true on Windows (or at least a certain Windows version the programmer has tested on) it is certainly not necessarily true in Wine. There could have been a Wine call just before, that was wrongly implemented, returning an invalid pointer or such. Just returning an error may hide that error for many lines, to crash in some much more unrelated area eventually. Tracking such dependant error causes is already hard enough and hiding an invalid pointer access or other invalid parameter by checking for its validness makes it even harder if an application doesn't ridicully check every possible error condition and believe me I haven't seen many programs that really do that.
Crashing may be not what most end users very much like but it is in my opinion just as fine than displaying a dialog box that an unrecoverable error has occurred and that it must shut down and much better than relying on the application to actually do proper error checking, but it makes the life of every Wine programmer just a little bit easier and Wine still being far from a release state can use any help on the programmer side.
Wine's policy is to do parameter checking only if Windows is doing it in all versions too and sometimes even then only when there is at least one application that depends on it to work properly.
Lets look at the example at hand. There is a function that does not check the pointer in Windows. If an application crashes in that function because of that, this means basically that the application did not do proper pointer checking already and then it is very questionable that it would check the error indication of that function at all, since it wouldn't get such an error indication on Windows anyhow.
Also this application will either crash on Windows too, and then it is the programmers problem to make this application behave better or it does not crash on Windows because some previous function does behave differently than the Wine equivalent and then every wine programmer would like to know as soon as possible that this error occurres, not 5000 lines further down the program.
If you would talk about a stable and final Wine release (which with Wine chasing the Windows API propably never will be) this might be a little different but we talk about a software project heavily under development.
Rolf Kalbermatter
Rolf Kalbermatter rolf.kalbermatter@citeng.com writes:
Alexandre Julliard schrieb:
I fail to see in how far returning an error is hiding a bug. Imho if the library detects an error[*] it should pass the information to the application and let the application handle it. The library doesn't know if the application maybe can cope with it. Just ultimately crash is a bad idea imo.
Please be careful with how you quote text, I didn't write that, Peter did.
Alexandre Julliard wrote:
Rolf Kalbermatter rolf.kalbermatter@citeng.com writes:
Alexandre Julliard schrieb:
I fail to see in how far returning an error is hiding a bug. Imho if the library detects an error[*] it should pass the information to the application and let the application handle it. The library doesn't know if the application maybe can cope with it. Just ultimately crash is a bad idea imo.
Please be careful with how you quote text, I didn't write that, Peter did.
Sorry about that. The first draft contained the entire communication and was syntactially correct but unnecessary long. When trimming it down I messed up the quote line.
Will try to not do this again in the future.
Rolf Kalbermatter