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
a5c484cb
Commit
a5c484cb
authored
May 10, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
May 11, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: GetSurfaceDesc returns the surface memory while the surface is locked.
parent
e7b68eec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
5 deletions
+25
-5
surface.c
dlls/ddraw/surface.c
+9
-3
dsurface.c
dlls/ddraw/tests/dsurface.c
+16
-2
No files found.
dlls/ddraw/surface.c
View file @
a5c484cb
...
...
@@ -585,7 +585,6 @@ IDirectDrawSurfaceImpl_Lock(IDirectDrawSurface7 *iface,
DDSD
->
dwSize
=
sizeof
(
DDSURFACEDESC2
);
}
DD_STRUCT_COPY_BYSIZE
(
DDSD
,
&
(
This
->
surface_desc
));
hr
=
IWineD3DSurface_LockRect
(
This
->
WineD3DSurface
,
&
LockedRect
,
Rect
,
...
...
@@ -596,7 +595,8 @@ IDirectDrawSurfaceImpl_Lock(IDirectDrawSurface7 *iface,
* does not set the LPSURFACE flag on locked surfaces !?!.
* DDSD->dwFlags |= DDSD_LPSURFACE;
*/
DDSD
->
lpSurface
=
LockedRect
.
pBits
;
This
->
surface_desc
.
lpSurface
=
LockedRect
.
pBits
;
DD_STRUCT_COPY_BYSIZE
(
DDSD
,
&
(
This
->
surface_desc
));
TRACE
(
"locked surface returning description :
\n
"
);
if
(
TRACE_ON
(
ddraw
))
DDRAW_dump_surface_desc
(
DDSD
);
...
...
@@ -622,9 +622,15 @@ IDirectDrawSurfaceImpl_Unlock(IDirectDrawSurface7 *iface,
RECT
*
pRect
)
{
ICOM_THIS_FROM
(
IDirectDrawSurfaceImpl
,
IDirectDrawSurface7
,
iface
);
HRESULT
hr
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pRect
);
return
IWineD3DSurface_UnlockRect
(
This
->
WineD3DSurface
);
hr
=
IWineD3DSurface_UnlockRect
(
This
->
WineD3DSurface
);
if
(
SUCCEEDED
(
hr
))
{
This
->
surface_desc
.
lpSurface
=
NULL
;
}
return
hr
;
}
/*****************************************************************************
...
...
dlls/ddraw/tests/dsurface.c
View file @
a5c484cb
...
...
@@ -174,8 +174,7 @@ static void SrcColorKey32BlitTest(void)
{
LPDIRECTDRAWSURFACE
lpSrc
;
LPDIRECTDRAWSURFACE
lpDst
;
DDSURFACEDESC
ddsd
;
DDSURFACEDESC
ddsd2
;
DDSURFACEDESC
ddsd
,
ddsd2
,
ddsd3
;
DDCOLORKEY
DDColorKey
;
LPDWORD
lpData
;
HRESULT
rc
;
...
...
@@ -211,9 +210,24 @@ static void SrcColorKey32BlitTest(void)
lpData
[
1
]
=
0xCCCCCCCC
;
lpData
[
2
]
=
0xCCCCCCCC
;
lpData
[
3
]
=
0xCCCCCCCC
;
memset
(
&
ddsd3
,
0
,
sizeof
(
ddsd3
));
ddsd3
.
dwSize
=
sizeof
(
ddsd3
);
U4
(
ddsd3
).
ddpfPixelFormat
.
dwSize
=
sizeof
(
U4
(
ddsd3
).
ddpfPixelFormat
);
rc
=
IDirectDrawSurface_GetSurfaceDesc
(
lpDst
,
&
ddsd3
);
ok
(
rc
==
DD_OK
,
"IDirectDrawSurface_GetSurfaceDesc between a lock/unlock pair returned %08x
\n
"
,
rc
);
ok
(
ddsd3
.
lpSurface
==
ddsd3
.
lpSurface
,
"lpSurface from GetSurfaceDesc(%p) differs from the one returned by Lock(%p)
\n
"
,
ddsd3
.
lpSurface
,
ddsd2
.
lpSurface
);
rc
=
IDirectDrawSurface_Unlock
(
lpDst
,
NULL
);
ok
(
rc
==
DD_OK
,
"Unlock returned: %x
\n
"
,
rc
);
memset
(
&
ddsd3
,
0
,
sizeof
(
ddsd3
));
ddsd3
.
dwSize
=
sizeof
(
ddsd3
);
U4
(
ddsd3
).
ddpfPixelFormat
.
dwSize
=
sizeof
(
U4
(
ddsd3
).
ddpfPixelFormat
);
rc
=
IDirectDrawSurface_GetSurfaceDesc
(
lpDst
,
&
ddsd3
);
ok
(
rc
==
DD_OK
,
"IDirectDrawSurface_GetSurfaceDesc between a lock/unlock pair returned %08x
\n
"
,
rc
);
ok
(
ddsd3
.
lpSurface
==
NULL
,
"lpSurface from GetSurfaceDesc(%p) is not NULL after unlock
\n
"
,
ddsd3
.
lpSurface
);
rc
=
IDirectDrawSurface_Lock
(
lpSrc
,
NULL
,
&
ddsd2
,
DDLOCK_WAIT
,
NULL
);
ok
(
rc
==
DD_OK
,
"Lock returned: %x
\n
"
,
rc
);
ok
((
ddsd2
.
dwFlags
&
DDSD_LPSURFACE
)
==
0
,
"Surface desc has LPSURFACE Flags set
\n
"
);
...
...
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