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
469d6ea2
Commit
469d6ea2
authored
Apr 16, 2009
by
Huw Davies
Committed by
Alexandre Julliard
Apr 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Add support for rendering storage data to the clipboard.
parent
f4745c0a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
1 deletion
+60
-1
clipboard.c
dlls/ole32/clipboard.c
+60
-1
No files found.
dlls/ole32/clipboard.c
View file @
469d6ea2
...
...
@@ -558,6 +558,61 @@ static inline ole_priv_data_entry *find_format_in_list(ole_priv_data_entry *entr
}
/***************************************************************************
* get_data_from_storage
*
* Returns storage data in an HGLOBAL.
*/
static
HRESULT
get_data_from_storage
(
IDataObject
*
data
,
FORMATETC
*
fmt
,
HGLOBAL
*
mem
)
{
HGLOBAL
h
;
IStorage
*
stg
;
HRESULT
hr
;
FORMATETC
stg_fmt
;
STGMEDIUM
med
;
ILockBytes
*
lbs
;
*
mem
=
NULL
;
h
=
GlobalAlloc
(
GMEM_DDESHARE
|
GMEM_MOVEABLE
,
0
);
if
(
!
h
)
return
E_OUTOFMEMORY
;
hr
=
CreateILockBytesOnHGlobal
(
h
,
FALSE
,
&
lbs
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
StgCreateDocfileOnILockBytes
(
lbs
,
STGM_CREATE
|
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
&
stg
);
ILockBytes_Release
(
lbs
);
}
if
(
FAILED
(
hr
))
{
GlobalFree
(
h
);
return
hr
;
}
stg_fmt
=
*
fmt
;
med
.
tymed
=
stg_fmt
.
tymed
=
TYMED_ISTORAGE
;
med
.
u
.
pstg
=
stg
;
med
.
pUnkForRelease
=
NULL
;
hr
=
IDataObject_GetDataHere
(
data
,
&
stg_fmt
,
&
med
);
if
(
FAILED
(
hr
))
{
med
.
u
.
pstg
=
NULL
;
hr
=
IDataObject_GetData
(
data
,
&
stg_fmt
,
&
med
);
if
(
FAILED
(
hr
))
goto
end
;
hr
=
IStorage_CopyTo
(
med
.
u
.
pstg
,
0
,
NULL
,
NULL
,
stg
);
ReleaseStgMedium
(
&
med
);
if
(
FAILED
(
hr
))
goto
end
;
}
*
mem
=
h
;
end:
IStorage_Release
(
stg
);
if
(
FAILED
(
hr
))
GlobalFree
(
h
);
return
hr
;
}
/***************************************************************************
* get_data_from_stream
*
* Returns stream data in an HGLOBAL.
...
...
@@ -656,7 +711,11 @@ static HRESULT render_format(IDataObject *data, LPFORMATETC fmt)
return
render_embed_source_hack
(
data
,
fmt
);
}
if
(
fmt
->
tymed
&
TYMED_ISTREAM
)
if
(
fmt
->
tymed
&
TYMED_ISTORAGE
)
{
hr
=
get_data_from_storage
(
data
,
fmt
,
&
clip_data
);
}
else
if
(
fmt
->
tymed
&
TYMED_ISTREAM
)
{
hr
=
get_data_from_stream
(
data
,
fmt
,
&
clip_data
);
}
...
...
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