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
d9fc7d27
Commit
d9fc7d27
authored
Feb 23, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 23, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Added SHGetPathFromIDListEx implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
dfb846c2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
7 deletions
+45
-7
pidl.c
dlls/shell32/pidl.c
+15
-4
shell32.spec
dlls/shell32/shell32.spec
+1
-0
shlfolder.c
dlls/shell32/tests/shlfolder.c
+29
-3
No files found.
dlls/shell32/pidl.c
View file @
d9fc7d27
...
...
@@ -1245,16 +1245,27 @@ BOOL WINAPI SHGetPathFromIDListA(LPCITEMIDLIST pidl, LPSTR pszPath)
*/
BOOL
WINAPI
SHGetPathFromIDListW
(
LPCITEMIDLIST
pidl
,
LPWSTR
pszPath
)
{
return
SHGetPathFromIDListEx
(
pidl
,
pszPath
,
MAX_PATH
,
0
);
}
/*************************************************************************
* SHGetPathFromIDListEx [SHELL32.@]
*/
BOOL
WINAPI
SHGetPathFromIDListEx
(
LPCITEMIDLIST
pidl
,
WCHAR
*
path
,
DWORD
path_size
,
GPFIDL_FLAGS
flags
)
{
HRESULT
hr
;
LPCITEMIDLIST
pidlLast
;
LPSHELLFOLDER
psfFolder
;
DWORD
dwAttributes
;
STRRET
strret
;
TRACE_
(
shell
)(
"(pidl=%p,%p
)
\n
"
,
pidl
,
pszPath
);
TRACE_
(
shell
)(
"(pidl=%p,%p
,%u,%x)
\n
"
,
pidl
,
path
,
path_size
,
flags
);
pdump
(
pidl
);
*
pszPath
=
'\0'
;
if
(
flags
!=
GPFIDL_DEFAULT
)
FIXME
(
"Unsupported flags %x
\n
"
,
flags
);
*
path
=
'\0'
;
if
(
!
pidl
)
return
FALSE
;
...
...
@@ -1272,9 +1283,9 @@ BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
IShellFolder_Release
(
psfFolder
);
if
(
FAILED
(
hr
))
return
FALSE
;
hr
=
StrRetToBufW
(
&
strret
,
pidlLast
,
p
szPath
,
MAX_PATH
);
hr
=
StrRetToBufW
(
&
strret
,
pidlLast
,
p
ath
,
path_size
);
TRACE_
(
shell
)(
"-- %s, 0x%08x
\n
"
,
debugstr_w
(
p
szP
ath
),
hr
);
TRACE_
(
shell
)(
"-- %s, 0x%08x
\n
"
,
debugstr_w
(
path
),
hr
);
return
SUCCEEDED
(
hr
);
}
...
...
dlls/shell32/shell32.spec
View file @
d9fc7d27
...
...
@@ -390,6 +390,7 @@
@ stdcall SHGetNewLinkInfo(str str ptr ptr long) SHGetNewLinkInfoA
@ stdcall SHGetPathFromIDList(ptr ptr) SHGetPathFromIDListA
@ stdcall SHGetPathFromIDListA(ptr ptr)
@ stdcall SHGetPathFromIDListEx(ptr ptr long long)
@ stdcall SHGetPathFromIDListW(ptr ptr)
@ stdcall SHGetPropertyStoreForWindow(long ptr ptr)
@ stdcall SHGetPropertyStoreFromParsingName(wstr ptr long ptr ptr)
...
...
dlls/shell32/tests/shlfolder.c
View file @
d9fc7d27
...
...
@@ -76,6 +76,7 @@ static HRESULT (WINAPI *pSHCreateDefaultContextMenu)(const DEFCONTEXTMENU*,REFII
static
HRESULT
(
WINAPI
*
pSHCreateShellFolderView
)(
const
SFV_CREATE
*
pcsfv
,
IShellView
**
ppsv
);
static
HRESULT
(
WINAPI
*
pSHCreateShellFolderViewEx
)(
LPCSFV
psvcbi
,
IShellView
**
ppv
);
static
HRESULT
(
WINAPI
*
pSHILCreateFromPath
)(
LPCWSTR
,
LPITEMIDLIST
*
,
DWORD
*
);
static
BOOL
(
WINAPI
*
pSHGetPathFromIDListEx
)(
PCIDLIST_ABSOLUTE
,
WCHAR
*
,
DWORD
,
GPFIDL_FLAGS
);
static
WCHAR
*
make_wstr
(
const
char
*
str
)
{
...
...
@@ -135,6 +136,7 @@ static void init_function_pointers(void)
MAKEFUNC
(
SHCreateDefaultContextMenu
);
MAKEFUNC
(
SHCreateShellFolderView
);
MAKEFUNC
(
SHCreateShellFolderViewEx
);
MAKEFUNC
(
SHGetPathFromIDListEx
);
#undef MAKEFUNC
#define MAKEFUNC_ORD(f, ord) (p##f = (void*)GetProcAddress(hmod, (LPSTR)(ord)))
...
...
@@ -1347,10 +1349,34 @@ static void test_SHGetPathFromIDList(void)
result
=
pSHGetPathFromIDListW
(
pidlTestFile
,
wszPath
);
ok
(
result
,
"SHGetPathFromIDListW failed! Last error: %u
\n
"
,
GetLastError
());
IMalloc_Free
(
ppM
,
pidlTestFile
);
if
(
!
result
)
return
;
ok
(
0
==
lstrcmpW
(
wszFileName
,
wszPath
),
"SHGetPathFromIDListW returned incorrect path for file placed on desktop
\n
"
);
if
(
pSHGetPathFromIDListEx
)
{
result
=
pSHGetPathFromIDListEx
(
pidlEmpty
,
wszPath
,
MAX_PATH
,
SFGAO_FILESYSTEM
);
ok
(
result
,
"SHGetPathFromIDListEx failed: %u
\n
"
,
GetLastError
());
ok
(
!
lstrcmpiW
(
wszDesktop
,
wszPath
),
"Unexpected SHGetPathFromIDListEx result %s, expected %s
\n
"
,
wine_dbgstr_w
(
wszPath
),
wine_dbgstr_w
(
wszDesktop
));
result
=
pSHGetPathFromIDListEx
(
pidlTestFile
,
wszPath
,
MAX_PATH
,
SFGAO_FILESYSTEM
);
ok
(
result
,
"SHGetPathFromIDListEx failed: %u
\n
"
,
GetLastError
());
ok
(
!
lstrcmpiW
(
wszFileName
,
wszPath
),
"Unexpected SHGetPathFromIDListEx result %s, expected %s
\n
"
,
wine_dbgstr_w
(
wszPath
),
wine_dbgstr_w
(
wszFileName
));
SetLastError
(
0xdeadbeef
);
memset
(
wszPath
,
0x55
,
sizeof
(
wszPath
));
result
=
pSHGetPathFromIDListEx
(
pidlTestFile
,
wszPath
,
5
,
SFGAO_FILESYSTEM
);
ok
(
!
result
,
"SHGetPathFromIDListEx returned: %x(%u)
\n
"
,
result
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
memset
(
wszPath
,
0x55
,
sizeof
(
wszPath
));
result
=
pSHGetPathFromIDListEx
(
pidlEmpty
,
wszPath
,
5
,
SFGAO_FILESYSTEM
);
ok
(
!
result
,
"SHGetPathFromIDListEx returned: %x(%u)
\n
"
,
result
,
GetLastError
());
}
else
win_skip
(
"SHGetPathFromIDListEx not available
\n
"
);
IMalloc_Free
(
ppM
,
pidlTestFile
);
/* Test if we can get the path from the start menu "program files" PIDL. */
hr
=
pSHGetSpecialFolderLocation
(
NULL
,
CSIDL_PROGRAM_FILES
,
&
pidlPrograms
);
...
...
@@ -1358,7 +1384,7 @@ static void test_SHGetPathFromIDList(void)
SetLastError
(
0xdeadbeef
);
result
=
pSHGetPathFromIDListW
(
pidlPrograms
,
wszPath
);
IMalloc_Free
(
ppM
,
pidlPrograms
);
IMalloc_Free
(
ppM
,
pidlPrograms
);
ok
(
result
,
"SHGetPathFromIDListW failed
\n
"
);
}
...
...
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