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
dec5b509
Commit
dec5b509
authored
Oct 29, 2000
by
Dave Pickles
Committed by
Alexandre Julliard
Oct 29, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement SHGFI_EXETYPE function of SHGetFileInfo.
parent
6f9c840c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
4 deletions
+59
-4
shell32_main.c
dlls/shell32/shell32_main.c
+59
-4
No files found.
dlls/shell32/shell32_main.c
View file @
dec5b509
...
@@ -118,6 +118,65 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
...
@@ -118,6 +118,65 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
psfi
->
szDisplayName
[
0
]
=
'\0'
;
psfi
->
szDisplayName
[
0
]
=
'\0'
;
psfi
->
szTypeName
[
0
]
=
'\0'
;
psfi
->
szTypeName
[
0
]
=
'\0'
;
psfi
->
iIcon
=
0
;
psfi
->
iIcon
=
0
;
if
(
flags
&
SHGFI_EXETYPE
)
{
BOOL
status
=
FALSE
;
HANDLE
hfile
;
DWORD
BinaryType
;
IMAGE_DOS_HEADER
mz_header
;
IMAGE_NT_HEADERS
nt
;
DWORD
len
;
char
magic
[
4
];
if
(
flags
!=
SHGFI_EXETYPE
)
return
0
;
status
=
GetBinaryTypeA
(
path
,
&
BinaryType
);
if
(
!
status
)
return
0
;
if
((
BinaryType
==
SCS_DOS_BINARY
)
||
(
BinaryType
==
SCS_PIF_BINARY
))
return
0x4d5a
;
hfile
=
CreateFileA
(
path
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
0
,
-
1
);
if
(
hfile
==
INVALID_HANDLE_VALUE
)
return
0
;
/* The next section is adapted from MODULE_GetBinaryType, as we need
* to examine the image header to get OS and version information. We
* know from calling GetBinaryTypeA that the image is valid and either
* an NE or PE, so much error handling can be omitted.
* Seek to the start of the file and read the header information.
*/
SetFilePointer
(
hfile
,
0
,
NULL
,
SEEK_SET
);
ReadFile
(
hfile
,
&
mz_header
,
sizeof
(
mz_header
),
&
len
,
NULL
);
SetFilePointer
(
hfile
,
mz_header
.
e_lfanew
,
NULL
,
SEEK_SET
);
ReadFile
(
hfile
,
magic
,
sizeof
(
magic
),
&
len
,
NULL
);
if
(
*
(
DWORD
*
)
magic
==
IMAGE_NT_SIGNATURE
)
{
SetFilePointer
(
hfile
,
mz_header
.
e_lfanew
,
NULL
,
SEEK_SET
);
ReadFile
(
hfile
,
&
nt
,
sizeof
(
nt
),
&
len
,
NULL
);
CloseHandle
(
hfile
);
if
(
nt
.
OptionalHeader
.
Subsystem
==
IMAGE_SUBSYSTEM_WINDOWS_GUI
)
{
return
IMAGE_NT_SIGNATURE
|
(
nt
.
OptionalHeader
.
MajorSubsystemVersion
<<
24
)
|
(
nt
.
OptionalHeader
.
MinorSubsystemVersion
<<
16
);
}
return
IMAGE_NT_SIGNATURE
;
}
else
if
(
*
(
WORD
*
)
magic
==
IMAGE_OS2_SIGNATURE
)
{
IMAGE_OS2_HEADER
ne
;
SetFilePointer
(
hfile
,
mz_header
.
e_lfanew
,
NULL
,
SEEK_SET
);
ReadFile
(
hfile
,
&
ne
,
sizeof
(
ne
),
&
len
,
NULL
);
CloseHandle
(
hfile
);
if
(
ne
.
ne_exetyp
==
2
)
return
IMAGE_OS2_SIGNATURE
|
(
ne
.
ne_expver
<<
16
);
return
0
;
}
CloseHandle
(
hfile
);
return
0
;
}
/* translate the path into a pidl only when SHGFI_USEFILEATTRIBUTES in not specified
/* translate the path into a pidl only when SHGFI_USEFILEATTRIBUTES in not specified
the pidl functions fail on not existing file names */
the pidl functions fail on not existing file names */
...
@@ -249,10 +308,6 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
...
@@ -249,10 +308,6 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
if
(
SUCCEEDED
(
hr
)
&&
(
flags
&
SHGFI_ICON
))
if
(
SUCCEEDED
(
hr
)
&&
(
flags
&
SHGFI_ICON
))
psfi
->
hIcon
=
pImageList_GetIcon
((
flags
&
SHGFI_LARGEICON
)
?
ShellBigIconList
:
ShellSmallIconList
,
psfi
->
iIcon
,
ILD_NORMAL
);
psfi
->
hIcon
=
pImageList_GetIcon
((
flags
&
SHGFI_LARGEICON
)
?
ShellBigIconList
:
ShellSmallIconList
,
psfi
->
iIcon
,
ILD_NORMAL
);
if
(
flags
&
SHGFI_EXETYPE
)
FIXME
(
"type of executable, stub
\n
"
);
if
(
flags
&
(
SHGFI_UNKNOWN1
|
SHGFI_UNKNOWN2
|
SHGFI_UNKNOWN3
))
if
(
flags
&
(
SHGFI_UNKNOWN1
|
SHGFI_UNKNOWN2
|
SHGFI_UNKNOWN3
))
FIXME
(
"unknown attribute!
\n
"
);
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