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
961193bc
Commit
961193bc
authored
Jul 10, 2006
by
Juan Lang
Committed by
Alexandre Julliard
Jul 11, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Always NULL-terminate path in SHGetPathFromIDList.
parent
4d3877b6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
pidl.c
dlls/shell32/pidl.c
+2
-2
shlfolder.c
dlls/shell32/tests/shlfolder.c
+10
-0
No files found.
dlls/shell32/pidl.c
View file @
961193bc
...
...
@@ -1240,8 +1240,7 @@ BOOL WINAPI SHGetPathFromIDListA(LPCITEMIDLIST pidl, LPSTR pszPath)
BOOL
bSuccess
;
bSuccess
=
SHGetPathFromIDListW
(
pidl
,
wszPath
);
if
(
bSuccess
)
WideCharToMultiByte
(
CP_ACP
,
0
,
wszPath
,
-
1
,
pszPath
,
MAX_PATH
,
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
wszPath
,
-
1
,
pszPath
,
MAX_PATH
,
NULL
,
NULL
);
return
bSuccess
;
}
...
...
@@ -1262,6 +1261,7 @@ BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
TRACE_
(
shell
)(
"(pidl=%p,%p)
\n
"
,
pidl
,
pszPath
);
pdump
(
pidl
);
*
pszPath
=
'\0'
;
if
(
!
pidl
)
return
FALSE
;
...
...
dlls/shell32/tests/shlfolder.c
View file @
961193bc
...
...
@@ -771,6 +771,13 @@ static void test_SHGetPathFromIDList(void)
if
(
!
pSHGetSpecialFolderPathW
)
return
;
/* Calling SHGetPathFromIDList with no pidl should return the empty string */
wszPath
[
0
]
=
'a'
;
wszPath
[
1
]
=
'\0'
;
result
=
SHGetPathFromIDListW
(
NULL
,
wszPath
);
ok
(
!
result
,
"Expected failure
\n
"
);
ok
(
!
wszPath
[
0
],
"Expected empty string
\n
"
);
/* Calling SHGetPathFromIDList with an empty pidl should return the desktop folder's path. */
result
=
pSHGetSpecialFolderPathW
(
NULL
,
wszDesktop
,
CSIDL_DESKTOP
,
FALSE
);
ok
(
result
,
"SHGetSpecialFolderPathW(CSIDL_DESKTOP) failed! Last error: %08lx
\n
"
,
GetLastError
());
...
...
@@ -794,9 +801,12 @@ static void test_SHGetPathFromIDList(void)
}
SetLastError
(
0xdeadbeef
);
wszPath
[
0
]
=
'a'
;
wszPath
[
1
]
=
'\0'
;
result
=
SHGetPathFromIDListW
(
pidlMyComputer
,
wszPath
);
ok
(
!
result
,
"SHGetPathFromIDList succeeded where it shouldn't!
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"SHGetPathFromIDList shouldn't set last error! Last error: %08lx
\n
"
,
GetLastError
());
ok
(
!
wszPath
[
0
],
"Expected empty path
\n
"
);
if
(
result
)
{
IShellFolder_Release
(
psfDesktop
);
return
;
...
...
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