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
89fef0e6
Commit
89fef0e6
authored
Mar 16, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 17, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Fix IDirectDraw4Impl_GetSurfaceFromDC().
Perhaps interesting to note is that this returns an IDirectDrawSurface instead of an IDirectDrawSurface4.
parent
4e48ae26
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
1 deletion
+41
-1
ddraw_thunks.c
dlls/ddraw/ddraw_thunks.c
+9
-1
dsurface.c
dlls/ddraw/tests/dsurface.c
+32
-0
No files found.
dlls/ddraw/ddraw_thunks.c
View file @
89fef0e6
...
...
@@ -1048,7 +1048,15 @@ static HRESULT WINAPI
IDirectDraw4Impl_GetSurfaceFromDC
(
LPDIRECTDRAW4
This
,
HDC
hDC
,
LPDIRECTDRAWSURFACE4
*
pSurf
)
{
return
IDirectDraw7_GetSurfaceFromDC
((
IDirectDraw7
*
)
ddraw_from_ddraw4
(
This
),
hDC
,
(
LPDIRECTDRAWSURFACE7
*
)
pSurf
);
IDirectDrawSurface7
*
surf7
;
HRESULT
hr
;
if
(
!
pSurf
)
return
E_INVALIDARG
;
hr
=
IDirectDraw7_GetSurfaceFromDC
((
IDirectDraw7
*
)
ddraw_from_ddraw4
(
This
),
hDC
,
&
surf7
);
*
pSurf
=
surf7
?
(
IDirectDrawSurface4
*
)
&
((
IDirectDrawSurfaceImpl
*
)
surf7
)
->
IDirectDrawSurface3_vtbl
:
NULL
;
return
hr
;
}
static
HRESULT
WINAPI
...
...
dlls/ddraw/tests/dsurface.c
View file @
89fef0e6
...
...
@@ -3008,6 +3008,7 @@ static void GetDCTest(void)
IDirectDrawSurface2
*
surf2
;
IDirectDrawSurface4
*
surf4
;
IDirectDrawSurface7
*
surf7
;
IDirectDrawSurface
*
tmp
;
IDirectDrawSurface7
*
tmp7
;
HRESULT
hr
;
IDirectDraw2
*
dd2
;
...
...
@@ -3056,6 +3057,37 @@ static void GetDCTest(void)
ok
(
hr
==
DD_OK
,
"IDirectDraw4_CreateSurface failed: 0x%08x
\n
"
,
hr
);
dctest_surf
((
IDirectDrawSurface
*
)
surf4
,
2
);
hr
=
IDirectDrawSurface4_QueryInterface
(
surf4
,
&
IID_IDirectDrawSurface
,
(
void
**
)
&
surf
);
ok
(
SUCCEEDED
(
hr
),
"QueryInterface failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface4_GetDC
(
surf4
,
&
dc
);
ok
(
SUCCEEDED
(
hr
),
"GetDC failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDraw4_GetSurfaceFromDC
(
dd4
,
dc
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Expected hr E_INVALIDARG, got %#x.
\n
"
,
hr
);
hr
=
IDirectDraw4_GetSurfaceFromDC
(
dd4
,
dc
,
(
IDirectDrawSurface4
**
)
&
tmp
);
ok
(
SUCCEEDED
(
hr
),
"GetSurfaceFromDC failed, hr %#x.
\n
"
,
hr
);
ok
(
tmp
==
surf
,
"Expected surface %p, got %p.
\n\n
"
,
surf
,
tmp
);
hr
=
IDirectDrawSurface4_ReleaseDC
(
surf4
,
dc
);
ok
(
SUCCEEDED
(
hr
),
"ReleaseDC failed, hr %#x.
\n
"
,
hr
);
dc
=
CreateCompatibleDC
(
NULL
);
ok
(
!!
dc
,
"CreateCompatibleDC failed.
\n
"
);
tmp
=
(
IDirectDrawSurface
*
)
0xdeadbeef
;
hr
=
IDirectDraw4_GetSurfaceFromDC
(
dd4
,
dc
,
(
IDirectDrawSurface4
**
)
&
tmp
);
ok
(
hr
==
DDERR_NOTFOUND
,
"GetSurfaceFromDC failed, hr %#x.
\n
"
,
hr
);
ok
(
!
tmp
,
"Expected surface NULL, got %p.
\n
"
,
tmp
);
ok
(
DeleteDC
(
dc
),
"DeleteDC failed.
\n
"
);
tmp
=
(
IDirectDrawSurface
*
)
0xdeadbeef
;
hr
=
IDirectDraw4_GetSurfaceFromDC
(
dd4
,
NULL
,
(
IDirectDrawSurface4
**
)
&
tmp
);
ok
(
hr
==
DDERR_NOTFOUND
,
"GetSurfaceFromDC failed, hr %#x.
\n
"
,
hr
);
ok
(
!
tmp
,
"Expected surface NULL, got %p.
\n
"
,
tmp
);
IDirectDrawSurface4_Release
(
surf4
);
IDirectDraw4_Release
(
dd4
);
...
...
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