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
35c5c452
Commit
35c5c452
authored
Jun 14, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jun 22, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Hold the lock in suface methods.
parent
fb269f92
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
12 deletions
+77
-12
surface.c
dlls/d3d9/surface.c
+77
-12
No files found.
dlls/d3d9/surface.c
View file @
35c5c452
...
...
@@ -78,7 +78,9 @@ static ULONG WINAPI IDirect3DSurface9Impl_Release(LPDIRECT3DSURFACE9 iface) {
if
(
ref
==
0
)
{
if
(
This
->
parentDevice
)
IUnknown_Release
(
This
->
parentDevice
);
if
(
!
This
->
isImplicit
)
{
EnterCriticalSection
(
&
d3d9_cs
);
IWineD3DSurface_Release
(
This
->
wineD3DSurface
);
LeaveCriticalSection
(
&
d3d9_cs
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
}
...
...
@@ -90,50 +92,89 @@ static ULONG WINAPI IDirect3DSurface9Impl_Release(LPDIRECT3DSURFACE9 iface) {
/* IDirect3DSurface9 IDirect3DResource9 Interface follow: */
static
HRESULT
WINAPI
IDirect3DSurface9Impl_GetDevice
(
LPDIRECT3DSURFACE9
iface
,
IDirect3DDevice9
**
ppDevice
)
{
IDirect3DSurface9Impl
*
This
=
(
IDirect3DSurface9Impl
*
)
iface
;
return
IDirect3DResource9Impl_GetDevice
((
LPDIRECT3DRESOURCE9
)
This
,
ppDevice
);
HRESULT
hr
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
ppDevice
);
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IDirect3DResource9Impl_GetDevice
((
LPDIRECT3DRESOURCE9
)
This
,
ppDevice
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
hr
;
}
static
HRESULT
WINAPI
IDirect3DSurface9Impl_SetPrivateData
(
LPDIRECT3DSURFACE9
iface
,
REFGUID
refguid
,
CONST
void
*
pData
,
DWORD
SizeOfData
,
DWORD
Flags
)
{
IDirect3DSurface9Impl
*
This
=
(
IDirect3DSurface9Impl
*
)
iface
;
HRESULT
hr
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
return
IWineD3DSurface_SetPrivateData
(
This
->
wineD3DSurface
,
refguid
,
pData
,
SizeOfData
,
Flags
);
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3DSurface_SetPrivateData
(
This
->
wineD3DSurface
,
refguid
,
pData
,
SizeOfData
,
Flags
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
hr
;
}
static
HRESULT
WINAPI
IDirect3DSurface9Impl_GetPrivateData
(
LPDIRECT3DSURFACE9
iface
,
REFGUID
refguid
,
void
*
pData
,
DWORD
*
pSizeOfData
)
{
IDirect3DSurface9Impl
*
This
=
(
IDirect3DSurface9Impl
*
)
iface
;
HRESULT
hr
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
return
IWineD3DSurface_GetPrivateData
(
This
->
wineD3DSurface
,
refguid
,
pData
,
pSizeOfData
);
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3DSurface_GetPrivateData
(
This
->
wineD3DSurface
,
refguid
,
pData
,
pSizeOfData
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
hr
;
}
static
HRESULT
WINAPI
IDirect3DSurface9Impl_FreePrivateData
(
LPDIRECT3DSURFACE9
iface
,
REFGUID
refguid
)
{
IDirect3DSurface9Impl
*
This
=
(
IDirect3DSurface9Impl
*
)
iface
;
HRESULT
hr
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
return
IWineD3DSurface_FreePrivateData
(
This
->
wineD3DSurface
,
refguid
);
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3DSurface_FreePrivateData
(
This
->
wineD3DSurface
,
refguid
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
hr
;
}
static
DWORD
WINAPI
IDirect3DSurface9Impl_SetPriority
(
LPDIRECT3DSURFACE9
iface
,
DWORD
PriorityNew
)
{
IDirect3DSurface9Impl
*
This
=
(
IDirect3DSurface9Impl
*
)
iface
;
HRESULT
hr
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
return
IWineD3DSurface_SetPriority
(
This
->
wineD3DSurface
,
PriorityNew
);
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3DSurface_SetPriority
(
This
->
wineD3DSurface
,
PriorityNew
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
hr
;
}
static
DWORD
WINAPI
IDirect3DSurface9Impl_GetPriority
(
LPDIRECT3DSURFACE9
iface
)
{
IDirect3DSurface9Impl
*
This
=
(
IDirect3DSurface9Impl
*
)
iface
;
HRESULT
hr
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
return
IWineD3DSurface_GetPriority
(
This
->
wineD3DSurface
);
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3DSurface_GetPriority
(
This
->
wineD3DSurface
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
hr
;
}
static
void
WINAPI
IDirect3DSurface9Impl_PreLoad
(
LPDIRECT3DSURFACE9
iface
)
{
IDirect3DSurface9Impl
*
This
=
(
IDirect3DSurface9Impl
*
)
iface
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
EnterCriticalSection
(
&
d3d9_cs
);
IWineD3DSurface_PreLoad
(
This
->
wineD3DSurface
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
;
}
static
D3DRESOURCETYPE
WINAPI
IDirect3DSurface9Impl_GetType
(
LPDIRECT3DSURFACE9
iface
)
{
IDirect3DSurface9Impl
*
This
=
(
IDirect3DSurface9Impl
*
)
iface
;
D3DRESOURCETYPE
ret
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
return
IWineD3DSurface_GetType
(
This
->
wineD3DSurface
);
EnterCriticalSection
(
&
d3d9_cs
);
ret
=
IWineD3DSurface_GetType
(
This
->
wineD3DSurface
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
ret
;
}
/* IDirect3DSurface9 Interface follow: */
...
...
@@ -160,6 +201,7 @@ static HRESULT WINAPI IDirect3DSurface9Impl_GetDesc(LPDIRECT3DSURFACE9 iface, D3
IDirect3DSurface9Impl
*
This
=
(
IDirect3DSurface9Impl
*
)
iface
;
WINED3DSURFACE_DESC
wined3ddesc
;
UINT
tmpInt
=
-
1
;
HRESULT
hr
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
/* As d3d8 and d3d9 structures differ, pass in ptrs to where data needs to go */
...
...
@@ -173,32 +215,55 @@ static HRESULT WINAPI IDirect3DSurface9Impl_GetDesc(LPDIRECT3DSURFACE9 iface, D3
wined3ddesc
.
Width
=
&
pDesc
->
Width
;
wined3ddesc
.
Height
=
&
pDesc
->
Height
;
return
IWineD3DSurface_GetDesc
(
This
->
wineD3DSurface
,
&
wined3ddesc
);
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3DSurface_GetDesc
(
This
->
wineD3DSurface
,
&
wined3ddesc
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
hr
;
}
static
HRESULT
WINAPI
IDirect3DSurface9Impl_LockRect
(
LPDIRECT3DSURFACE9
iface
,
D3DLOCKED_RECT
*
pLockedRect
,
CONST
RECT
*
pRect
,
DWORD
Flags
)
{
IDirect3DSurface9Impl
*
This
=
(
IDirect3DSurface9Impl
*
)
iface
;
HRESULT
hr
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
EnterCriticalSection
(
&
d3d9_cs
);
TRACE
(
"(%p) calling IWineD3DSurface_LockRect %p %p %p %d
\n
"
,
This
,
This
->
wineD3DSurface
,
pLockedRect
,
pRect
,
Flags
);
return
IWineD3DSurface_LockRect
(
This
->
wineD3DSurface
,
(
WINED3DLOCKED_RECT
*
)
pLockedRect
,
pRect
,
Flags
);
hr
=
IWineD3DSurface_LockRect
(
This
->
wineD3DSurface
,
(
WINED3DLOCKED_RECT
*
)
pLockedRect
,
pRect
,
Flags
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
hr
;
}
static
HRESULT
WINAPI
IDirect3DSurface9Impl_UnlockRect
(
LPDIRECT3DSURFACE9
iface
)
{
IDirect3DSurface9Impl
*
This
=
(
IDirect3DSurface9Impl
*
)
iface
;
HRESULT
hr
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
return
IWineD3DSurface_UnlockRect
(
This
->
wineD3DSurface
);
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3DSurface_UnlockRect
(
This
->
wineD3DSurface
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
hr
;
}
static
HRESULT
WINAPI
IDirect3DSurface9Impl_GetDC
(
LPDIRECT3DSURFACE9
iface
,
HDC
*
phdc
)
{
IDirect3DSurface9Impl
*
This
=
(
IDirect3DSurface9Impl
*
)
iface
;
HRESULT
hr
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
return
IWineD3DSurface_GetDC
(
This
->
wineD3DSurface
,
phdc
);
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3DSurface_GetDC
(
This
->
wineD3DSurface
,
phdc
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
hr
;
}
static
HRESULT
WINAPI
IDirect3DSurface9Impl_ReleaseDC
(
LPDIRECT3DSURFACE9
iface
,
HDC
hdc
)
{
IDirect3DSurface9Impl
*
This
=
(
IDirect3DSurface9Impl
*
)
iface
;
HRESULT
hr
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
return
IWineD3DSurface_ReleaseDC
(
This
->
wineD3DSurface
,
hdc
);
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3DSurface_ReleaseDC
(
This
->
wineD3DSurface
,
hdc
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
hr
;
}
...
...
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