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
aa3165fc
Commit
aa3165fc
authored
Jan 18, 2007
by
Francois Gouget
Committed by
Alexandre Julliard
Jan 19, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Add proper support for SHGetFileInfo(SHGFI_ICONLOCATION | SHGFI_USEFILEATTRIBUTES).
parent
5c5933f6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
16 deletions
+43
-16
shell32_main.c
dlls/shell32/shell32_main.c
+40
-13
shlfileop.c
dlls/shell32/tests/shlfileop.c
+3
-3
No files found.
dlls/shell32/shell32_main.c
View file @
aa3165fc
...
...
@@ -356,14 +356,6 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
(
flags
&
(
SHGFI_ATTRIBUTES
|
SHGFI_EXETYPE
|
SHGFI_PIDL
)))
return
FALSE
;
if
(
(
flags
&
SHGFI_USEFILEATTRIBUTES
)
&&
(
flags
&
(
SHGFI_ICONLOCATION
|
SHGFI_ICON
|
SHGFI_SYSICONINDEX
))
)
{
FIXME
(
"This combination of flags is not supported yet
\n
"
);
/* And it would cause a crash, so return false instead */
return
FALSE
;
}
/* windows initializes these values regardless of the flags */
if
(
psfi
!=
NULL
)
{
...
...
@@ -519,6 +511,39 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
{
UINT
uDummy
,
uFlags
;
if
(
flags
&
SHGFI_USEFILEATTRIBUTES
)
{
if
(
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
)
{
lstrcpyW
(
psfi
->
szDisplayName
,
swShell32Name
);
psfi
->
iIcon
=
-
IDI_SHELL_FOLDER
;
}
else
{
WCHAR
*
szExt
;
static
const
WCHAR
p1W
[]
=
{
'%'
,
'1'
,
0
};
WCHAR
sTemp
[
MAX_PATH
];
szExt
=
(
LPWSTR
)
PathFindExtensionW
(
szFullPath
);
TRACE
(
"szExt=%s
\n
"
,
debugstr_w
(
szExt
));
if
(
szExt
&&
HCR_MapTypeToValueW
(
szExt
,
sTemp
,
MAX_PATH
,
TRUE
)
&&
HCR_GetDefaultIconW
(
sTemp
,
sTemp
,
MAX_PATH
,
&
psfi
->
iIcon
))
{
if
(
lstrcmpW
(
p1W
,
sTemp
))
strcpyW
(
psfi
->
szDisplayName
,
sTemp
);
else
{
/* the icon is in the file */
strcpyW
(
psfi
->
szDisplayName
,
szFullPath
);
}
}
else
ret
=
FALSE
;
}
}
else
{
hr
=
IShellFolder_GetUIObjectOf
(
psfParent
,
0
,
1
,
(
LPCITEMIDLIST
*
)
&
pidlLast
,
&
IID_IExtractIconW
,
&
uDummy
,
(
LPVOID
*
)
&
pei
);
...
...
@@ -526,16 +551,18 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
{
hr
=
IExtractIconW_GetIconLocation
(
pei
,
uGilFlags
,
szLocation
,
MAX_PATH
,
&
iIndex
,
&
uFlags
);
psfi
->
iIcon
=
iIndex
;
if
(
!
(
uFlags
&
GIL_NOTFILENAME
))
lstrcpyW
(
psfi
->
szDisplayName
,
szLocation
);
else
if
(
uFlags
&
GIL_NOTFILENAME
)
ret
=
FALSE
;
else
{
lstrcpyW
(
psfi
->
szDisplayName
,
szLocation
);
psfi
->
iIcon
=
iIndex
;
}
IExtractIconW_Release
(
pei
);
}
}
}
/* get icon index (or load icon)*/
if
(
SUCCEEDED
(
hr
)
&&
(
flags
&
(
SHGFI_ICON
|
SHGFI_SYSICONINDEX
)))
...
...
dlls/shell32/tests/shlfileop.c
View file @
aa3165fc
...
...
@@ -140,7 +140,7 @@ static void test_get_file_info(void)
rc
=
SHGetFileInfoA
(
"c:
\\
nonexistent"
,
FILE_ATTRIBUTE_DIRECTORY
,
&
shfi
,
sizeof
(
shfi
),
SHGFI_ICONLOCATION
|
SHGFI_USEFILEATTRIBUTES
);
todo_wine
ok
(
rc
,
"SHGetFileInfoA(c:
\\
nonexistent) failed
\n
"
);
ok
(
rc
,
"SHGetFileInfoA(c:
\\
nonexistent) failed
\n
"
);
if
(
rc
)
{
ok
(
strcpy
(
shfi
.
szDisplayName
,
"dummy"
)
!=
0
,
"SHGetFileInfoA(c:
\\
nonexistent) displayname is not set
\n
"
);
...
...
@@ -157,7 +157,7 @@ static void test_get_file_info(void)
rc
=
SHGetFileInfoA
(
notepad
,
GetFileAttributes
(
notepad
),
&
shfi
,
sizeof
(
shfi
),
SHGFI_ICONLOCATION
|
SHGFI_USEFILEATTRIBUTES
);
todo_wine
ok
(
rc
,
"SHGetFileInfoA(%s, SHGFI_USEFILEATTRIBUTES) failed
\n
"
,
notepad
);
ok
(
rc
,
"SHGetFileInfoA(%s, SHGFI_USEFILEATTRIBUTES) failed
\n
"
,
notepad
);
strcpy
(
shfi2
.
szDisplayName
,
"dummy"
);
shfi2
.
iIcon
=
0xdeadbeef
;
rc2
=
SHGetFileInfoA
(
notepad
,
0
,
...
...
@@ -177,7 +177,7 @@ static void test_get_file_info(void)
rc
=
SHGetFileInfoA
(
"test4.txt"
,
GetFileAttributes
(
"test4.txt"
),
&
shfi
,
sizeof
(
shfi
),
SHGFI_ICONLOCATION
|
SHGFI_USEFILEATTRIBUTES
);
todo_wine
ok
(
rc
,
"SHGetFileInfoA(test4.txt/, SHGFI_USEFILEATTRIBUTES) failed
\n
"
);
ok
(
rc
,
"SHGetFileInfoA(test4.txt/, SHGFI_USEFILEATTRIBUTES) failed
\n
"
);
strcpy
(
shfi2
.
szDisplayName
,
"dummy"
);
shfi2
.
iIcon
=
0xdeadbeef
;
rc2
=
SHGetFileInfoA
(
"test4.txt"
,
0
,
...
...
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