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
Lorenzo Ferrillo
wine
Commits
029c5a6c
Commit
029c5a6c
authored
13 years ago
by
Stefan Dösinger
Committed by
Alexandre Julliard
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ddraw: Convert DDSURFACEDESC2 in lock.
parent
d6f17d68
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/ddraw/surface.c
+73
-31
73 additions, 31 deletions
dlls/ddraw/surface.c
with
73 additions
and
31 deletions
dlls/ddraw/surface.c
+
73
−
31
View file @
029c5a6c
...
...
@@ -875,18 +875,14 @@ static HRESULT WINAPI ddraw_surface1_GetAttachedSurface(IDirectDrawSurface *ifac
* For more details, see IWineD3DSurface::LockRect
*
*****************************************************************************/
static
HRESULT
WINAPI
ddraw_
surface
7_L
ock
(
IDirectDrawSurface
7
*
iface
,
static
HRESULT
WINAPI
surface
_l
ock
(
IDirectDrawSurface
Impl
*
This
,
RECT
*
Rect
,
DDSURFACEDESC2
*
DDSD
,
DWORD
Flags
,
HANDLE
h
)
{
IDirectDrawSurfaceImpl
*
This
=
impl_from_IDirectDrawSurface7
(
iface
);
WINED3DLOCKED_RECT
LockedRect
;
HRESULT
hr
;
TRACE
(
"iface %p, rect %s, surface_desc %p, flags %#x, h %p.
\n
"
,
iface
,
wine_dbgstr_rect
(
Rect
),
DDSD
,
Flags
,
h
);
if
(
!
DDSD
)
return
DDERR_INVALIDPARAMS
;
TRACE
(
"This %p, rect %s, surface_desc %p, flags %#x, h %p.
\n
"
,
This
,
wine_dbgstr_rect
(
Rect
),
DDSD
,
Flags
,
h
);
/* This->surface_desc.dwWidth and dwHeight are changeable, thus lock */
EnterCriticalSection
(
&
ddraw_cs
);
...
...
@@ -897,14 +893,6 @@ static HRESULT WINAPI ddraw_surface7_Lock(IDirectDrawSurface7 *iface,
* for the supported values. The others are ignored by WineD3D
*/
if
(
DDSD
->
dwSize
!=
sizeof
(
DDSURFACEDESC
)
&&
DDSD
->
dwSize
!=
sizeof
(
DDSURFACEDESC2
))
{
WARN
(
"Invalid structure size %d, returning DDERR_INVALIDPARAMS
\n
"
,
DDSD
->
dwSize
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
DDERR_INVALIDPARAMS
;
}
/* Windows zeroes this if the rect is invalid */
DDSD
->
lpSurface
=
0
;
...
...
@@ -954,6 +942,23 @@ static HRESULT WINAPI ddraw_surface7_Lock(IDirectDrawSurface7 *iface,
return
DD_OK
;
}
static
HRESULT
WINAPI
ddraw_surface7_Lock
(
IDirectDrawSurface7
*
iface
,
RECT
*
rect
,
DDSURFACEDESC2
*
surface_desc
,
DWORD
flags
,
HANDLE
h
)
{
IDirectDrawSurfaceImpl
*
This
=
impl_from_IDirectDrawSurface7
(
iface
);
TRACE
(
"iface %p, rect %s, surface_desc %p, flags %#x, h %p.
\n
"
,
iface
,
wine_dbgstr_rect
(
rect
),
surface_desc
,
flags
,
h
);
if
(
!
surface_desc
)
return
DDERR_INVALIDPARAMS
;
if
(
surface_desc
->
dwSize
!=
sizeof
(
DDSURFACEDESC
)
&&
surface_desc
->
dwSize
!=
sizeof
(
DDSURFACEDESC2
))
{
WARN
(
"Invalid structure size %d, returning DDERR_INVALIDPARAMS
\n
"
,
surface_desc
->
dwSize
);
return
DDERR_INVALIDPARAMS
;
}
return
surface_lock
(
This
,
rect
,
surface_desc
,
flags
,
h
);
}
static
HRESULT
WINAPI
ddraw_surface4_Lock
(
IDirectDrawSurface4
*
iface
,
RECT
*
rect
,
DDSURFACEDESC2
*
surface_desc
,
DWORD
flags
,
HANDLE
h
)
{
...
...
@@ -961,49 +966,86 @@ static HRESULT WINAPI ddraw_surface4_Lock(IDirectDrawSurface4 *iface, RECT *rect
TRACE
(
"iface %p, rect %s, surface_desc %p, flags %#x, h %p.
\n
"
,
iface
,
wine_dbgstr_rect
(
rect
),
surface_desc
,
flags
,
h
);
return
ddraw_surface7_Lock
(
&
This
->
IDirectDrawSurface7_iface
,
rect
,
surface_desc
,
flags
,
h
);
if
(
!
surface_desc
)
return
DDERR_INVALIDPARAMS
;
if
(
surface_desc
->
dwSize
!=
sizeof
(
DDSURFACEDESC
)
&&
surface_desc
->
dwSize
!=
sizeof
(
DDSURFACEDESC2
))
{
WARN
(
"Invalid structure size %d, returning DDERR_INVALIDPARAMS
\n
"
,
surface_desc
->
dwSize
);
return
DDERR_INVALIDPARAMS
;
}
return
surface_lock
(
This
,
rect
,
surface_desc
,
flags
,
h
);
}
static
HRESULT
WINAPI
ddraw_surface3_Lock
(
IDirectDrawSurface3
*
iface
,
RECT
*
rect
,
DDSURFACEDESC
*
surface_desc
,
DWORD
flags
,
HANDLE
h
)
{
IDirectDrawSurfaceImpl
*
This
=
impl_from_IDirectDrawSurface3
(
iface
);
DDSURFACEDESC2
surface_desc2
;
HRESULT
hr
;
TRACE
(
"iface %p, rect %s, surface_desc %p, flags %#x, h %p.
\n
"
,
iface
,
wine_dbgstr_rect
(
rect
),
surface_desc
,
flags
,
h
);
/* All versions of Lock() accept both sizeof(DDSURFACEDESC) and
* sizeof(DDSURFACEDESC2) structures and do not touch the dwSize member */
return
ddraw_surface7_Lock
(
&
This
->
IDirectDrawSurface7_iface
,
rect
,
(
DDSURFACEDESC2
*
)
surface_desc
,
flags
,
h
);
if
(
!
surface_desc
)
return
DDERR_INVALIDPARAMS
;
if
(
surface_desc
->
dwSize
!=
sizeof
(
DDSURFACEDESC
)
&&
surface_desc
->
dwSize
!=
sizeof
(
DDSURFACEDESC2
))
{
WARN
(
"Invalid structure size %d, returning DDERR_INVALIDPARAMS
\n
"
,
surface_desc
->
dwSize
);
return
DDERR_INVALIDPARAMS
;
}
surface_desc2
.
dwSize
=
surface_desc
->
dwSize
;
hr
=
surface_lock
(
This
,
rect
,
&
surface_desc2
,
flags
,
h
);
DDSD2_to_DDSD
(
&
surface_desc2
,
surface_desc
);
surface_desc
->
dwSize
=
surface_desc2
.
dwSize
;
return
hr
;
}
static
HRESULT
WINAPI
ddraw_surface2_Lock
(
IDirectDrawSurface2
*
iface
,
RECT
*
rect
,
DDSURFACEDESC
*
surface_desc
,
DWORD
flags
,
HANDLE
h
)
{
IDirectDrawSurfaceImpl
*
This
=
impl_from_IDirectDrawSurface2
(
iface
);
DDSURFACEDESC2
surface_desc2
;
HRESULT
hr
;
TRACE
(
"iface %p, rect %s, surface_desc %p, flags %#x, h %p.
\n
"
,
iface
,
wine_dbgstr_rect
(
rect
),
surface_desc
,
flags
,
h
);
/* All versions of Lock() accept both sizeof(DDSURFACEDESC) and
* sizeof(DDSURFACEDESC2) structures and do not touch the dwSize member
*
* TODO: Test DDSD_ZBUFFERBITDEPTH behavior */
return
ddraw_surface7_Lock
(
&
This
->
IDirectDrawSurface7_iface
,
rect
,
(
DDSURFACEDESC2
*
)
surface_desc
,
flags
,
h
);
if
(
!
surface_desc
)
return
DDERR_INVALIDPARAMS
;
if
(
surface_desc
->
dwSize
!=
sizeof
(
DDSURFACEDESC
)
&&
surface_desc
->
dwSize
!=
sizeof
(
DDSURFACEDESC2
))
{
WARN
(
"Invalid structure size %d, returning DDERR_INVALIDPARAMS
\n
"
,
surface_desc
->
dwSize
);
return
DDERR_INVALIDPARAMS
;
}
surface_desc2
.
dwSize
=
surface_desc
->
dwSize
;
hr
=
surface_lock
(
This
,
rect
,
&
surface_desc2
,
flags
,
h
);
DDSD2_to_DDSD
(
&
surface_desc2
,
surface_desc
);
surface_desc
->
dwSize
=
surface_desc2
.
dwSize
;
return
hr
;
}
static
HRESULT
WINAPI
ddraw_surface1_Lock
(
IDirectDrawSurface
*
iface
,
RECT
*
rect
,
DDSURFACEDESC
*
surface_desc
,
DWORD
flags
,
HANDLE
h
)
{
IDirectDrawSurfaceImpl
*
This
=
impl_from_IDirectDrawSurface
(
iface
);
DDSURFACEDESC2
surface_desc2
;
HRESULT
hr
;
TRACE
(
"iface %p, rect %s, surface_desc %p, flags %#x, h %p.
\n
"
,
iface
,
wine_dbgstr_rect
(
rect
),
surface_desc
,
flags
,
h
);
/* All versions of Lock() accept both sizeof(DDSURFACEDESC) and
* sizeof(DDSURFACEDESC2) structures and do not touch the dwSize member */
return
ddraw_surface7_Lock
(
&
This
->
IDirectDrawSurface7_iface
,
rect
,
(
DDSURFACEDESC2
*
)
surface_desc
,
flags
,
h
);
if
(
!
surface_desc
)
return
DDERR_INVALIDPARAMS
;
if
(
surface_desc
->
dwSize
!=
sizeof
(
DDSURFACEDESC
)
&&
surface_desc
->
dwSize
!=
sizeof
(
DDSURFACEDESC2
))
{
WARN
(
"Invalid structure size %d, returning DDERR_INVALIDPARAMS
\n
"
,
surface_desc
->
dwSize
);
return
DDERR_INVALIDPARAMS
;
}
surface_desc2
.
dwSize
=
surface_desc
->
dwSize
;
hr
=
surface_lock
(
This
,
rect
,
&
surface_desc2
,
flags
,
h
);
DDSD2_to_DDSD
(
&
surface_desc2
,
surface_desc
);
surface_desc
->
dwSize
=
surface_desc2
.
dwSize
;
return
hr
;
}
/*****************************************************************************
...
...
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