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
34ef9824
Commit
34ef9824
authored
Mar 16, 2003
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Mar 16, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- make SHGetFileInfo handle relative paths
- fix requests for large icons
parent
2c8a52eb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
15 deletions
+25
-15
shell32_main.c
dlls/shell32/shell32_main.c
+25
-15
No files found.
dlls/shell32/shell32_main.c
View file @
34ef9824
...
...
@@ -209,7 +209,7 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
SHFILEINFOA
*
psfi
,
UINT
sizeofpsfi
,
UINT
flags
)
{
char
szLocation
[
MAX_PATH
];
char
szLocation
[
MAX_PATH
],
szFullPath
[
MAX_PATH
];
int
iIndex
;
DWORD
ret
=
TRUE
,
dwAttributes
=
0
;
IShellFolder
*
psfParent
=
NULL
;
...
...
@@ -229,6 +229,16 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
psfi
->
szTypeName
[
0
]
=
'\0'
;
psfi
->
iIcon
=
0
;
if
(
!
(
flags
&
SHGFI_PIDL
)){
/* SHGitFileInfo should work with absolute and relative paths */
if
(
PathIsRelativeA
(
path
)){
GetCurrentDirectoryA
(
MAX_PATH
,
szLocation
);
PathCombineA
(
szFullPath
,
szLocation
,
path
);
}
else
{
lstrcpynA
(
szFullPath
,
path
,
MAX_PATH
);
}
}
if
(
flags
&
SHGFI_EXETYPE
)
{
BOOL
status
=
FALSE
;
HANDLE
hfile
;
...
...
@@ -240,12 +250,12 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
if
(
flags
!=
SHGFI_EXETYPE
)
return
0
;
status
=
GetBinaryTypeA
(
p
ath
,
&
BinaryType
);
status
=
GetBinaryTypeA
(
szFullP
ath
,
&
BinaryType
);
if
(
!
status
)
return
0
;
if
((
BinaryType
==
SCS_DOS_BINARY
)
||
(
BinaryType
==
SCS_PIF_BINARY
))
return
0x4d5a
;
hfile
=
CreateFileA
(
p
ath
,
GENERIC_READ
,
FILE_SHARE_READ
,
hfile
=
CreateFileA
(
szFullP
ath
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
if
(
hfile
==
INVALID_HANDLE_VALUE
)
return
0
;
...
...
@@ -294,7 +304,7 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
if
(
flags
&
SHGFI_PIDL
)
{
pidl
=
ILClone
((
LPCITEMIDLIST
)
path
);
}
else
if
(
!
(
flags
&
SHGFI_USEFILEATTRIBUTES
))
{
hr
=
SHILCreateFromPathA
(
p
ath
,
&
pidl
,
&
dwAttributes
);
hr
=
SHILCreateFromPathA
(
szFullP
ath
,
&
pidl
,
&
dwAttributes
);
}
if
((
flags
&
SHGFI_PIDL
)
||
!
(
flags
&
SHGFI_USEFILEATTRIBUTES
))
...
...
@@ -324,7 +334,7 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
{
if
(
flags
&
SHGFI_USEFILEATTRIBUTES
)
{
strcpy
(
psfi
->
szDisplayName
,
PathFindFileNameA
(
p
ath
));
strcpy
(
psfi
->
szDisplayName
,
PathFindFileNameA
(
szFullP
ath
));
}
else
{
...
...
@@ -346,7 +356,7 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
else
{
char
sTemp
[
64
];
strcpy
(
sTemp
,
PathFindExtensionA
(
p
ath
));
strcpy
(
sTemp
,
PathFindExtensionA
(
szFullP
ath
));
if
(
!
(
HCR_MapTypeToValueA
(
sTemp
,
sTemp
,
64
,
TRUE
)
&&
HCR_MapTypeToValueA
(
sTemp
,
psfi
->
szTypeName
,
80
,
FALSE
)))
{
...
...
@@ -397,7 +407,7 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
char
*
szExt
;
DWORD
dwNr
=
0
;
lstrcpynA
(
sTemp
,
p
ath
,
MAX_PATH
);
lstrcpynA
(
sTemp
,
szFullP
ath
,
MAX_PATH
);
if
(
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
)
psfi
->
iIcon
=
2
;
...
...
@@ -409,7 +419,7 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
&&
HCR_GetDefaultIconA
(
sTemp
,
sTemp
,
MAX_PATH
,
&
dwNr
))
{
if
(
!
strcmp
(
"%1"
,
sTemp
))
/* icon is in the file */
strcpy
(
sTemp
,
p
ath
);
strcpy
(
sTemp
,
szFullP
ath
);
if
(
flags
&
SHGFI_SYSICONINDEX
)
{
...
...
@@ -419,10 +429,10 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
else
{
IconNotYetLoaded
=
FALSE
;
PrivateExtractIconsA
(
sTemp
,
dwNr
,(
flags
&
SHGFI_LARGE
ICON
)
?
GetSystemMetrics
(
SM_CX
ICON
)
:
GetSystemMetrics
(
SM_CXSM
ICON
),
(
flags
&
SHGFI_LARGEICON
)
?
GetSystemMetrics
(
SM_CY
ICON
)
:
GetSystemMetrics
(
SM_CY
SM
ICON
),
&
psfi
->
hIcon
,
0
,
1
,
0
);
PrivateExtractIconsA
(
sTemp
,
dwNr
,(
flags
&
SHGFI_SMALL
ICON
)
?
GetSystemMetrics
(
SM_CX
SMICON
)
:
GetSystemMetrics
(
SM_CX
ICON
),
(
flags
&
SHGFI_SMALLICON
)
?
GetSystemMetrics
(
SM_CYSM
ICON
)
:
GetSystemMetrics
(
SM_CYICON
),
&
psfi
->
hIcon
,
0
,
1
,
0
);
psfi
->
iIcon
=
dwNr
;
}
}
...
...
@@ -430,7 +440,7 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
}
else
{
if
(
!
(
PidlToSicIndex
(
psfParent
,
pidlLast
,
(
flags
&
SHGFI_LARGE
ICON
),
if
(
!
(
PidlToSicIndex
(
psfParent
,
pidlLast
,
!
(
flags
&
SHGFI_SMALL
ICON
),
(
flags
&
SHGFI_OPENICON
)
?
GIL_OPENICON
:
0
,
&
(
psfi
->
iIcon
))))
{
ret
=
FALSE
;
...
...
@@ -438,13 +448,13 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
}
if
(
ret
)
{
ret
=
(
DWORD
)
((
flags
&
SHGFI_LARGEICON
)
?
ShellBigIconList
:
ShellSmall
IconList
);
ret
=
(
DWORD
)
((
flags
&
SHGFI_SMALLICON
)
?
ShellSmallIconList
:
ShellBig
IconList
);
}
}
/* icon handle */
if
(
SUCCEEDED
(
hr
)
&&
(
flags
&
SHGFI_ICON
)
&&
IconNotYetLoaded
)
psfi
->
hIcon
=
ImageList_GetIcon
((
flags
&
SHGFI_LARGEICON
)
?
ShellBigIconList
:
ShellSmall
IconList
,
psfi
->
iIcon
,
ILD_NORMAL
);
psfi
->
hIcon
=
ImageList_GetIcon
((
flags
&
SHGFI_SMALLICON
)
?
ShellSmallIconList
:
ShellBig
IconList
,
psfi
->
iIcon
,
ILD_NORMAL
);
if
(
flags
&
(
SHGFI_UNKNOWN1
|
SHGFI_UNKNOWN2
|
SHGFI_UNKNOWN3
))
FIXME
(
"unknown attribute!
\n
"
);
...
...
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