Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
03fe6f3e
Commit
03fe6f3e
authored
11 years ago
by
Stefan Dösinger
Committed by
Alexandre Julliard
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
d3d9/tests: Test user memory and getdc interaction.
parent
cc6f9c36
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/d3d9/tests/Makefile.in
+1
-1
1 addition, 1 deletion
dlls/d3d9/tests/Makefile.in
dlls/d3d9/tests/d3d9ex.c
+45
-0
45 additions, 0 deletions
dlls/d3d9/tests/d3d9ex.c
with
46 additions
and
1 deletion
dlls/d3d9/tests/Makefile.in
+
1
−
1
View file @
03fe6f3e
TESTDLL
=
d3d9.dll
IMPORTS
=
user32
IMPORTS
=
user32
gdi32
C_SRCS
=
\
d3d9ex.c
\
...
...
This diff is collapsed.
Click to expand it.
dlls/d3d9/tests/d3d9ex.c
+
45
−
0
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
();
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment