Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
a69c86d3
Commit
a69c86d3
authored
Dec 18, 2008
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jan 09, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddrawex: Add a test for the permanent DC function.
parent
58480f16
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
74 additions
and
5 deletions
+74
-5
surface.c
dlls/d3d8/surface.c
+5
-1
surface.c
dlls/d3d9/surface.c
+5
-1
surface.c
dlls/ddrawex/tests/surface.c
+61
-1
surface.c
dlls/wined3d/surface.c
+1
-1
surface_gdi.c
dlls/wined3d/surface_gdi.c
+1
-1
wined3d.idl
include/wine/wined3d.idl
+1
-0
No files found.
dlls/d3d8/surface.c
View file @
a69c86d3
...
...
@@ -206,7 +206,11 @@ static HRESULT WINAPI IDirect3DSurface8Impl_UnlockRect(LPDIRECT3DSURFACE8 iface)
EnterCriticalSection
(
&
d3d8_cs
);
hr
=
IWineD3DSurface_UnlockRect
(
This
->
wineD3DSurface
);
LeaveCriticalSection
(
&
d3d8_cs
);
return
hr
;
switch
(
hr
)
{
case
WINEDDERR_NOTLOCKED
:
return
D3DERR_INVALIDCALL
;
default:
return
hr
;
}
}
const
IDirect3DSurface8Vtbl
Direct3DSurface8_Vtbl
=
...
...
dlls/d3d9/surface.c
View file @
a69c86d3
...
...
@@ -241,7 +241,11 @@ static HRESULT WINAPI IDirect3DSurface9Impl_UnlockRect(LPDIRECT3DSURFACE9 iface)
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3DSurface_UnlockRect
(
This
->
wineD3DSurface
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
hr
;
switch
(
hr
)
{
case
WINEDDERR_NOTLOCKED
:
return
D3DERR_INVALIDCALL
;
default:
return
hr
;
}
}
static
HRESULT
WINAPI
IDirect3DSurface9Impl_GetDC
(
LPDIRECT3DSURFACE9
iface
,
HDC
*
phdc
)
{
...
...
dlls/ddrawex/tests/surface.c
View file @
a69c86d3
...
...
@@ -60,7 +60,7 @@ static void dctest_surf(IDirectDrawSurface *surf, int ddsdver) {
ok
(
dc2
==
(
HDC
)
0x1234
,
"The failed GetDC call changed the dc: %p
\n
"
,
dc2
);
hr
=
IDirectDrawSurface_Lock
(
surf
,
NULL
,
ddsdver
==
1
?
&
ddsd
:
((
DDSURFACEDESC
*
)
&
ddsd2
),
0
,
NULL
);
ok
(
hr
==
DDERR_SURFACEBUSY
,
"IDirectDrawSurface_Lock returned 0x%08x, expected DDERR_
ALREADYLOCKED
\n
"
,
hr
);
ok
(
hr
==
DDERR_SURFACEBUSY
,
"IDirectDrawSurface_Lock returned 0x%08x, expected DDERR_
SURFACEBUSY
\n
"
,
hr
);
hr
=
IDirectDrawSurface_ReleaseDC
(
surf
,
dc
);
ok
(
hr
==
DD_OK
,
"IDirectDrawSurface_ReleaseDC failed: 0x%08x
\n
"
,
hr
);
...
...
@@ -170,6 +170,65 @@ static void CapsTest(void)
IDirectDraw_Release
(
dd1
);
}
static
void
dctest_sysvidmem
(
IDirectDrawSurface
*
surf
,
int
ddsdver
)
{
HRESULT
hr
;
HDC
dc
,
dc2
=
(
HDC
)
0x1234
;
DDSURFACEDESC
ddsd
;
DDSURFACEDESC2
ddsd2
;
memset
(
&
ddsd
,
0
,
sizeof
(
ddsd
));
ddsd
.
dwSize
=
sizeof
(
ddsd
);
memset
(
&
ddsd2
,
0
,
sizeof
(
ddsd2
));
ddsd2
.
dwSize
=
sizeof
(
ddsd2
);
hr
=
IDirectDrawSurface_GetDC
(
surf
,
&
dc
);
ok
(
hr
==
DD_OK
,
"IDirectDrawSurface_GetDC failed: 0x%08x
\n
"
,
hr
);
hr
=
IDirectDrawSurface_GetDC
(
surf
,
&
dc2
);
ok
(
hr
==
DD_OK
,
"IDirectDrawSurface_GetDC failed: 0x%08x
\n
"
,
hr
);
ok
(
dc
==
dc2
,
"Got two different DCs
\n
"
);
hr
=
IDirectDrawSurface_Lock
(
surf
,
NULL
,
ddsdver
==
1
?
&
ddsd
:
((
DDSURFACEDESC
*
)
&
ddsd2
),
0
,
NULL
);
ok
(
hr
==
DD_OK
,
"IDirectDrawSurface_Lock returned 0x%08x, expected DD_OK
\n
"
,
hr
);
hr
=
IDirectDrawSurface_Lock
(
surf
,
NULL
,
ddsdver
==
1
?
&
ddsd
:
((
DDSURFACEDESC
*
)
&
ddsd2
),
0
,
NULL
);
ok
(
hr
==
DDERR_SURFACEBUSY
,
"IDirectDrawSurface_Lock returned 0x%08x, expected DDERR_SURFACEBUSY
\n
"
,
hr
);
hr
=
IDirectDrawSurface_Unlock
(
surf
,
NULL
);
ok
(
hr
==
DD_OK
,
"IDirectDrawSurface_Unlock returned 0x%08x, expected DD_OK
\n
"
,
hr
);
hr
=
IDirectDrawSurface_Unlock
(
surf
,
NULL
);
ok
(
hr
==
DDERR_NOTLOCKED
,
"IDirectDrawSurface_Unlock returned 0x%08x, expected DDERR_NOTLOCKED
\n
"
,
hr
);
hr
=
IDirectDrawSurface_ReleaseDC
(
surf
,
dc
);
ok
(
hr
==
DD_OK
,
"IDirectDrawSurface_ReleaseDC failed: 0x%08x
\n
"
,
hr
);
hr
=
IDirectDrawSurface_ReleaseDC
(
surf
,
dc
);
ok
(
hr
==
DD_OK
,
"IDirectDrawSurface_ReleaseDC failed: 0x%08x
\n
"
,
hr
);
/* That works any number of times... */
hr
=
IDirectDrawSurface_ReleaseDC
(
surf
,
dc
);
ok
(
hr
==
DD_OK
,
"IDirectDrawSurface_ReleaseDC failed: 0x%08x
\n
"
,
hr
);
}
static
void
SysVidMemTest
(
void
)
{
DDSURFACEDESC
ddsd
;
DDSURFACEDESC2
ddsd2
;
memset
(
&
ddsd
,
0
,
sizeof
(
ddsd
));
ddsd
.
dwSize
=
sizeof
(
ddsd
);
ddsd
.
dwFlags
=
DDSD_CAPS
|
DDSD_WIDTH
|
DDSD_HEIGHT
;
ddsd
.
dwWidth
=
64
;
ddsd
.
dwHeight
=
64
;
ddsd
.
ddsCaps
.
dwCaps
=
DDSCAPS_SYSTEMMEMORY
|
DDSCAPS_VIDEOMEMORY
;
memset
(
&
ddsd2
,
0
,
sizeof
(
ddsd2
));
ddsd2
.
dwSize
=
sizeof
(
ddsd2
);
ddsd2
.
dwFlags
=
DDSD_CAPS
|
DDSD_WIDTH
|
DDSD_HEIGHT
;
ddsd2
.
dwWidth
=
64
;
ddsd2
.
dwHeight
=
64
;
ddsd2
.
ddsCaps
.
dwCaps
=
DDSCAPS_SYSTEMMEMORY
|
DDSCAPS_VIDEOMEMORY
;
GetDCTest_main
(
&
ddsd
,
&
ddsd2
,
dctest_sysvidmem
);
}
START_TEST
(
surface
)
{
IClassFactory
*
classfactory
=
NULL
;
...
...
@@ -193,6 +252,7 @@ START_TEST(surface)
GetDCTest
();
CapsTest
();
SysVidMemTest
();
if
(
factory
)
{
ref
=
IDirectDrawFactory_Release
(
factory
);
...
...
dlls/wined3d/surface.c
View file @
a69c86d3
...
...
@@ -1320,7 +1320,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) {
if
(
!
(
This
->
Flags
&
SFLAG_LOCKED
))
{
WARN
(
"trying to Unlock an unlocked surf@%p
\n
"
,
This
);
return
WINED
3DERR_INVALIDCALL
;
return
WINED
DERR_NOTLOCKED
;
}
if
(
This
->
Flags
&
SFLAG_PBO
)
{
...
...
dlls/wined3d/surface_gdi.c
View file @
a69c86d3
...
...
@@ -168,7 +168,7 @@ IWineGDISurfaceImpl_UnlockRect(IWineD3DSurface *iface)
if
(
!
(
This
->
Flags
&
SFLAG_LOCKED
))
{
WARN
(
"trying to Unlock an unlocked surf@%p
\n
"
,
This
);
return
WINED
3DERR_INVALIDCALL
;
return
WINED
DERR_NOTLOCKED
;
}
/* Can be useful for debugging */
...
...
include/wine/wined3d.idl
View file @
a69c86d3
...
...
@@ -74,6 +74,7 @@ cpp_quote("#define WINED3DERR_INVALIDCALL MAKE_WINED3DHRESU
cpp_quote
(
"#define WINED3DERR_DRIVERINVALIDCALL MAKE_WINED3DHRESULT(2157)"
)
cpp_quote
(
"#define WINED3DERR_WASSTILLDRAWING MAKE_WINED3DHRESULT(540)"
)
cpp_quote
(
"#define WINEDDERR_NOTAOVERLAYSURFACE MAKE_WINED3DHRESULT(580)"
)
cpp_quote
(
"#define WINEDDERR_NOTLOCKED MAKE_WINED3DHRESULT(584)"
)
cpp_quote
(
"#define WINEDDERR_NODC MAKE_WINED3DHRESULT(586)"
)
cpp_quote
(
"#define WINEDDERR_DCALREADYCREATED MAKE_WINED3DHRESULT(620)"
)
cpp_quote
(
"#define WINEDDERR_NOTFLIPPABLE MAKE_WINED3DHRESULT(582)"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment