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
f0864c55
Commit
f0864c55
authored
Aug 04, 2008
by
Dan Kegel
Committed by
Alexandre Julliard
Aug 05, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32/tests: Test whether SHGetFileInfo should clear hIcon.
parent
29637c14
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
3 deletions
+72
-3
shlfileop.c
dlls/shell32/tests/shlfileop.c
+72
-3
No files found.
dlls/shell32/tests/shlfileop.c
View file @
f0864c55
...
@@ -154,19 +154,45 @@ static void clean_after_shfo_tests(void)
...
@@ -154,19 +154,45 @@ static void clean_after_shfo_tests(void)
static
void
test_get_file_info
(
void
)
static
void
test_get_file_info
(
void
)
{
{
DWORD
rc
,
rc2
;
DWORD
rc
,
rc2
;
SHFILEINFO
shfi
,
shfi2
;
SHFILEINFOA
shfi
,
shfi2
;
SHFILEINFOW
shfiw
;
char
notepad
[
MAX_PATH
];
char
notepad
[
MAX_PATH
];
/* Test whether fields of SHFILEINFOA are always cleared */
memset
(
&
shfi
,
0xcf
,
sizeof
(
shfi
));
rc
=
SHGetFileInfoA
(
""
,
0
,
&
shfi
,
sizeof
(
shfi
),
0
);
ok
(
rc
,
"SHGetFileInfoA('' | 0) should not fail
\n
"
);
todo_wine
ok
(
shfi
.
hIcon
==
0
,
"SHGetFileInfoA('' | 0) did not clear hIcon
\n
"
);
todo_wine
ok
(
shfi
.
szDisplayName
[
0
]
==
0
,
"SHGetFileInfoA('' | 0) did not clear szDisplayName[0]
\n
"
);
todo_wine
ok
(
shfi
.
szTypeName
[
0
]
==
0
,
"SHGetFileInfoA('' | 0) did not clear szTypeName[0]
\n
"
);
ok
(
shfi
.
iIcon
==
0xcfcfcfcf
,
"SHGetFileInfoA('' | 0) should not clear iIcon
\n
"
);
ok
(
shfi
.
dwAttributes
==
0xcfcfcfcf
,
"SHGetFileInfoA('' | 0) should not clear dwAttributes
\n
"
);
/* Test whether fields of SHFILEINFOW are always cleared */
memset
(
&
shfiw
,
0xcf
,
sizeof
(
shfiw
));
rc
=
SHGetFileInfoW
(
NULL
,
0
,
&
shfiw
,
sizeof
(
shfiw
),
0
);
todo_wine
ok
(
!
rc
,
"SHGetFileInfoW(NULL | 0) should fail
\n
"
);
ok
(
shfiw
.
hIcon
==
(
HANDLE
)
0xcfcfcfcf
,
"SHGetFileInfoW(NULL | 0) should not clear hIcon
\n
"
);
todo_wine
ok
(
shfiw
.
szDisplayName
[
0
]
==
0xcfcf
,
"SHGetFileInfoW(NULL | 0) should not clear szDisplayName[0]
\n
"
);
todo_wine
ok
(
shfiw
.
szTypeName
[
0
]
==
0xcfcf
,
"SHGetFileInfoW(NULL | 0) should not clear szTypeName[0]
\n
"
);
todo_wine
ok
(
shfiw
.
iIcon
==
0xcfcfcfcf
,
"SHGetFileInfoW(NULL | 0) should not clear iIcon
\n
"
);
ok
(
shfiw
.
dwAttributes
==
0xcfcfcfcf
,
"SHGetFileInfoW(NULL | 0) should not clear dwAttributes
\n
"
);
/* Test some flag combinations that MSDN claims are not allowed,
/* Test some flag combinations that MSDN claims are not allowed,
* but which work anyway
* but which work anyway
*/
*/
shfi
.
dwAttributes
=
0xdeadbeef
;
memset
(
&
shfi
,
0xcf
,
sizeof
(
shfi
))
;
rc
=
SHGetFileInfoA
(
"c:
\\
nonexistent"
,
FILE_ATTRIBUTE_DIRECTORY
,
rc
=
SHGetFileInfoA
(
"c:
\\
nonexistent"
,
FILE_ATTRIBUTE_DIRECTORY
,
&
shfi
,
sizeof
(
shfi
),
&
shfi
,
sizeof
(
shfi
),
SHGFI_ATTRIBUTES
|
SHGFI_USEFILEATTRIBUTES
);
SHGFI_ATTRIBUTES
|
SHGFI_USEFILEATTRIBUTES
);
todo_wine
ok
(
rc
,
"SHGetFileInfoA(c:
\\
nonexistent | SHGFI_ATTRIBUTES) failed
\n
"
);
todo_wine
ok
(
rc
,
"SHGetFileInfoA(c:
\\
nonexistent | SHGFI_ATTRIBUTES) failed
\n
"
);
if
(
rc
)
if
(
rc
)
ok
(
shfi
.
dwAttributes
!=
0xdeadbeef
,
"dwFileAttributes is not set
\n
"
);
ok
(
shfi
.
dwAttributes
!=
0xcfcfcfcf
,
"dwFileAttributes is not set
\n
"
);
todo_wine
ok
(
shfi
.
hIcon
==
0
,
"SHGetFileInfoA(c:
\\
nonexistent | SHGFI_ATTRIBUTES) did not clear hIcon
\n
"
);
todo_wine
ok
(
shfi
.
szDisplayName
[
0
]
==
0
,
"SHGetFileInfoA(c:
\\
nonexistent | SHGFI_ATTRIBUTES) did not clear szDisplayName[0]
\n
"
);
todo_wine
ok
(
shfi
.
szTypeName
[
0
]
==
0
,
"SHGetFileInfoA(c:
\\
nonexistent | SHGFI_ATTRIBUTES) did not clear szTypeName[0]
\n
"
);
ok
(
shfi
.
iIcon
==
0xcfcfcfcf
,
"SHGetFileInfoA(c:
\\
nonexistent | SHGFI_ATTRIBUTES) should not clear iIcon
\n
"
);
rc
=
SHGetFileInfoA
(
"c:
\\
nonexistent"
,
FILE_ATTRIBUTE_DIRECTORY
,
rc
=
SHGetFileInfoA
(
"c:
\\
nonexistent"
,
FILE_ATTRIBUTE_DIRECTORY
,
&
shfi
,
sizeof
(
shfi
),
&
shfi
,
sizeof
(
shfi
),
...
@@ -230,6 +256,48 @@ static void test_get_file_info(void)
...
@@ -230,6 +256,48 @@ static void test_get_file_info(void)
}
}
}
}
static
void
test_get_file_info_iconlist
(
void
)
{
/* Test retrieving a handle to the system image list, and
* what that returns for hIcon
*/
HRESULT
hr
;
HIMAGELIST
hSysImageList
;
LPITEMIDLIST
pidList
;
SHFILEINFOA
shInfoa
;
SHFILEINFOW
shInfow
;
hr
=
SHGetSpecialFolderLocation
(
NULL
,
CSIDL_DESKTOP
,
&
pidList
);
if
(
!
SUCCEEDED
(
hr
))
{
skip
(
"can't get desktop pidl
\n
"
);
return
;
}
memset
(
&
shInfoa
,
0xcf
,
sizeof
(
shInfoa
));
hSysImageList
=
(
HIMAGELIST
)
SHGetFileInfoA
((
const
char
*
)
pidList
,
0
,
&
shInfoa
,
sizeof
(
shInfoa
),
SHGFI_SYSICONINDEX
|
SHGFI_SMALLICON
|
SHGFI_PIDL
);
ok
(
hSysImageList
!=
INVALID_HANDLE_VALUE
,
"Can't get handle for CSIDL_DESKTOP imagelist
\n
"
);
todo_wine
ok
(
shInfoa
.
hIcon
==
0
,
"SHGetFileInfoA(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) did not clear hIcon
\n
"
);
todo_wine
ok
(
shInfoa
.
szTypeName
[
0
]
==
0
,
"SHGetFileInfoA(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) did not clear szTypeName[0]
\n
"
);
ok
(
shInfoa
.
iIcon
!=
0xcfcfcfcf
,
"SHGetFileInfoA(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) should set iIcon
\n
"
);
ok
(
shInfoa
.
dwAttributes
==
0xcfcfcfcf
,
"SHGetFileInfoA(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) should not change dwAttributes
\n
"
);
CloseHandle
(
hSysImageList
);
memset
(
&
shInfow
,
0xcf
,
sizeof
(
shInfow
));
hSysImageList
=
(
HIMAGELIST
)
SHGetFileInfoW
((
const
WCHAR
*
)
pidList
,
0
,
&
shInfow
,
sizeof
(
shInfow
),
SHGFI_SYSICONINDEX
|
SHGFI_SMALLICON
|
SHGFI_PIDL
);
ok
(
hSysImageList
!=
INVALID_HANDLE_VALUE
,
"Can't get handle for CSIDL_DESKTOP imagelist
\n
"
);
todo_wine
ok
(
shInfow
.
hIcon
==
0
,
"SHGetFileInfoW(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) did not clear hIcon
\n
"
);
ok
(
shInfow
.
szTypeName
[
0
]
==
0
,
"SHGetFileInfoW(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) did not clear szTypeName[0]
\n
"
);
ok
(
shInfow
.
iIcon
!=
0xcfcfcfcf
,
"SHGetFileInfoW(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) should set iIcon
\n
"
);
ok
(
shInfow
.
dwAttributes
==
0xcfcfcfcf
,
"SHGetFileInfoW(CSIDL_DESKTOP, SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_PIDL) should not change dwAttributes
\n
"
);
CloseHandle
(
hSysImageList
);
ILFree
(
pidList
);
}
/*
/*
puts into the specified buffer file names with current directory.
puts into the specified buffer file names with current directory.
...
@@ -1447,6 +1515,7 @@ START_TEST(shlfileop)
...
@@ -1447,6 +1515,7 @@ START_TEST(shlfileop)
init_shfo_tests
();
init_shfo_tests
();
test_get_file_info
();
test_get_file_info
();
test_get_file_info_iconlist
();
clean_after_shfo_tests
();
clean_after_shfo_tests
();
init_shfo_tests
();
init_shfo_tests
();
...
...
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