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
aa21d1ac
Commit
aa21d1ac
authored
Feb 24, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Feb 28, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Add support for Program Manager icons with arguments.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=52506
parent
e8bba584
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
7 deletions
+31
-7
dde.c
dlls/shell32/dde.c
+15
-6
progman_dde.c
dlls/shell32/tests/progman_dde.c
+16
-1
No files found.
dlls/shell32/dde.c
View file @
aa21d1ac
...
...
@@ -261,7 +261,7 @@ static DWORD PROGMAN_OnExecute(WCHAR *command, int argc, WCHAR **argv)
}
else
if
(
!
wcsicmp
(
command
,
L"AddItem"
))
{
WCHAR
*
path
,
*
name
;
WCHAR
*
target
,
*
space
=
NULL
,
*
path
,
*
name
;
IShellLinkW
*
link
;
IPersistFile
*
file
;
HRESULT
hres
;
...
...
@@ -272,15 +272,24 @@ static DWORD PROGMAN_OnExecute(WCHAR *command, int argc, WCHAR **argv)
&
IID_IShellLinkW
,
(
void
**
)
&
link
);
if
(
FAILED
(
hres
))
return
DDE_FNOTPROCESSED
;
len
=
SearchPathW
(
NULL
,
argv
[
0
],
L".exe"
,
0
,
NULL
,
NULL
);
if
(
len
==
0
)
target
=
wcsdup
(
argv
[
0
]
);
while
(
!
(
len
=
SearchPathW
(
NULL
,
target
,
L".exe"
,
0
,
NULL
,
NULL
))
)
{
IShellLinkW_Release
(
link
);
return
DDE_FNOTPROCESSED
;
/* progressively remove words from the end of the command line until we get a valid file name */
space
=
wcsrchr
(
target
,
' '
);
if
(
!
space
)
{
IShellLinkW_Release
(
link
);
free
(
target
);
return
DDE_FNOTPROCESSED
;
}
*
space
=
0
;
}
path
=
malloc
(
len
*
sizeof
(
WCHAR
));
SearchPathW
(
NULL
,
argv
[
0
]
,
L".exe"
,
len
,
path
,
NULL
);
SearchPathW
(
NULL
,
target
,
L".exe"
,
len
,
path
,
NULL
);
IShellLinkW_SetPath
(
link
,
path
);
if
(
space
)
IShellLinkW_SetArguments
(
link
,
argv
[
0
]
+
(
space
-
target
)
+
1
);
free
(
target
);
free
(
path
);
if
(
argc
>=
2
)
IShellLinkW_SetDescription
(
link
,
argv
[
1
]);
...
...
dlls/shell32/tests/progman_dde.c
View file @
aa21d1ac
...
...
@@ -231,10 +231,25 @@ static void test_parser(DWORD instance, HCONV hConv)
ok
(
error
==
DMLERR_NO_ERROR
,
"expected DMLERR_NO_ERROR, got %u
\n
"
,
error
);
ok
(
check_exists
(
"test/foobar.lnk"
),
"link not created
\n
"
);
error
=
dde_execute
(
instance
,
hConv
,
"[AddItem(notepad,foo bar)]"
);
error
=
dde_execute
(
instance
,
hConv
,
"[AddItem(notepad
\t
foo.txt,foo)]"
);
ok
(
error
==
DMLERR_NOTPROCESSED
,
"expected DMLERR_NOTPROCESSED, got %u
\n
"
,
error
);
error
=
dde_execute
(
instance
,
hConv
,
"[AddItem(notepad foo.txt,foo)]"
);
ok
(
error
==
DMLERR_NO_ERROR
,
"expected DMLERR_NO_ERROR, got %u
\n
"
,
error
);
ok
(
check_exists
(
"test/foo.lnk"
),
"link not created
\n
"
);
error
=
dde_execute
(
instance
,
hConv
,
"[AddItem(notepad foo.txt bar.txt,foo bar)]"
);
ok
(
error
==
DMLERR_NO_ERROR
,
"expected DMLERR_NO_ERROR, got %u
\n
"
,
error
);
ok
(
check_exists
(
"test/foo bar.lnk"
),
"link not created
\n
"
);
error
=
dde_execute
(
instance
,
hConv
,
"[AddItem(C:
\\
Program Files
\\
Internet Explorer
\\
iexplore.exe,IE)]"
);
ok
(
error
==
DMLERR_NO_ERROR
,
"expected DMLERR_NO_ERROR, got %u
\n
"
,
error
);
ok
(
check_exists
(
"test/IE.lnk"
),
"link not created
\n
"
);
error
=
dde_execute
(
instance
,
hConv
,
"[AddItem(C:
\\
Program Files
\\
Internet Explorer
\\
iexplore.exe https://www.winehq.org/,WineHQ)]"
);
ok
(
error
==
DMLERR_NO_ERROR
,
"expected DMLERR_NO_ERROR, got %u
\n
"
,
error
);
ok
(
check_exists
(
"test/WineHQ.lnk"
),
"link not created
\n
"
);
error
=
dde_execute
(
instance
,
hConv
,
"[AddItem(notepad,a[b,c]d)]"
);
ok
(
error
==
DMLERR_NOTPROCESSED
,
"expected DMLERR_NOTPROCESSED, got %u
\n
"
,
error
);
...
...
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