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
9cf27b5f
Commit
9cf27b5f
authored
Mar 07, 2005
by
Matthew Mastracci
Committed by
Alexandre Julliard
Mar 07, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added surface locking.
parent
d9e36342
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
0 deletions
+25
-0
ddraw_private.h
dlls/ddraw/ddraw_private.h
+1
-0
dib.c
dlls/ddraw/dsurface/dib.c
+10
-0
main.c
dlls/ddraw/dsurface/main.c
+14
-0
No files found.
dlls/ddraw/ddraw_private.h
View file @
9cf27b5f
...
@@ -277,6 +277,7 @@ struct IDirectDrawSurfaceImpl
...
@@ -277,6 +277,7 @@ struct IDirectDrawSurfaceImpl
RECT
lastlockrect
;
RECT
lastlockrect
;
DWORD
lastlocktype
;
DWORD
lastlocktype
;
BOOL
dc_in_use
;
BOOL
dc_in_use
;
BOOL
locked
;
HRESULT
(
*
duplicate_surface
)(
IDirectDrawSurfaceImpl
*
src
,
HRESULT
(
*
duplicate_surface
)(
IDirectDrawSurfaceImpl
*
src
,
LPDIRECTDRAWSURFACE7
*
dst
);
LPDIRECTDRAWSURFACE7
*
dst
);
...
...
dlls/ddraw/dsurface/dib.c
View file @
9cf27b5f
...
@@ -514,6 +514,11 @@ DIB_DirectDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rdst,
...
@@ -514,6 +514,11 @@ DIB_DirectDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rdst,
}
}
}
}
if
(
This
->
locked
||
((
IDirectDrawSurfaceImpl
*
)
src
)
->
locked
)
{
WARN
(
" Surface is busy, returning DDERR_SURFACEBUSY
\n
"
);
return
DDERR_SURFACEBUSY
;
}
/* First, check if the possible override function handles this case */
/* First, check if the possible override function handles this case */
if
(
This
->
aux_blt
!=
NULL
)
{
if
(
This
->
aux_blt
!=
NULL
)
{
if
(
This
->
aux_blt
(
This
,
rdst
,
src
,
rsrc
,
dwFlags
,
lpbltfx
)
==
DD_OK
)
return
DD_OK
;
if
(
This
->
aux_blt
(
This
,
rdst
,
src
,
rsrc
,
dwFlags
,
lpbltfx
)
==
DD_OK
)
return
DD_OK
;
...
@@ -985,6 +990,11 @@ DIB_DirectDrawSurface_BltFast(LPDIRECTDRAWSURFACE7 iface, DWORD dstx,
...
@@ -985,6 +990,11 @@ DIB_DirectDrawSurface_BltFast(LPDIRECTDRAWSURFACE7 iface, DWORD dstx,
TRACE
(
" srcrect: NULL
\n
"
);
TRACE
(
" srcrect: NULL
\n
"
);
}
}
if
(
This
->
locked
||
((
IDirectDrawSurfaceImpl
*
)
src
)
->
locked
)
{
WARN
(
" Surface is busy, returning DDERR_SURFACEBUSY
\n
"
);
return
DDERR_SURFACEBUSY
;
}
/* First, check if the possible override function handles this case */
/* First, check if the possible override function handles this case */
if
(
This
->
aux_bltfast
!=
NULL
)
{
if
(
This
->
aux_bltfast
!=
NULL
)
{
if
(
This
->
aux_bltfast
(
This
,
dstx
,
dsty
,
src
,
rsrc
,
trans
)
==
DD_OK
)
return
DD_OK
;
if
(
This
->
aux_bltfast
(
This
,
dstx
,
dsty
,
src
,
rsrc
,
trans
)
==
DD_OK
)
return
DD_OK
;
...
...
dlls/ddraw/dsurface/main.c
View file @
9cf27b5f
...
@@ -1094,6 +1094,12 @@ Main_DirectDrawSurface_Lock(LPDIRECTDRAWSURFACE7 iface, LPRECT prect,
...
@@ -1094,6 +1094,12 @@ Main_DirectDrawSurface_Lock(LPDIRECTDRAWSURFACE7 iface, LPRECT prect,
}
}
}
}
/* If the surface is already locked, return busy */
if
(
This
->
locked
)
{
WARN
(
" Surface is busy, returning DDERR_SURFACEBUSY
\n
"
);
return
DDERR_SURFACEBUSY
;
}
/* First, copy the Surface description */
/* First, copy the Surface description */
DD_STRUCT_COPY_BYSIZE
(
pDDSD
,
&
(
This
->
surface_desc
));
DD_STRUCT_COPY_BYSIZE
(
pDDSD
,
&
(
This
->
surface_desc
));
...
@@ -1142,6 +1148,8 @@ Main_DirectDrawSurface_Lock(LPDIRECTDRAWSURFACE7 iface, LPRECT prect,
...
@@ -1142,6 +1148,8 @@ Main_DirectDrawSurface_Lock(LPDIRECTDRAWSURFACE7 iface, LPRECT prect,
This
->
lock_update
(
This
,
NULL
,
flags
);
This
->
lock_update
(
This
,
NULL
,
flags
);
}
}
This
->
locked
=
TRUE
;
TRACE
(
"locked surface returning description :
\n
"
);
TRACE
(
"locked surface returning description :
\n
"
);
if
(
TRACE_ON
(
ddraw
))
DDRAW_dump_surface_desc
(
pDDSD
);
if
(
TRACE_ON
(
ddraw
))
DDRAW_dump_surface_desc
(
pDDSD
);
...
@@ -1417,6 +1425,12 @@ Main_DirectDrawSurface_Unlock(LPDIRECTDRAWSURFACE7 iface, LPRECT pRect)
...
@@ -1417,6 +1425,12 @@ Main_DirectDrawSurface_Unlock(LPDIRECTDRAWSURFACE7 iface, LPRECT pRect)
TRACE
(
"(%p)->Unlock(%p)
\n
"
,
This
,
pRect
);
TRACE
(
"(%p)->Unlock(%p)
\n
"
,
This
,
pRect
);
if
(
!
This
->
locked
)
{
WARN
(
"Surface not locked - returing DDERR_NOTLOCKED
\n
"
);
return
DDERR_NOTLOCKED
;
}
This
->
locked
=
FALSE
;
This
->
unlock_update
(
This
,
pRect
);
This
->
unlock_update
(
This
,
pRect
);
if
(
This
->
aux_unlock
)
if
(
This
->
aux_unlock
)
This
->
aux_unlock
(
This
->
aux_ctx
,
This
->
aux_data
,
pRect
);
This
->
aux_unlock
(
This
->
aux_ctx
,
This
->
aux_data
,
pRect
);
...
...
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