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
0293e199
Commit
0293e199
authored
May 02, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
May 03, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw/tests: Make sure the window is properly released by ddraw in test_wndproc().
parent
02f0d82d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
d3d.c
dlls/ddraw/tests/d3d.c
+22
-0
No files found.
dlls/ddraw/tests/d3d.c
View file @
0293e199
...
...
@@ -3251,6 +3251,27 @@ static LRESULT CALLBACK test_proc(HWND hwnd, UINT message, WPARAM wparam, LPARAM
return
DefWindowProcA
(
hwnd
,
message
,
wparam
,
lparam
);
}
/* Set the wndproc back to what ddraw expects it to be, and release the ddraw
* interface. This prevents subsequent SetCooperativeLevel() calls on a
* different window from failing with DDERR_HWNDALREADYSET. */
static
void
fix_wndproc
(
HWND
window
,
LONG_PTR
proc
)
{
IDirectDraw7
*
ddraw7
;
HRESULT
hr
;
hr
=
pDirectDrawCreateEx
(
NULL
,
(
void
**
)
&
ddraw7
,
&
IID_IDirectDraw7
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create IDirectDraw7 object, hr %#x."
,
hr
);
if
(
FAILED
(
hr
))
return
;
SetWindowLongPtrA
(
window
,
GWLP_WNDPROC
,
proc
);
hr
=
IDirectDraw7_SetCooperativeLevel
(
ddraw7
,
window
,
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
ok
(
SUCCEEDED
(
hr
),
"SetCooperativeLevel failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw7_SetCooperativeLevel
(
ddraw7
,
window
,
DDSCL_NORMAL
);
ok
(
SUCCEEDED
(
hr
),
"SetCooperativeLevel failed, hr %#x.
\n
"
,
hr
);
IDirectDraw7_Release
(
ddraw7
);
}
static
void
test_wndproc
(
void
)
{
LONG_PTR
proc
,
ddraw_proc
;
...
...
@@ -3458,6 +3479,7 @@ static void test_wndproc(void)
(
LONG_PTR
)
DefWindowProcA
,
proc
);
done:
fix_wndproc
(
window
,
(
LONG_PTR
)
test_proc
);
expect_messages
=
NULL
;
DestroyWindow
(
window
);
UnregisterClassA
(
"d3d7_test_wndproc_wc"
,
GetModuleHandleA
(
NULL
));
...
...
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