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
4fa9f637
Commit
4fa9f637
authored
Aug 09, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Aug 09, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: IShellLink::SetPath removes quotes from the path.
parent
1cc186ba
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
1 deletion
+39
-1
shelllink.c
dlls/shell32/shelllink.c
+16
-1
shelllink.c
dlls/shell32/tests/shelllink.c
+23
-0
No files found.
dlls/shell32/shelllink.c
View file @
4fa9f637
...
...
@@ -2156,11 +2156,25 @@ static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile
{
IShellLinkImpl
*
This
=
impl_from_IShellLinkW
(
iface
);
WCHAR
buffer
[
MAX_PATH
];
LPWSTR
fname
;
LPWSTR
fname
,
unquoted
=
NULL
;
HRESULT
hr
=
S_OK
;
UINT
len
;
TRACE
(
"(%p)->(path=%s)
\n
"
,
This
,
debugstr_w
(
pszFile
));
/* quotes at the ends of the string are stripped */
len
=
lstrlenW
(
pszFile
);
if
(
pszFile
[
0
]
==
'"'
&&
pszFile
[
len
-
1
]
==
'"'
)
{
unquoted
=
strdupW
(
pszFile
);
PathUnquoteSpacesW
(
unquoted
);
pszFile
=
unquoted
;
}
/* any other quote marks are invalid */
if
(
strchrW
(
pszFile
,
'"'
))
return
S_FALSE
;
HeapFree
(
GetProcessHeap
(),
0
,
This
->
sPath
);
This
->
sPath
=
NULL
;
...
...
@@ -2191,6 +2205,7 @@ static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile
lstrcpyW
(
This
->
sPath
,
buffer
);
}
This
->
bDirty
=
TRUE
;
HeapFree
(
GetProcessHeap
(),
0
,
unquoted
);
return
hr
;
}
...
...
dlls/shell32/tests/shelllink.c
View file @
4fa9f637
...
...
@@ -216,6 +216,29 @@ static void test_get_set(void)
ok
(
lstrcmpi
(
buffer
,
mypath
)
==
0
,
"GetPath returned '%s'
\n
"
,
buffer
);
}
/* test path with quotes */
r
=
IShellLinkA_SetPath
(
sl
,
"
\"
c:
\\
nonexistent
\\
file
\"
"
);
ok
(
r
==
S_FALSE
,
"SetPath failed (0x%08lx)
\n
"
,
r
);
r
=
IShellLinkA_GetPath
(
sl
,
buffer
,
sizeof
(
buffer
),
NULL
,
SLGP_RAWPATH
);
ok
(
r
==
S_OK
,
"GetPath failed (0x%08lx)
\n
"
,
r
);
ok
(
!
lstrcmp
(
buffer
,
"C:
\\
nonexistent
\\
file"
),
"case doesn't match
\n
"
);
r
=
IShellLinkA_SetPath
(
sl
,
"
\"
c:
\\
foo"
);
ok
(
r
==
S_FALSE
,
"SetPath failed (0x%08lx)
\n
"
,
r
);
r
=
IShellLinkA_SetPath
(
sl
,
"
\"\"
c:
\\
foo"
);
ok
(
r
==
S_FALSE
,
"SetPath failed (0x%08lx)
\n
"
,
r
);
r
=
IShellLinkA_SetPath
(
sl
,
"c:
\\
foo
\"
"
);
ok
(
r
==
S_FALSE
,
"SetPath failed (0x%08lx)
\n
"
,
r
);
r
=
IShellLinkA_SetPath
(
sl
,
"
\"\"
c:
\\
foo
\"
"
);
ok
(
r
==
S_FALSE
,
"SetPath failed (0x%08lx)
\n
"
,
r
);
r
=
IShellLinkA_SetPath
(
sl
,
"
\"\"
c:
\\
foo
\"\"
"
);
ok
(
r
==
S_FALSE
,
"SetPath failed (0x%08lx)
\n
"
,
r
);
/* Test Getting / Setting the arguments */
strcpy
(
buffer
,
"garbage"
);
r
=
IShellLinkA_GetArguments
(
sl
,
buffer
,
sizeof
(
buffer
));
...
...
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