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
fcd67649
Commit
fcd67649
authored
Jun 20, 2005
by
Stefan Leichter
Committed by
Alexandre Julliard
Jun 20, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make shell32 tests loadable on NT4.
parent
cca2b04a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
+25
-3
shlfolder.c
dlls/shell32/tests/shlfolder.c
+25
-3
No files found.
dlls/shell32/tests/shlfolder.c
View file @
fcd67649
...
@@ -41,6 +41,20 @@
...
@@ -41,6 +41,20 @@
static
IMalloc
*
ppM
;
static
IMalloc
*
ppM
;
static
HRESULT
(
WINAPI
*
pSHBindToParent
)(
LPCITEMIDLIST
,
REFIID
,
LPVOID
*
,
LPCITEMIDLIST
*
);
static
BOOL
(
WINAPI
*
pSHGetSpecialFolderPathW
)(
HWND
,
LPWSTR
,
int
,
BOOL
);
static
void
init_function_pointers
(
void
)
{
HMODULE
hmod
=
GetModuleHandleA
(
"shell32.dll"
);
if
(
hmod
)
{
pSHBindToParent
=
(
void
*
)
GetProcAddress
(
hmod
,
"SHBindToParent"
);
pSHGetSpecialFolderPathW
=
(
void
*
)
GetProcAddress
(
hmod
,
"SHGetSpecialFolderPathW"
);
}
}
/* creates a file with the specified name for tests */
/* creates a file with the specified name for tests */
static
void
CreateTestFile
(
const
CHAR
*
name
)
static
void
CreateTestFile
(
const
CHAR
*
name
)
{
{
...
@@ -238,8 +252,10 @@ static void test_GetDisplayName(void)
...
@@ -238,8 +252,10 @@ static void test_GetDisplayName(void)
* no functional difference in this respect.
* no functional difference in this respect.
*/
*/
if
(
!
pSHGetSpecialFolderPathW
)
return
;
/* First creating a directory in MyDocuments and a file in this directory. */
/* First creating a directory in MyDocuments and a file in this directory. */
result
=
SHGetSpecialFolderPathW
(
NULL
,
wszTestDir
,
CSIDL_PERSONAL
,
FALSE
);
result
=
p
SHGetSpecialFolderPathW
(
NULL
,
wszTestDir
,
CSIDL_PERSONAL
,
FALSE
);
ok
(
result
,
"SHGetSpecialFolderPathW failed! Last error: %08lx
\n
"
,
GetLastError
());
ok
(
result
,
"SHGetSpecialFolderPathW failed! Last error: %08lx
\n
"
,
GetLastError
());
if
(
!
result
)
return
;
if
(
!
result
)
return
;
...
@@ -287,8 +303,10 @@ static void test_GetDisplayName(void)
...
@@ -287,8 +303,10 @@ static void test_GetDisplayName(void)
ok
(
result
,
"SHGetPathFromIDListW failed! Last error: %08lx
\n
"
,
GetLastError
());
ok
(
result
,
"SHGetPathFromIDListW failed! Last error: %08lx
\n
"
,
GetLastError
());
ok
(
!
lstrcmpiW
(
wszTestFile
,
wszTestFile2
),
"SHGetPathFromIDListW returns incorrect path!
\n
"
);
ok
(
!
lstrcmpiW
(
wszTestFile
,
wszTestFile2
),
"SHGetPathFromIDListW returns incorrect path!
\n
"
);
if
(
!
pSHBindToParent
)
return
;
/* Binding to the folder and querying the display name of the file also works. */
/* Binding to the folder and querying the display name of the file also works. */
hr
=
SHBindToParent
(
pidlTestFile
,
&
IID_IShellFolder
,
(
VOID
**
)
&
psfPersonal
,
&
pidlLast
);
hr
=
p
SHBindToParent
(
pidlTestFile
,
&
IID_IShellFolder
,
(
VOID
**
)
&
psfPersonal
,
&
pidlLast
);
ok
(
SUCCEEDED
(
hr
),
"SHBindToParent failed! hr = %08lx
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"SHBindToParent failed! hr = %08lx
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
if
(
FAILED
(
hr
))
{
IShellFolder_Release
(
psfDesktop
);
IShellFolder_Release
(
psfDesktop
);
...
@@ -399,8 +417,10 @@ static void test_SHGetPathFromIDList(void)
...
@@ -399,8 +417,10 @@ static void test_SHGetPathFromIDList(void)
':'
,
':'
,
'{'
,
'2'
,
'0'
,
'D'
,
'0'
,
'4'
,
'F'
,
'E'
,
'0'
,
'-'
,
'3'
,
'A'
,
'E'
,
'A'
,
'-'
,
'1'
,
'0'
,
'6'
,
'9'
,
'-'
,
':'
,
':'
,
'{'
,
'2'
,
'0'
,
'D'
,
'0'
,
'4'
,
'F'
,
'E'
,
'0'
,
'-'
,
'3'
,
'A'
,
'E'
,
'A'
,
'-'
,
'1'
,
'0'
,
'6'
,
'9'
,
'-'
,
'A'
,
'2'
,
'D'
,
'8'
,
'-'
,
'0'
,
'8'
,
'0'
,
'0'
,
'2'
,
'B'
,
'3'
,
'0'
,
'3'
,
'0'
,
'9'
,
'D'
,
'}'
,
0
};
'A'
,
'2'
,
'D'
,
'8'
,
'-'
,
'0'
,
'8'
,
'0'
,
'0'
,
'2'
,
'B'
,
'3'
,
'0'
,
'3'
,
'0'
,
'9'
,
'D'
,
'}'
,
0
};
if
(
!
pSHGetSpecialFolderPathW
)
return
;
/* Calling SHGetPathFromIDList with an empty pidl should return the desktop folder's path. */
/* Calling SHGetPathFromIDList with an empty pidl should return the desktop folder's path. */
result
=
SHGetSpecialFolderPathW
(
NULL
,
wszDesktop
,
CSIDL_DESKTOP
,
FALSE
);
result
=
p
SHGetSpecialFolderPathW
(
NULL
,
wszDesktop
,
CSIDL_DESKTOP
,
FALSE
);
ok
(
result
,
"SHGetSpecialFolderPathW(CSIDL_DESKTOP) failed! Last error: %08lx
\n
"
,
GetLastError
());
ok
(
result
,
"SHGetSpecialFolderPathW(CSIDL_DESKTOP) failed! Last error: %08lx
\n
"
,
GetLastError
());
if
(
!
result
)
return
;
if
(
!
result
)
return
;
...
@@ -436,6 +456,8 @@ START_TEST(shlfolder)
...
@@ -436,6 +456,8 @@ START_TEST(shlfolder)
static
const
WCHAR
cTestDirW
[]
=
{
'\\'
,
't'
,
'e'
,
's'
,
't'
,
'd'
,
'i'
,
'r'
,
0
};
static
const
WCHAR
cTestDirW
[]
=
{
'\\'
,
't'
,
'e'
,
's'
,
't'
,
'd'
,
'i'
,
'r'
,
0
};
HRESULT
hr
;
HRESULT
hr
;
init_function_pointers
();
GetCurrentDirectoryA
(
MAX_PATH
,
cCurrDirA
);
GetCurrentDirectoryA
(
MAX_PATH
,
cCurrDirA
);
MultiByteToWideChar
(
CP_ACP
,
0
,
cCurrDirA
,
-
1
,
cCurrDirW
,
MAX_PATH
);
MultiByteToWideChar
(
CP_ACP
,
0
,
cCurrDirA
,
-
1
,
cCurrDirW
,
MAX_PATH
);
strcatW
(
cCurrDirW
,
cTestDirW
);
strcatW
(
cCurrDirW
,
cTestDirW
);
...
...
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