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
11db4919
Commit
11db4919
authored
May 18, 2017
by
Huw Davies
Committed by
Alexandre Julliard
May 18, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Add a helper to copy FORMATETC structures.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f6ced249
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
8 deletions
+20
-8
compobj_private.h
dlls/ole32/compobj_private.h
+12
-0
oleobj.c
dlls/ole32/oleobj.c
+8
-8
No files found.
dlls/ole32/compobj_private.h
View file @
11db4919
...
...
@@ -334,4 +334,16 @@ static inline BOOL heap_free(void *mem)
return
HeapFree
(
GetProcessHeap
(),
0
,
mem
);
}
static
inline
HRESULT
copy_formatetc
(
FORMATETC
*
dst
,
const
FORMATETC
*
src
)
{
*
dst
=
*
src
;
if
(
src
->
ptd
)
{
dst
->
ptd
=
CoTaskMemAlloc
(
src
->
ptd
->
tdSize
);
if
(
!
dst
->
ptd
)
return
E_OUTOFMEMORY
;
memcpy
(
dst
->
ptd
,
src
->
ptd
,
src
->
ptd
->
tdSize
);
}
return
S_OK
;
}
#endif
/* __WINE_OLE_COMPOBJ_H */
dlls/ole32/oleobj.c
View file @
11db4919
...
...
@@ -56,14 +56,14 @@ static void release_statdata(STATDATA *data)
static
HRESULT
copy_statdata
(
STATDATA
*
dst
,
const
STATDATA
*
src
)
{
*
dst
=
*
src
;
if
(
src
->
formatetc
.
ptd
)
{
dst
->
formatetc
.
ptd
=
CoTaskMemAlloc
(
src
->
formatetc
.
ptd
->
tdSize
)
;
if
(
!
dst
->
formatetc
.
ptd
)
return
E_OUTOFMEMORY
;
memcpy
(
dst
->
formatetc
.
ptd
,
src
->
formatetc
.
ptd
,
src
->
formatetc
.
ptd
->
tdSize
)
;
}
if
(
dst
->
pAdvSink
)
IAdviseSink_AddRef
(
dst
->
pAdvSink
)
;
HRESULT
hr
;
hr
=
copy_formatetc
(
&
dst
->
formatetc
,
&
src
->
formatetc
);
if
(
FAILED
(
hr
))
return
hr
;
dst
->
advf
=
src
->
advf
;
dst
->
pAdvSink
=
src
->
pAdvSink
;
if
(
dst
->
pAdvSink
)
IAdviseSink_AddRef
(
dst
->
pAdvSink
);
dst
->
dwConnection
=
src
->
dwConnection
;
return
S_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