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
f8ddba3a
Commit
f8ddba3a
authored
Mar 04, 2024
by
Zebediah Figura
Committed by
Alexandre Julliard
Mar 06, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Implement IDataObject::SetData().
parent
4f02c8ba
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
14 deletions
+49
-14
dataobject.c
dlls/shell32/dataobject.c
+41
-3
shlfolder.c
dlls/shell32/tests/shlfolder.c
+8
-11
No files found.
dlls/shell32/dataobject.c
View file @
f8ddba3a
...
...
@@ -344,11 +344,49 @@ static HRESULT WINAPI IDataObject_fnGetCanonicalFormatEtc(IDataObject *iface, LP
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
IDataObject_fnSetData
(
IDataObject
*
iface
,
LPFORMATETC
pformatetc
,
STGMEDIUM
*
pmedium
,
BOOL
fRelease
)
static
HRESULT
WINAPI
IDataObject_fnSetData
(
IDataObject
*
iface
,
FORMATETC
*
format
,
STGMEDIUM
*
medium
,
BOOL
release
)
{
IDataObjectImpl
*
This
=
impl_from_IDataObject
(
iface
);
FIXME
(
"(%p)->()
\n
"
,
This
);
IDataObjectImpl
*
obj
=
impl_from_IDataObject
(
iface
);
struct
data
*
new_array
;
TRACE
(
"iface %p, format %p, medium %p, release %d.
\n
"
,
iface
,
format
,
medium
,
release
);
if
(
!
release
)
return
E_INVALIDARG
;
if
(
format
->
tymed
!=
TYMED_HGLOBAL
)
{
FIXME
(
"Unhandled format tymed %#lx.
\n
"
,
format
->
tymed
);
return
E_NOTIMPL
;
}
if
(
medium
->
tymed
!=
TYMED_HGLOBAL
)
{
FIXME
(
"Unhandled medium tymed %#lx.
\n
"
,
format
->
tymed
);
return
E_NOTIMPL
;
}
if
(
medium
->
pUnkForRelease
)
FIXME
(
"Ignoring IUnknown %p.
\n
"
,
medium
->
pUnkForRelease
);
for
(
size_t
i
=
0
;
i
<
obj
->
data_count
;
++
i
)
{
if
(
obj
->
data
[
i
].
cf
==
format
->
cfFormat
)
{
GlobalFree
(
obj
->
data
[
i
].
global
);
obj
->
data
[
i
].
global
=
medium
->
hGlobal
;
return
S_OK
;
}
}
if
(
!
(
new_array
=
realloc
(
obj
->
data
,
(
obj
->
data_count
+
1
)
*
sizeof
(
*
obj
->
data
))))
return
E_OUTOFMEMORY
;
obj
->
data
=
new_array
;
obj
->
data
[
obj
->
data_count
].
cf
=
format
->
cfFormat
;
obj
->
data
[
obj
->
data_count
].
global
=
medium
->
hGlobal
;
++
obj
->
data_count
;
return
S_OK
;
}
static
HRESULT
WINAPI
IDataObject_fnEnumFormatEtc
(
IDataObject
*
iface
,
DWORD
direction
,
IEnumFORMATETC
**
out
)
...
...
dlls/shell32/tests/shlfolder.c
View file @
f8ddba3a
...
...
@@ -5318,15 +5318,15 @@ static void test_enum_format(IDataObject *data_obj)
hr
=
IEnumFORMATETC_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IEnumFORMATETC_Skip
(
enum1
,
4
);
ok
(
hr
==
S_FALSE
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IEnumFORMATETC_Skip
(
enum1
,
1
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IEnumFORMATETC_Skip
(
enum1
,
1
);
ok
(
hr
==
S_FALSE
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IEnumFORMATETC_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IEnumFORMATETC_Skip
(
enum1
,
3
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IEnumFORMATETC_Skip
(
enum1
,
1
);
ok
(
hr
==
S_FALSE
,
"Got hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IEnumFORMATETC_Next
(
enum1
,
1
,
formats
,
NULL
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IEnumFORMATETC_Next
(
enum2
,
1
,
formats
,
NULL
);
...
...
@@ -5342,7 +5342,7 @@ static void test_enum_format(IDataObject *data_obj)
formats
[
0
].
lindex
=
-
1
;
formats
[
0
].
tymed
=
TYMED_HGLOBAL
;
hr
=
IDataObject_SetData
(
data_obj
,
&
formats
[
0
],
&
medium
,
TRUE
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IEnumFORMATETC_Reset
(
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
...
...
@@ -5457,23 +5457,20 @@ static void test_DataObject(void)
medium
.
hGlobal
=
global
;
fmt
.
tymed
=
TYMED_HGLOBAL
;
hr
=
IDataObject_SetData
(
data_obj
,
&
fmt
,
&
medium
,
FALSE
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDataObject_SetData
(
data_obj
,
&
fmt
,
&
medium
,
TRUE
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDataObject_QueryGetData
(
data_obj
,
&
fmt
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
memset
(
&
medium
,
0xcc
,
sizeof
(
medium
));
hr
=
IDataObject_GetData
(
data_obj
,
&
fmt
,
&
medium
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
ok
(
medium
.
hGlobal
&&
medium
.
hGlobal
!=
global
,
"Got global %p.
\n
"
,
medium
.
hGlobal
);
value
=
GlobalLock
(
medium
.
hGlobal
);
ok
(
*
value
==
0xabacab
,
"Got value %#x.
\n
"
,
*
value
);
GlobalUnlock
(
medium
.
hGlobal
);
ReleaseStgMedium
(
&
medium
);
}
for
(
unsigned
int
i
=
0
;
i
<
ARRAY_SIZE
(
enum_directions
);
++
i
)
{
...
...
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