Re: WINED3D: Implement GetCreationParameters

2006-03-09 Thread Peter Beutner
Alexandre Julliard schrieb: > Your mistake is to assume that the app will handle the error in a sane > way. That's extremely unlikely, especially for things like bad > pointers since the app obviously didn't expect to be passing bad > pointers. If the app really wants to handle that sort of error i

RE: WINED3D: Implement GetCreationParameters

2006-03-09 Thread Rolf Kalbermatter
Alexandre Julliard wrote: > Rolf Kalbermatter <[EMAIL PROTECTED]> 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 applicati

Re: WINED3D: Implement GetCreationParameters

2006-03-09 Thread Alexandre Julliard
Rolf Kalbermatter <[EMAIL PROTECTED]> 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

Re: WINED3D: Implement GetCreationParameters

2006-03-09 Thread Rolf Kalbermatter
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 ulti

Re: WINED3D: Implement GetCreationParameters

2006-03-08 Thread Francois Gouget
On Wed, 8 Mar 2006, Peter Beutner wrote: 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.

Re: WINED3D: Implement GetCreationParameters

2006-03-08 Thread Alexandre Julliard
Peter Beutner <[EMAIL PROTECTED]> writes: > Just take the example you have written something in Office and the given > behaviour(passing a > NULL pointer) happens when you click on the print button. If it crashes your > work is lost, if > it returns an error( and the app handles it in a sane way

Re: WINED3D: Implement GetCreationParameters

2006-03-08 Thread Peter Beutner
Hi Andreas Mohr schrieb: > Hi, > Can you mention an example of Windows popping up an error message "function > foo baz called with invalid parameter ..., what do you want me to do?". > See? Me neither... heh, the message will more likely looks like "Failed to initialize {Direct3D/DirectDraw/OpenGL

Re: WINED3D: Implement GetCreationParameters

2006-03-08 Thread Peter Beutner
Alexandre Julliard schrieb: > Peter Beutner <[EMAIL PROTECTED]> writes: > >> 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 ba

Re: WINED3D: Implement GetCreationParameters

2006-03-08 Thread Andreas Mohr
Hi, On Wed, Mar 08, 2006 at 03:49:55PM +0100, Peter Beutner wrote: > Hi > Andreas Mohr schrieb: > > We're not a library.We're a very, very, very, very specific piece of > > software > Well, I remember I was told that wine is just another gui toolkit like gtk+ > or qt *scnr*. Good memory ;) Howev

Re: WINED3D: Implement GetCreationParameters

2006-03-08 Thread Peter Beutner
Hi Andreas Mohr schrieb: > On Wed, Mar 08, 2006 at 02:08:52PM +0100, Peter Beutner wrote: >> Imo a library is supposed to validate given parameters as much as possible >> and >> rather return an error to the caller than to crash. > We're not a library.We're a very, very, very, very specific piece

Re: WINED3D: Implement GetCreationParameters

2006-03-08 Thread Alexandre Julliard
Peter Beutner <[EMAIL PROTECTED]> writes: > 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 suppose

Re: WINED3D: Implement GetCreationParameters

2006-03-08 Thread Andreas Mohr
Hi, On Wed, Mar 08, 2006 at 02:08:52PM +0100, Peter Beutner wrote: > Imo a library is supposed to validate given parameters as much as possible and > rather return an error to the caller than to crash. We're not a library. We're a very, very, very, very specific piece of software that is required

Re: WINED3D: Implement GetCreationParameters

2006-03-08 Thread Kuba Ober
> 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 ;) Ooooh, don't I smell bait-and-switch here? :) Always good to learn from you

Re: WINED3D: Implement GetCreationParameters

2006-03-08 Thread Peter Beutner
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 wi

Re: WINED3D: Implement GetCreationParameters

