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
3ae80eb2
Commit
3ae80eb2
authored
Oct 23, 2001
by
Aric Stewart
Committed by
Alexandre Julliard
Oct 23, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the behavior for SHGetFileInfo when the SHGFI_USEFILEATTRIBUTES
flag is set. Corrects the given type and icon.
parent
ddc3317b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
6 deletions
+30
-6
classes.c
dlls/shell32/classes.c
+4
-0
shell32_main.c
dlls/shell32/shell32_main.c
+26
-6
No files found.
dlls/shell32/classes.c
View file @
3ae80eb2
...
...
@@ -27,6 +27,10 @@ BOOL HCR_MapTypeToValue ( LPCSTR szExtension, LPSTR szFileType, DWORD len, BOOL
TRACE
(
"%s %p
\n
"
,
szExtension
,
szFileType
);
/* added because we do not want to have double dots */
if
(
szExtension
[
0
]
==
'.'
)
bPrependDot
=
0
;
if
(
bPrependDot
)
strcpy
(
szTemp
,
"."
);
...
...
dlls/shell32/shell32_main.c
View file @
3ae80eb2
...
...
@@ -201,6 +201,7 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
IExtractIconA
*
pei
=
NULL
;
LPITEMIDLIST
pidlLast
=
NULL
,
pidl
=
NULL
;
HRESULT
hr
=
S_OK
;
BOOL
IconNotYetLoaded
=
TRUE
;
TRACE
(
"(%s fattr=0x%lx sfi=%p(attr=0x%08lx) size=0x%x flags=0x%x)
\n
"
,
(
flags
&
SHGFI_PIDL
)
?
"pidl"
:
path
,
dwFileAttributes
,
psfi
,
psfi
->
dwAttributes
,
sizeofpsfi
,
flags
);
...
...
@@ -323,7 +324,19 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
/* get the type name */
if
(
SUCCEEDED
(
hr
)
&&
(
flags
&
SHGFI_TYPENAME
))
{
_ILGetFileType
(
pidlLast
,
psfi
->
szTypeName
,
80
);
if
(
!
flags
&
SHGFI_USEFILEATTRIBUTES
)
_ILGetFileType
(
pidlLast
,
psfi
->
szTypeName
,
80
);
else
{
char
sTemp
[
64
];
strcpy
(
sTemp
,
PathFindExtensionA
(
path
));
if
(
!
(
HCR_MapTypeToValue
(
sTemp
,
sTemp
,
64
,
TRUE
)
&&
HCR_MapTypeToValue
(
sTemp
,
psfi
->
szTypeName
,
80
,
FALSE
)))
{
lstrcpynA
(
psfi
->
szTypeName
,
sTemp
,
80
-
6
);
strcat
(
psfi
->
szTypeName
,
"-file"
);
}
}
}
/* ### icons ###*/
...
...
@@ -359,6 +372,7 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
/* get icon index (or load icon)*/
if
(
SUCCEEDED
(
hr
)
&&
(
flags
&
(
SHGFI_ICON
|
SHGFI_SYSICONINDEX
)))
{
if
(
flags
&
SHGFI_USEFILEATTRIBUTES
)
{
char
sTemp
[
MAX_PATH
];
...
...
@@ -374,10 +388,16 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
{
strcpy
(
sTemp
,
path
);
}
/* FIXME: if sTemp contains a valid filename, get the icon
from there, index is in dwNr
*/
psfi
->
iIcon
=
2
;
IconNotYetLoaded
=
FALSE
;
psfi
->
iIcon
=
0
;
if
(
SHGFI_LARGEICON
)
PrivateExtractIconsA
(
sTemp
,
dwNr
,
GetSystemMetrics
(
SM_CXICON
),
GetSystemMetrics
(
SM_CYICON
),
&
psfi
->
hIcon
,
0
,
1
,
0
);
else
PrivateExtractIconsA
(
sTemp
,
dwNr
,
GetSystemMetrics
(
SM_CXSMICON
),
GetSystemMetrics
(
SM_CYSMICON
),
&
psfi
->
hIcon
,
0
,
1
,
0
);
}
else
/* default icon */
{
...
...
@@ -399,7 +419,7 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
}
/* icon handle */
if
(
SUCCEEDED
(
hr
)
&&
(
flags
&
SHGFI_ICON
))
if
(
SUCCEEDED
(
hr
)
&&
(
flags
&
SHGFI_ICON
)
&&
IconNotYetLoaded
)
psfi
->
hIcon
=
ImageList_GetIcon
((
flags
&
SHGFI_LARGEICON
)
?
ShellBigIconList
:
ShellSmallIconList
,
psfi
->
iIcon
,
ILD_NORMAL
);
if
(
flags
&
(
SHGFI_UNKNOWN1
|
SHGFI_UNKNOWN2
|
SHGFI_UNKNOWN3
))
...
...
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