Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
68fd74e7
Commit
68fd74e7
authored
Oct 25, 2023
by
Paul Gofman
Committed by
Alexandre Julliard
Oct 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Use SearchPathW() for %l/%L in SHELL_ArgifyW().
parent
2fcf40a6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
5 deletions
+35
-5
shlexec.c
dlls/shell32/shlexec.c
+9
-4
shlexec.c
dlls/shell32/tests/shlexec.c
+26
-1
No files found.
dlls/shell32/shlexec.c
View file @
68fd74e7
...
...
@@ -77,7 +77,7 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp
BOOL
found_p1
=
FALSE
;
PWSTR
res
=
out
;
PCWSTR
cmd
;
DWORD
used
=
0
;
DWORD
size
,
used
=
0
;
TRACE
(
"%p, %d, %s, %s, %p, %p
\n
"
,
out
,
len
,
debugstr_w
(
fmt
),
debugstr_w
(
lpFile
),
pidl
,
args
);
...
...
@@ -164,11 +164,16 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp
case
'l'
:
case
'L'
:
if
(
lpFile
)
{
used
+=
lstrlenW
(
lpFile
);
if
((
size
=
SearchPathW
(
NULL
,
lpFile
,
L".exe"
,
ARRAY_SIZE
(
xlpFile
),
xlpFile
,
NULL
)
&&
size
<=
ARRAY_SIZE
(
xlpFile
)))
cmd
=
xlpFile
;
else
cmd
=
lpFile
;
used
+=
lstrlenW
(
cmd
);
if
(
used
<
len
)
{
lstrcpyW
(
res
,
lpFile
);
res
+=
lstrlenW
(
lpFile
);
lstrcpyW
(
res
,
cmd
);
res
+=
lstrlenW
(
cmd
);
}
}
found_p1
=
TRUE
;
...
...
dlls/shell32/tests/shlexec.c
View file @
68fd74e7
...
...
@@ -1624,7 +1624,7 @@ static void test_argify(void)
static
void
test_filename
(
void
)
{
char
filename
[
MAX_PATH
+
20
];
char
filename
[
MAX_PATH
+
20
]
,
curdir
[
MAX_PATH
]
;
const
filename_tests_t
*
test
;
char
*
c
;
INT_PTR
rc
;
...
...
@@ -1635,6 +1635,31 @@ static void test_filename(void)
return
;
}
GetCurrentDirectoryA
(
sizeof
(
curdir
),
curdir
);
SetCurrentDirectoryA
(
tmpdir
);
rc
=
shell_execute
(
"QuotedLowerL"
,
"simple.shlexec"
,
NULL
,
NULL
);
if
(
rc
>
32
)
rc
=
33
;
okShell
(
rc
==
33
,
"failed: rc=%Id err=%lu
\n
"
,
rc
,
GetLastError
());
okChildInt
(
"argcA"
,
5
);
okChildString
(
"argvA3"
,
"QuotedLowerL"
);
strcpy
(
filename
,
tmpdir
);
strcat
(
filename
,
"
\\
simple.shlexec"
);
okChildPath
(
"argvA4"
,
filename
);
rc
=
shell_execute
(
"QuotedUpperL"
,
"simple.shlexec"
,
NULL
,
NULL
);
if
(
rc
>
32
)
rc
=
33
;
okShell
(
rc
==
33
,
"failed: rc=%Id err=%lu
\n
"
,
rc
,
GetLastError
());
okChildInt
(
"argcA"
,
5
);
okChildString
(
"argvA3"
,
"QuotedUpperL"
);
strcpy
(
filename
,
tmpdir
);
strcat
(
filename
,
"
\\
simple.shlexec"
);
okChildPath
(
"argvA4"
,
filename
);
SetCurrentDirectoryA
(
curdir
);
test
=
filename_tests
;
while
(
test
->
basename
)
{
...
...
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