Re : Re : Re : ddraw [try 2]: SetCooperativeLevel with Full screen + exclusive + normal is authorized
Added new tests for d3d7. No change. All the tests passed on real Vista David De : Stefan Dösinger À : paulo lesgaz Cc : wine-devel@winehq.org Envoyé le : Mar 24 août 2010, 20h 00min 05s Objet : Re: Re : Re : ddraw [try 2]: SetCooperativeLevel with Full screen + exclusive + normal is authorized Am 24.08.2010 um 17:48 schrieb paulo lesgaz: Is this patch correct to test d3d7 and d3d2 SetCooperativeLevel? >For now, all the tests pass on a real vista box. >Actually, I missed something: The exising test tests IDirectDraw, not >IDirectDraw7. So it is testing the oldest ddraw interface. Can you test >IDirectDraw7 instead of IDirectDraw2? If microsoft added extra sanity checks >they did so most likely in the newer interfaces. From 887ed87355ba8d531cb1bdefe19b4451d083ed8d Mon Sep 17 00:00:00 2001 From: David Adam Date: Tue, 24 Aug 2010 20:35:32 +0200 Subject: SetCooperativeLevel with Full screen + exclusive + normal is authorized --- dlls/ddraw/ddraw.c|8 +- dlls/ddraw/tests/ddrawmodes.c | 158 - 2 files changed, 159 insertions(+), 7 deletions(-) diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index af5eb37..3aa05bc 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -621,13 +621,13 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd, This->devicewindow = NULL; } } -/* DDSCL_NORMAL or DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE */ +/* DDSCL_NORMAL */ if(cooplevel & DDSCL_NORMAL) { -/* Can't coexist with fullscreen or exclusive */ -if(cooplevel & (DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE) ) +/* Can't coexist with exclusive only*/ +if(cooplevel == (DDSCL_NORMAL | DDSCL_EXCLUSIVE) ) { -TRACE("(%p) DDSCL_NORMAL is not compative with DDSCL_FULLSCREEN or DDSCL_EXCLUSIVE\n", This); +TRACE("(%p) DDSCL_NORMAL is not compative with DDSCL_EXCLUSIVE only \n", This); LeaveCriticalSection(&ddraw_cs); return DDERR_INVALIDPARAMS; } diff --git a/dlls/ddraw/tests/ddrawmodes.c b/dlls/ddraw/tests/ddrawmodes.c index 8235d86..cbe46b5 100644 --- a/dlls/ddraw/tests/ddrawmodes.c +++ b/dlls/ddraw/tests/ddrawmodes.c @@ -558,11 +558,46 @@ static void testcooperativelevels_normal(void) surfacedesc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; /* Do some tests with DDSCL_NORMAL mode */ - + +/* Fullscreen mode + normal mode + exclusive mode */ +rc = IDirectDraw_SetCooperativeLevel(lpDD, +hwnd, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE | DDSCL_NORMAL); +ok(rc==DD_OK,"SetCooperativeLevel(DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE | DDSCL_NORMAL) returned: %x\n",rc); +/* Try creating a double buffered primary in fullscreen + exclusive + normal mode */ +rc = IDirectDraw_CreateSurface(lpDD, &surfacedesc, &surface, NULL); +if (rc == DDERR_UNSUPPORTEDMODE) +skip("Unsupported mode\n"); +else +{ +ok(rc == DD_OK, "IDirectDraw_CreateSurface returned %08x\n", rc); +ok(surface!=NULL, "Returned NULL surface pointer \n"); +} +if(surface && surface != (IDirectDrawSurface *)0xdeadbeef) IDirectDrawSurface_Release(surface); + +/* Exclusive mode + normal mode */ +rc = IDirectDraw_SetCooperativeLevel(lpDD, +hwnd, DDSCL_EXCLUSIVE | DDSCL_NORMAL); +ok(rc==DDERR_INVALIDPARAMS,"SetCooperativeLevel(DDSCL_EXCLUSIVE | DDSCL_NORMAL) returned: %x\n",rc); + +/* Fullscreen mode + normal mode */ +rc = IDirectDraw_SetCooperativeLevel(lpDD, +hwnd, DDSCL_FULLSCREEN | DDSCL_NORMAL); +ok(rc==DD_OK,"SetCooperativeLevel(DDSCL_FULLSCREEN | DDSCL_NORMAL) returned: %x\n",rc); +/* Try creating a double buffered primary in fullscreen + normal mode */ +rc = IDirectDraw_CreateSurface(lpDD, &surfacedesc, &surface, NULL); +if (rc == DDERR_UNSUPPORTEDMODE) +skip("Unsupported mode\n"); +else +{ +ok(rc == DDERR_NOEXCLUSIVEMODE, "IDirectDraw_CreateSurface returned %08x\n", rc); +ok(surface == NULL, "Returned surface pointer is %p\n", surface); +} +if(surface && surface != (IDirectDrawSurface *)0xdeadbeef) IDirectDrawSurface_Release(surface); + +/* Normal mode */ rc = IDirectDraw_SetCooperativeLevel(lpDD, hwnd, DDSCL_NORMAL); ok(rc==DD_OK,"SetCooperativeLevel(DDSCL_NORMAL) returned: %x\n",rc); - /* Try creating a double buffered primary in normal mode */ rc = IDirectDraw_CreateSurface(lpDD, &surfacedesc, &surface, NULL); if (rc == DDERR_UNSUPPORTEDMODE) @@ -664,7 +699,7 @@ static void testcooperativelevels_exclusive(void) rc = IDirectDraw_SetCoopera
Re: Re : Re : ddraw [try 2]: SetCooperativeLevel with Full screen + exclusive + normal is authorized
Am 24.08.2010 um 17:48 schrieb paulo lesgaz: > Is this patch correct to test d3d7 and d3d2 SetCooperativeLevel? > For now, all the tests pass on a real vista box. Actually, I missed something: The exising test tests IDirectDraw, not IDirectDraw7. So it is testing the oldest ddraw interface. Can you test IDirectDraw7 instead of IDirectDraw2? If microsoft added extra sanity checks they did so most likely in the newer interfaces.
Re : Re : ddraw [try 2]: SetCooperativeLevel with Full screen + exclusive + normal is authorized
Is this patch correct to test d3d7 and d3d2 SetCooperativeLevel? For now, all the tests pass on a real vista box. David De : Stefan Dösinger À : paulo lesgaz Cc : wine-devel@winehq.org Envoyé le : Mar 24 août 2010, 16h 44min 38s Objet : Re: Re : ddraw [try 2]: SetCooperativeLevel with Full screen + exclusive + normal is authorized I think those tests should do, but have a few spelling issues and you're not releasing the surface. So if I understand things correctly: *) NORMAL | FULLSCREEN | EXCLUSIVE -> fullscreen mode *) NORMAL | EXCLUSIVE -> error *) NORMAL | FULLSCREEN -> windowed mode For testing older ddraw interface vesions you can QueryInterface the ddraw object for IID_IDirectDraw, IID_IDirectDraw2(and ddraw3 and ddraw4). Then you run the same tests on those. I am pretty sure the check that NORMAL mode is mutually exclusive with FULLSCREEN/EXCLUSIVE already existed in old ddraw, and is motivated by a statement in msdn that those modes are mutually exclusive - which makes sense, you can't be in fullscreen mode and not be in fullscreen mode at the same time. It seems that one flag is ignored rather than an error returned. On a general note, I am away from home the next weeks. I expect to be able to read mail, but it will me sporadic(ok, I haven't been reliable in the past few weeks either) Am 24.08.2010 um 15:26 schrieb paulo lesgaz: Such tests are what you were thinking about? >They all passed on my real vista box. > >David > > > > > > De : Stefan Dösinger >À : wine-devel@winehq.org >Envoyé le : Mar 24 août 2010, 11h 30min 59s >Objet : Re: ddraw [try 2]: SetCooperativeLevel with Full screen + exclusive + >normal is authorized > >Hi, >Can you add a test that tests in which mode ddraw is after such a call? >Specfically, try to create a double buffered primary surface. If this >succeeds, >ddraw is in fullscreen mode. If ddraw is in normal mode you'll get >DDERR_NOEXCLUSIVEMODE (or similar) back. > >Am 24.08.2010 um 10:00 schrieb David Adam: > >> Fixed a typo >> >> A+ >> >> David >> <0001-SetCooperativeLevel-with-Full-screen-exclusive-norma.patch> > > > > ><0001-SetCooperativeLevel-with-Full-screen-exclusive-norma.patch> From b2ac1b3ad7d53633180f75dc9de489d626552a05 Mon Sep 17 00:00:00 2001 From: David Adam Date: Tue, 24 Aug 2010 17:43:24 +0200 Subject: SetCooperativeLevel with Full screen + exclusive + normal is authorized --- dlls/ddraw/ddraw.c|8 ++-- dlls/ddraw/tests/ddrawmodes.c | 107 +++- 2 files changed, 108 insertions(+), 7 deletions(-) diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 572c790..8102054 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -621,13 +621,13 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd, This->devicewindow = NULL; } } -/* DDSCL_NORMAL or DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE */ +/* DDSCL_NORMAL */ if(cooplevel & DDSCL_NORMAL) { -/* Can't coexist with fullscreen or exclusive */ -if(cooplevel & (DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE) ) +/* Can't coexist with exclusive only*/ +if(cooplevel == (DDSCL_NORMAL | DDSCL_EXCLUSIVE) ) { -TRACE("(%p) DDSCL_NORMAL is not compative with DDSCL_FULLSCREEN or DDSCL_EXCLUSIVE\n", This); +TRACE("(%p) DDSCL_NORMAL is not compative with DDSCL_EXCLUSIVE only \n", This); LeaveCriticalSection(&ddraw_cs); return DDERR_INVALIDPARAMS; } diff --git a/dlls/ddraw/tests/ddrawmodes.c b/dlls/ddraw/tests/ddrawmodes.c index 8235d86..b72ddaa 100644 --- a/dlls/ddraw/tests/ddrawmodes.c +++ b/dlls/ddraw/tests/ddrawmodes.c @@ -558,11 +558,46 @@ static void testcooperativelevels_normal(void) surfacedesc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP; /* Do some tests with DDSCL_NORMAL mode */ - + +/* Fullscreen mode + normal mode + exclusive mode */ +rc = IDirectDraw_SetCooperativeLevel(lpDD, +hwnd, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE | DDSCL_NORMAL); +ok(rc==DD_OK,"SetCooperativeLevel(DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE | DDSCL_NORMAL) returned: %x\n",rc); +/* Try creating a double buffered primary in fullscreen + exclusive + normal mode */ +rc = IDirectDraw_CreateSurface(lpDD, &surfacedesc, &surface, NULL); +if (rc == DDERR_UNSUPPORTEDMODE) +skip("Unsupported mode\n"); +else +{ +ok(rc == DD_OK, "IDirectDraw_CreateSurface returned %08x\n", rc); +ok(surface!=NULL, "Returned NULL surface pointer \n"); +} +if(surface && surface != (ID
Re: Re : ddraw [try 2]: SetCooperativeLevel with Full screen + exclusive + normal is authorized
I think those tests should do, but have a few spelling issues and you're not releasing the surface. So if I understand things correctly: *) NORMAL | FULLSCREEN | EXCLUSIVE -> fullscreen mode *) NORMAL | EXCLUSIVE -> error *) NORMAL | FULLSCREEN -> windowed mode For testing older ddraw interface vesions you can QueryInterface the ddraw object for IID_IDirectDraw, IID_IDirectDraw2(and ddraw3 and ddraw4). Then you run the same tests on those. I am pretty sure the check that NORMAL mode is mutually exclusive with FULLSCREEN/EXCLUSIVE already existed in old ddraw, and is motivated by a statement in msdn that those modes are mutually exclusive - which makes sense, you can't be in fullscreen mode and not be in fullscreen mode at the same time. It seems that one flag is ignored rather than an error returned. On a general note, I am away from home the next weeks. I expect to be able to read mail, but it will me sporadic(ok, I haven't been reliable in the past few weeks either) Am 24.08.2010 um 15:26 schrieb paulo lesgaz: > Such tests are what you were thinking about? > They all passed on my real vista box. > > David > > > De : Stefan Dösinger > À : wine-devel@winehq.org > Envoyé le : Mar 24 août 2010, 11h 30min 59s > Objet : Re: ddraw [try 2]: SetCooperativeLevel with Full screen + exclusive + > normal is authorized > > Hi, > Can you add a test that tests in which mode ddraw is after such a call? > Specfically, try to create a double buffered primary surface. If this > succeeds, ddraw is in fullscreen mode. If ddraw is in normal mode you'll get > DDERR_NOEXCLUSIVEMODE (or similar) back. > > Am 24.08.2010 um 10:00 schrieb David Adam: > > > Fixed a typo > > > > A+ > > > > David > > <0001-SetCooperativeLevel-with-Full-screen-exclusive-norma.patch> > > > > > <0001-SetCooperativeLevel-with-Full-screen-exclusive-norma.patch>