Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
d0de7e72
Commit
d0de7e72
authored
May 21, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jun 04, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Hold the lock in IDirect3DMaterial methods.
parent
e38439bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
material.c
dlls/ddraw/material.c
+10
-1
No files found.
dlls/ddraw/material.c
View file @
d0de7e72
...
...
@@ -149,8 +149,10 @@ IDirect3DMaterialImpl_Release(IDirect3DMaterial3 *iface)
{
if
(
This
->
Handle
)
{
EnterCriticalSection
(
&
ddraw_cs
);
This
->
ddraw
->
d3ddevice
->
Handles
[
This
->
Handle
-
1
].
ptr
=
NULL
;
This
->
ddraw
->
d3ddevice
->
Handles
[
This
->
Handle
-
1
].
type
=
DDrawHandle_Unknown
;
LeaveCriticalSection
(
&
ddraw_cs
);
}
HeapFree
(
GetProcessHeap
(),
0
,
This
);
...
...
@@ -246,9 +248,11 @@ IDirect3DMaterialImpl_SetMaterial(IDirect3DMaterial3 *iface,
dump_material
(
lpMat
);
/* Stores the material */
EnterCriticalSection
(
&
ddraw_cs
);
memset
(
&
This
->
mat
,
0
,
sizeof
(
This
->
mat
));
memcpy
(
&
This
->
mat
,
lpMat
,
lpMat
->
dwSize
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
DD_OK
;
}
...
...
@@ -278,9 +282,11 @@ IDirect3DMaterialImpl_GetMaterial(IDirect3DMaterial3 *iface,
}
/* Copies the material structure */
EnterCriticalSection
(
&
ddraw_cs
);
dwSize
=
lpMat
->
dwSize
;
memset
(
lpMat
,
0
,
dwSize
);
memcpy
(
lpMat
,
&
This
->
mat
,
dwSize
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
DD_OK
;
}
...
...
@@ -309,6 +315,7 @@ IDirect3DMaterialImpl_GetHandle(IDirect3DMaterial3 *iface,
IDirect3DDeviceImpl
*
device
=
ICOM_OBJECT
(
IDirect3DDeviceImpl
,
IDirect3DDevice3
,
lpDirect3DDevice3
);
TRACE
(
"(%p/%p)->(%p,%p)
\n
"
,
This
,
iface
,
device
,
lpHandle
);
EnterCriticalSection
(
&
ddraw_cs
);
This
->
active_device
=
device
;
if
(
!
This
->
Handle
)
{
...
...
@@ -316,6 +323,7 @@ IDirect3DMaterialImpl_GetHandle(IDirect3DMaterial3 *iface,
if
(
!
This
->
Handle
)
{
ERR
(
"Error creating a handle
\n
"
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
DDERR_INVALIDPARAMS
;
/* Unchecked */
}
device
->
Handles
[
This
->
Handle
-
1
].
ptr
=
This
;
...
...
@@ -323,6 +331,7 @@ IDirect3DMaterialImpl_GetHandle(IDirect3DMaterial3 *iface,
}
*
lpHandle
=
This
->
Handle
;
TRACE
(
" returning handle %08x.
\n
"
,
*
lpHandle
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
D3D_OK
;
}
...
...
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