WINED3D: Implement GetCreationParameters
p.beutner at gmx.net
Wed Mar 8 07:08:52 CST 2006
Francois Gouget schrieb:
> * or the application does not pass a NULL here because it would cause
> it to crash on Windows. But if we merely return an error the application
> will merrily go on, only to crash or report that DirectX does not work a
> while later. By then the source of the problem will be very hard to find
> due to all that happened since this function call.
> The point is that we need to fix the bug that causes the application
> to pass a NULL to Wine in the first place. And the best way to spot it,
> and thus fix it, is if Wine segfaults in the same way as Windows when
> given a NULL.
The whole point of my email was that a crash here doesn't help you
to find the real problem. It only says you that the function was called with a
NULL pointer as parameter.
Well, grepping through the trace log where a DirectX function returned an error
most probably will get you the same result. And with the ERR() message that
was in the original patch it would have been even easier to spot.
Anyway both cases do _not_ tell you where things went wrong in the first place.
You have to work through the whole trace log before that call to check
where something wrong could have been returned.
It might be even a bug in the application itself (e.g. forgotten check after malloc),
who knows ...
Or look at it from the view of a user developing a winelib application. I'm sure
he will very much appreciate it when wine does a better parameter checking than MS
and returns an error instead of a crash backtrace ;)
Imo a library is supposed to validate given parameters as much as possible and
rather return an error to the caller than to crash.
But as the patch already was commited, I think any further discussion is pointless.
More information about the wine-devel