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
d22568d0
Commit
d22568d0
authored
Dec 18, 2007
by
Francois Gouget
Committed by
Alexandre Julliard
Dec 18, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32/tests: Use GetProcAddress() on SHGetPathFromIDListW() because it is missing on Windows 95.
parent
3874c55c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
19 deletions
+28
-19
shlfolder.c
dlls/shell32/tests/shlfolder.c
+28
-19
No files found.
dlls/shell32/tests/shlfolder.c
View file @
d22568d0
...
...
@@ -43,6 +43,7 @@
static
IMalloc
*
ppM
;
static
HRESULT
(
WINAPI
*
pSHBindToParent
)(
LPCITEMIDLIST
,
REFIID
,
LPVOID
*
,
LPCITEMIDLIST
*
);
static
BOOL
(
WINAPI
*
pSHGetPathFromIDListW
)(
LPCITEMIDLIST
,
LPWSTR
);
static
BOOL
(
WINAPI
*
pSHGetSpecialFolderPathW
)(
HWND
,
LPWSTR
,
int
,
BOOL
);
static
HRESULT
(
WINAPI
*
pStrRetToBufW
)(
STRRET
*
,
LPCITEMIDLIST
,
LPWSTR
,
UINT
);
static
LPITEMIDLIST
(
WINAPI
*
pILFindLastID
)(
LPCITEMIDLIST
);
...
...
@@ -56,6 +57,7 @@ static void init_function_pointers(void)
hmod
=
GetModuleHandleA
(
"shell32.dll"
);
pSHBindToParent
=
(
void
*
)
GetProcAddress
(
hmod
,
"SHBindToParent"
);
pSHGetPathFromIDListW
=
(
void
*
)
GetProcAddress
(
hmod
,
"SHGetPathFromIDListW"
);
pSHGetSpecialFolderPathW
=
(
void
*
)
GetProcAddress
(
hmod
,
"SHGetSpecialFolderPathW"
);
pILFindLastID
=
(
void
*
)
GetProcAddress
(
hmod
,
(
LPCSTR
)
16
);
pILFree
=
(
void
*
)
GetProcAddress
(
hmod
,
(
LPSTR
)
155
);
...
...
@@ -363,10 +365,10 @@ static void test_GetDisplayName(void)
static
const
WCHAR
wszDirName
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
't'
,
'e'
,
's'
,
't'
,
0
};
/* I'm trying to figure if there is a functional difference between calling
* SHGetPathFromIDList and calling GetDisplayNameOf(SHGDN_FORPARSING) after
* SHGetPathFromIDList
W
and calling GetDisplayNameOf(SHGDN_FORPARSING) after
* binding to the shellfolder. One thing I thought of was that perhaps
* SHGetPathFromIDList would be able to get the path to a file, which does
* not exist anymore, while the other method would
'n
t. It turns out there's
* SHGetPathFromIDList
W
would be able to get the path to a file, which does
* not exist anymore, while the other method would
n'
t. It turns out there's
* no functional difference in this respect.
*/
...
...
@@ -461,9 +463,12 @@ static void test_GetDisplayName(void)
RemoveDirectoryA
(
szTestDir
);
/* SHGetPathFromIDListW still works, although the file is not present anymore. */
result
=
SHGetPathFromIDListW
(
pidlTestFile
,
wszTestFile2
);
ok
(
result
,
"SHGetPathFromIDListW failed! Last error: %u
\n
"
,
GetLastError
());
ok
(
!
lstrcmpiW
(
wszTestFile
,
wszTestFile2
),
"SHGetPathFromIDListW returns incorrect path!
\n
"
);
if
(
pSHGetPathFromIDListW
)
{
result
=
pSHGetPathFromIDListW
(
pidlTestFile
,
wszTestFile2
);
ok
(
result
,
"SHGetPathFromIDListW failed! Last error: %u
\n
"
,
GetLastError
());
ok
(
!
lstrcmpiW
(
wszTestFile
,
wszTestFile2
),
"SHGetPathFromIDListW returns incorrect path!
\n
"
);
}
if
(
!
pSHBindToParent
)
return
;
...
...
@@ -793,26 +798,30 @@ static void test_SHGetPathFromIDList(void)
HMODULE
hShell32
;
LPITEMIDLIST
pidlPrograms
;
if
(
!
pSHGetSpecialFolderPathW
)
return
;
if
(
!
pSHGetPathFromIDListW
||
!
pSHGetSpecialFolderPathW
)
{
skip
(
"SHGetPathFromIDListW() or SHGetSpecialFolderPathW() is missing
\n
"
);
return
;
}
/* Calling SHGetPathFromIDList with no pidl should return the empty string */
/* Calling SHGetPathFromIDList
W
with no pidl should return the empty string */
wszPath
[
0
]
=
'a'
;
wszPath
[
1
]
=
'\0'
;
result
=
SHGetPathFromIDListW
(
NULL
,
wszPath
);
result
=
p
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. */
/* Calling SHGetPathFromIDList
W
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: %u
\n
"
,
GetLastError
());
if
(
!
result
)
return
;
result
=
SHGetPathFromIDListW
(
pidlEmpty
,
wszPath
);
result
=
p
SHGetPathFromIDListW
(
pidlEmpty
,
wszPath
);
ok
(
result
,
"SHGetPathFromIDListW failed! Last error: %u
\n
"
,
GetLastError
());
if
(
!
result
)
return
;
ok
(
!
lstrcmpiW
(
wszDesktop
,
wszPath
),
"SHGetPathFromIDList didn't return desktop path for empty pidl!
\n
"
);
ok
(
!
lstrcmpiW
(
wszDesktop
,
wszPath
),
"SHGetPathFromIDList
W
didn't return desktop path for empty pidl!
\n
"
);
/* MyComputer does not map to a filesystem path. SHGetPathFromIDList should fail. */
/* MyComputer does not map to a filesystem path. SHGetPathFromIDList
W
should fail. */
hr
=
SHGetDesktopFolder
(
&
psfDesktop
);
ok
(
SUCCEEDED
(
hr
),
"SHGetDesktopFolder failed! hr = %08x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
return
;
...
...
@@ -827,9 +836,9 @@ 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: %u
\n
"
,
GetLastError
());
result
=
p
SHGetPathFromIDListW
(
pidlMyComputer
,
wszPath
);
ok
(
!
result
,
"SHGetPathFromIDList
W
succeeded where it shouldn't!
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"SHGetPathFromIDList
W
shouldn't set last error! Last error: %u
\n
"
,
GetLastError
());
ok
(
!
wszPath
[
0
],
"Expected empty path
\n
"
);
if
(
result
)
{
IShellFolder_Release
(
psfDesktop
);
...
...
@@ -881,7 +890,7 @@ static void test_SHGetPathFromIDList(void)
"returned incorrect path for file placed on desktop
\n
"
);
}
result
=
SHGetPathFromIDListW
(
pidlTestFile
,
wszPath
);
result
=
p
SHGetPathFromIDListW
(
pidlTestFile
,
wszPath
);
ok
(
result
,
"SHGetPathFromIDListW failed! Last error: %u
\n
"
,
GetLastError
());
IMalloc_Free
(
ppM
,
pidlTestFile
);
if
(
!
result
)
return
;
...
...
@@ -896,9 +905,9 @@ static void test_SHGetPathFromIDList(void)
ok
(
SUCCEEDED
(
hr
),
"SHGetFolderLocation failed: 0x%08x
\n
"
,
hr
);
SetLastError
(
0xdeadbeef
);
result
=
SHGetPathFromIDListW
(
pidlPrograms
,
wszPath
);
result
=
p
SHGetPathFromIDListW
(
pidlPrograms
,
wszPath
);
IMalloc_Free
(
ppM
,
pidlPrograms
);
ok
(
result
,
"SHGetPathFromIDList failed
\n
"
);
ok
(
result
,
"SHGetPathFromIDList
W
failed
\n
"
);
}
static
void
test_EnumObjects_and_CompareIDs
(
void
)
...
...
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