Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
03fe6f3e
Commit
03fe6f3e
authored
Dec 11, 2013
by
Stefan Dösinger
Committed by
Alexandre Julliard
Dec 12, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9/tests: Test user memory and getdc interaction.
parent
cc6f9c36
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
1 deletion
+46
-1
Makefile.in
dlls/d3d9/tests/Makefile.in
+1
-1
d3d9ex.c
dlls/d3d9/tests/d3d9ex.c
+45
-0
No files found.
dlls/d3d9/tests/Makefile.in
View file @
03fe6f3e
TESTDLL
=
d3d9.dll
IMPORTS
=
user32
IMPORTS
=
user32
gdi32
C_SRCS
=
\
d3d9ex.c
\
...
...
dlls/d3d9/tests/d3d9ex.c
View file @
03fe6f3e
...
...
@@ -1151,6 +1151,50 @@ done:
DestroyWindow
(
window
);
}
static
void
test_user_memory_getdc
(
void
)
{
IDirect3DDevice9Ex
*
device
;
HWND
window
;
HRESULT
hr
;
ULONG
ref
;
IDirect3DSurface9
*
surface
;
DWORD
*
data
;
HDC
dc
;
window
=
CreateWindowA
(
"static"
,
"d3d9_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
if
(
!
(
device
=
create_device
(
window
,
window
,
TRUE
)))
{
skip
(
"Failed to create a D3D device, skipping tests.
\n
"
);
goto
done
;
}
data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
data
)
*
16
*
16
);
memset
(
data
,
0xaa
,
sizeof
(
*
data
)
*
16
*
16
);
hr
=
IDirect3DDevice9Ex_CreateOffscreenPlainSurface
(
device
,
16
,
16
,
D3DFMT_A8R8G8B8
,
D3DPOOL_SYSTEMMEM
,
&
surface
,
(
HANDLE
*
)
&
data
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create surface, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DSurface9_GetDC
(
surface
,
&
dc
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get dc, hr %#x.
\n
"
,
hr
);
BitBlt
(
dc
,
0
,
0
,
16
,
8
,
NULL
,
0
,
0
,
WHITENESS
);
BitBlt
(
dc
,
0
,
8
,
16
,
8
,
NULL
,
0
,
0
,
BLACKNESS
);
hr
=
IDirect3DSurface9_ReleaseDC
(
surface
,
dc
);
ok
(
SUCCEEDED
(
hr
),
"Failed to release dc, hr %#x.
\n
"
,
hr
);
ok
(
data
[
0
]
==
0xffffffff
,
"Expected color 0xffffffff, got %#x.
\n
"
,
data
[
0
]);
ok
(
data
[
8
*
16
]
==
0x00000000
,
"Expected color 0x00000000, got %#x.
\n
"
,
data
[
8
*
16
]);
IDirect3DSurface9_Release
(
surface
);
HeapFree
(
GetProcessHeap
(),
0
,
data
);
ref
=
IDirect3DDevice9_Release
(
device
);
ok
(
ref
==
0
,
"The device was not properly freed: refcount %u.
\n
"
,
ref
);
done:
DestroyWindow
(
window
);
}
START_TEST
(
d3d9ex
)
{
d3d9_handle
=
LoadLibraryA
(
"d3d9.dll"
);
...
...
@@ -1180,4 +1224,5 @@ START_TEST(d3d9ex)
test_reset
();
test_reset_resources
();
test_vidmem_accounting
();
test_user_memory_getdc
();
}
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