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
e5afb283
Commit
e5afb283
authored
Mar 05, 2024
by
Zebediah Figura
Committed by
Alexandre Julliard
Mar 07, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Respect the drop effect in do_paste().
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=34322
parent
a415874f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
20 deletions
+19
-20
shlview_cmenu.c
dlls/shell32/shlview_cmenu.c
+16
-1
shlfolder.c
dlls/shell32/tests/shlfolder.c
+3
-19
No files found.
dlls/shell32/shlview_cmenu.c
View file @
e5afb283
...
...
@@ -409,6 +409,7 @@ static WCHAR *build_source_paths(ITEMIDLIST *root_pidl, ITEMIDLIST **pidls, unsi
static
HRESULT
do_paste
(
ContextMenu
*
menu
,
HWND
hwnd
)
{
IPersistFolder2
*
dst_persist
;
const
DWORD
*
drop_effect
;
IShellFolder
*
dst_folder
;
WCHAR
dst_path
[
MAX_PATH
];
SHFILEOPSTRUCTW
op
=
{
0
};
...
...
@@ -456,13 +457,27 @@ static HRESULT do_paste(ContextMenu *menu, HWND hwnd)
ILFree
(
dst_pidl
);
op
.
hwnd
=
hwnd
;
op
.
wFunc
=
FO_COPY
;
op
.
pTo
=
dst_path
;
op
.
fFlags
=
FOF_ALLOWUNDO
;
if
(
FAILED
(
hr
=
OleGetClipboard
(
&
data
)))
return
hr
;
if
(
FAILED
(
hr
=
get_data_format
(
data
,
RegisterClipboardFormatW
(
CFSTR_PREFERREDDROPEFFECTW
),
&
medium
)))
{
ERR
(
"Failed to get drop effect.
\n
"
);
IDataObject_Release
(
data
);
return
hr
;
}
drop_effect
=
GlobalLock
(
medium
.
hGlobal
);
if
(
*
drop_effect
&
DROPEFFECT_COPY
)
op
.
wFunc
=
FO_COPY
;
else
if
(
*
drop_effect
&
DROPEFFECT_MOVE
)
op
.
wFunc
=
FO_MOVE
;
else
FIXME
(
"Unhandled drop effect %#lx.
\n
"
,
*
drop_effect
);
GlobalUnlock
(
medium
.
hGlobal
);
if
(
SUCCEEDED
(
get_data_format
(
data
,
RegisterClipboardFormatW
(
CFSTR_SHELLIDLISTW
),
&
medium
)))
{
const
CIDA
*
cida
=
GlobalLock
(
medium
.
hGlobal
);
...
...
dlls/shell32/tests/shlfolder.c
View file @
e5afb283
...
...
@@ -5890,14 +5890,7 @@ static void test_copy_paste(void)
format
.
cfFormat
=
RegisterClipboardFormatW
(
CFSTR_PREFERREDDROPEFFECTW
);
hr
=
IDataObject_GetData
(
data_obj
,
&
format
,
&
medium
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
effect
=
GlobalLock
(
medium
.
hGlobal
);
ok
(
*
effect
==
DROPEFFECT_MOVE
,
"Got effect %#lx.
\n
"
,
*
effect
);
GlobalUnlock
(
medium
.
hGlobal
);
ReleaseStgMedium
(
&
medium
);
}
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
IDataObject_Release
(
data_obj
);
...
...
@@ -5913,9 +5906,7 @@ static void test_copy_paste(void)
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
ret
=
MoveFileExW
(
L"testcopy_dst/testcopy_src"
,
L"testcopy_src"
,
0
);
todo_wine
ok
(
ret
,
"Got error %lu.
\n
"
,
GetLastError
());
if
(
!
ret
&&
GetLastError
()
==
ERROR_ALREADY_EXISTS
)
RemoveDirectoryW
(
L"testcopy_dst/testcopy_src"
);
ok
(
ret
,
"Got error %lu.
\n
"
,
GetLastError
());
/* Copy. */
...
...
@@ -5933,14 +5924,7 @@ static void test_copy_paste(void)
format
.
cfFormat
=
RegisterClipboardFormatW
(
CFSTR_PREFERREDDROPEFFECTW
);
hr
=
IDataObject_GetData
(
data_obj
,
&
format
,
&
medium
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
effect
=
GlobalLock
(
medium
.
hGlobal
);
ok
(
*
effect
==
(
DROPEFFECT_COPY
|
DROPEFFECT_LINK
),
"Got effect %#lx.
\n
"
,
*
effect
);
GlobalUnlock
(
medium
.
hGlobal
);
ReleaseStgMedium
(
&
medium
);
}
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
IDataObject_Release
(
data_obj
);
...
...
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