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
ab6368b6
Commit
ab6368b6
authored
Mar 10, 2014
by
Stefan Dösinger
Committed by
Alexandre Julliard
Mar 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Don't modify existing data if set_private_data fails.
parent
9277fcfd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
resource.c
dlls/wined3d/resource.c
+6
-7
No files found.
dlls/wined3d/resource.c
View file @
ab6368b6
...
...
@@ -211,7 +211,11 @@ HRESULT CDECL wined3d_resource_set_private_data(struct wined3d_resource *resourc
TRACE
(
"resource %p, riid %s, data %p, data_size %u, flags %#x.
\n
"
,
resource
,
debugstr_guid
(
guid
),
data
,
data_size
,
flags
);
wined3d_resource_free_private_data
(
resource
,
guid
);
if
(
flags
&
WINED3DSPD_IUNKNOWN
&&
data_size
!=
sizeof
(
IUnknown
*
))
{
WARN
(
"IUnknown data with size %u, returning WINED3DERR_INVALIDCALL.
\n
"
,
data_size
);
return
WINED3DERR_INVALIDCALL
;
}
d
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
d
));
if
(
!
d
)
return
E_OUTOFMEMORY
;
...
...
@@ -221,12 +225,6 @@ HRESULT CDECL wined3d_resource_set_private_data(struct wined3d_resource *resourc
if
(
flags
&
WINED3DSPD_IUNKNOWN
)
{
if
(
data_size
!=
sizeof
(
IUnknown
*
))
{
WARN
(
"IUnknown data with size %u, returning WINED3DERR_INVALIDCALL.
\n
"
,
data_size
);
HeapFree
(
GetProcessHeap
(),
0
,
d
);
return
WINED3DERR_INVALIDCALL
;
}
d
->
ptr
.
object
=
(
IUnknown
*
)
data
;
d
->
size
=
sizeof
(
IUnknown
*
);
IUnknown_AddRef
(
d
->
ptr
.
object
);
...
...
@@ -242,6 +240,7 @@ HRESULT CDECL wined3d_resource_set_private_data(struct wined3d_resource *resourc
d
->
size
=
data_size
;
memcpy
(
d
->
ptr
.
data
,
data
,
data_size
);
}
wined3d_resource_free_private_data
(
resource
,
guid
);
list_add_tail
(
&
resource
->
privateData
,
&
d
->
entry
);
return
WINED3D_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