2006-03-08 Thread Francois Gouget
On Tue, 7 Mar 2006, Peter Beutner wrote: [...] Unless some app relies on this crashing behaviour(which I doubt), I don't think wine should implement bugs just because MS does it. Seems a bit obscure strategy to me to crash in case of an error instead of proper error checking/reporting. This h

Re: WINED3D: Implement GetCreationParameters

2006-03-07 Thread Vitaliy Margolen
Tuesday, March 7, 2006, 3:22:28 PM, Peter Beutner wrote: > H. Verbeet schrieb: >> On 07/03/06, Ivan Gyurdiev <[EMAIL PROTECTED]> wrote: >>> This doesn't really make sense to me - the point of unspecified behavior >>> if a parameter is NULL would be to speed up the function under contract >>> with t

Re: WINED3D: Implement GetCreationParameters

2006-03-07 Thread Peter Beutner
H. Verbeet schrieb: > On 07/03/06, Ivan Gyurdiev <[EMAIL PROTECTED]> wrote: >> This doesn't really make sense to me - the point of unspecified behavior >> if a parameter is NULL would be to speed up the function under contract >> with the caller. If you're already doing the check, why not handle it

Re: WINED3D: Implement GetCreationParameters

2006-03-07 Thread H. Verbeet
On 07/03/06, Ivan Gyurdiev <[EMAIL PROTECTED]> wrote: > This doesn't really make sense to me - the point of unspecified behavior > if a parameter is NULL would be to speed up the function under contract > with the caller. If you're already doing the check, why not handle it in > some way other than

Re: WINED3D: Implement GetCreationParameters

2006-03-07 Thread Robert Reif
H. Verbeet wrote: On 07/03/06, Stefan Dösinger <[EMAIL PROTECTED]> wrote: Native D3D crashes if it's called with a NULL pointer? Are you sure that you shouldn't return something like D3DERR_INVALIDCALL if pParamters == NULL? Yes. I verified that with DirectX 9.0c on win2k

Re: WINED3D: Implement GetCreationParameters

2006-03-07 Thread Ivan Gyurdiev
H. Verbeet wrote: On 07/03/06, Stefan Dösinger <[EMAIL PROTECTED]> wrote: Native D3D crashes if it's called with a NULL pointer? Are you sure that you shouldn't return something like D3DERR_INVALIDCALL if pParamters == NULL? Yes. I verified that with DirectX 9.0c on win2k. This doesn

Re: WINED3D: Implement GetCreationParameters

2006-03-07 Thread H. Verbeet
On 07/03/06, Stefan Dösinger <[EMAIL PROTECTED]> wrote: > Native D3D crashes if it's called with a NULL pointer? Are you sure that you > shouldn't return something like D3DERR_INVALIDCALL if pParamters == NULL? Yes. I verified that with DirectX 9.0c on win2k.

Re: WINED3D: Implement GetCreationParameters

2006-03-07 Thread Stefan Dösinger
Am Dienstag, 7. März 2006 08:50 schrieb H. Verbeet: > On 07/03/06, Ivan Gyurdiev <[EMAIL PROTECTED]> wrote: > > > +if (!pParameters) { > > > +ERR("(%p) : Called with a NULL pParameters\n", This); > > > +} > > > + > > > +*pParameters = This->createParms; > > > > This is dereferen

Re: WINED3D: Implement GetCreationParameters

2006-03-06 Thread H. Verbeet
On 07/03/06, Ivan Gyurdiev <[EMAIL PROTECTED]> wrote: > > > +if (!pParameters) { > > +ERR("(%p) : Called with a NULL pParameters\n", This); > > +} > > + > > +*pParameters = This->createParms; > > > This is dereferencing a NULL pointer. Yes. Native d3d does that as well. The NULL

Re: WINED3D: Implement GetCreationParameters

2006-03-06 Thread Ivan Gyurdiev
+if (!pParameters) { +ERR("(%p) : Called with a NULL pParameters\n", This); +} + +*pParameters = This->createParms; This is dereferencing a NULL pointer.