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
1ae212a1
Commit
1ae212a1
authored
May 12, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
May 12, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split SHGetFileInfoW into two functions.
parent
ac5b0251
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
58 deletions
+62
-58
shell32_main.c
dlls/shell32/shell32_main.c
+62
-58
No files found.
dlls/shell32/shell32_main.c
View file @
1ae212a1
...
@@ -236,61 +236,8 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
...
@@ -236,61 +236,8 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
return
argv
;
return
argv
;
}
}
#define SHGFI_KNOWN_FLAGS \
static
DWORD
shgfi_get_exe_type
(
LPCWSTR
szFullPath
)
(SHGFI_SMALLICON | SHGFI_OPENICON | SHGFI_SHELLICONSIZE | SHGFI_PIDL | \
SHGFI_USEFILEATTRIBUTES | SHGFI_ADDOVERLAYS | SHGFI_OVERLAYINDEX | \
SHGFI_ICON | SHGFI_DISPLAYNAME | SHGFI_TYPENAME | SHGFI_ATTRIBUTES | \
SHGFI_ICONLOCATION | SHGFI_EXETYPE | SHGFI_SYSICONINDEX | \
SHGFI_LINKOVERLAY | SHGFI_SELECTED | SHGFI_ATTR_SPECIFIED)
/*************************************************************************
* SHGetFileInfoW [SHELL32.@]
*
*/
DWORD
WINAPI
SHGetFileInfoW
(
LPCWSTR
path
,
DWORD
dwFileAttributes
,
SHFILEINFOW
*
psfi
,
UINT
sizeofpsfi
,
UINT
flags
)
{
{
WCHAR
szLocation
[
MAX_PATH
],
szFullPath
[
MAX_PATH
];
int
iIndex
;
DWORD
ret
=
TRUE
,
dwAttributes
=
0
;
IShellFolder
*
psfParent
=
NULL
;
IExtractIconW
*
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"
:
debugstr_w
(
path
),
dwFileAttributes
,
psfi
,
psfi
->
dwAttributes
,
sizeofpsfi
,
flags
);
if
(
(
flags
&
SHGFI_USEFILEATTRIBUTES
)
&&
(
flags
&
(
SHGFI_ATTRIBUTES
|
SHGFI_EXETYPE
|
SHGFI_PIDL
)))
return
FALSE
;
/* windows initializes this values regardless of the flags */
if
(
psfi
!=
NULL
)
{
psfi
->
szDisplayName
[
0
]
=
'\0'
;
psfi
->
szTypeName
[
0
]
=
'\0'
;
psfi
->
iIcon
=
0
;
}
if
(
!
(
flags
&
SHGFI_PIDL
))
{
/* SHGitFileInfo should work with absolute and relative paths */
if
(
PathIsRelativeW
(
path
))
{
GetCurrentDirectoryW
(
MAX_PATH
,
szLocation
);
PathCombineW
(
szFullPath
,
szLocation
,
path
);
}
else
{
lstrcpynW
(
szFullPath
,
path
,
MAX_PATH
);
}
}
if
(
flags
&
SHGFI_EXETYPE
)
{
BOOL
status
=
FALSE
;
BOOL
status
=
FALSE
;
HANDLE
hfile
;
HANDLE
hfile
;
DWORD
BinaryType
;
DWORD
BinaryType
;
...
@@ -299,13 +246,10 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
...
@@ -299,13 +246,10 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
DWORD
len
;
DWORD
len
;
char
magic
[
4
];
char
magic
[
4
];
if
(
flags
!=
SHGFI_EXETYPE
)
return
0
;
status
=
GetBinaryTypeW
(
szFullPath
,
&
BinaryType
);
status
=
GetBinaryTypeW
(
szFullPath
,
&
BinaryType
);
if
(
!
status
)
if
(
!
status
)
return
0
;
return
0
;
if
((
BinaryType
==
SCS_DOS_BINARY
)
||
(
BinaryType
==
SCS_PIF_BINARY
)
)
if
(
BinaryType
==
SCS_DOS_BINARY
||
BinaryType
==
SCS_PIF_BINARY
)
return
0x4d5a
;
return
0x4d5a
;
hfile
=
CreateFileW
(
szFullPath
,
GENERIC_READ
,
FILE_SHARE_READ
,
hfile
=
CreateFileW
(
szFullPath
,
GENERIC_READ
,
FILE_SHARE_READ
,
...
@@ -351,6 +295,66 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
...
@@ -351,6 +295,66 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
}
}
CloseHandle
(
hfile
);
CloseHandle
(
hfile
);
return
0
;
return
0
;
}
#define SHGFI_KNOWN_FLAGS \
(SHGFI_SMALLICON | SHGFI_OPENICON | SHGFI_SHELLICONSIZE | SHGFI_PIDL | \
SHGFI_USEFILEATTRIBUTES | SHGFI_ADDOVERLAYS | SHGFI_OVERLAYINDEX | \
SHGFI_ICON | SHGFI_DISPLAYNAME | SHGFI_TYPENAME | SHGFI_ATTRIBUTES | \
SHGFI_ICONLOCATION | SHGFI_EXETYPE | SHGFI_SYSICONINDEX | \
SHGFI_LINKOVERLAY | SHGFI_SELECTED | SHGFI_ATTR_SPECIFIED)
/*************************************************************************
* SHGetFileInfoW [SHELL32.@]
*
*/
DWORD
WINAPI
SHGetFileInfoW
(
LPCWSTR
path
,
DWORD
dwFileAttributes
,
SHFILEINFOW
*
psfi
,
UINT
sizeofpsfi
,
UINT
flags
)
{
WCHAR
szLocation
[
MAX_PATH
],
szFullPath
[
MAX_PATH
];
int
iIndex
;
DWORD
ret
=
TRUE
,
dwAttributes
=
0
;
IShellFolder
*
psfParent
=
NULL
;
IExtractIconW
*
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"
:
debugstr_w
(
path
),
dwFileAttributes
,
psfi
,
psfi
->
dwAttributes
,
sizeofpsfi
,
flags
);
if
(
(
flags
&
SHGFI_USEFILEATTRIBUTES
)
&&
(
flags
&
(
SHGFI_ATTRIBUTES
|
SHGFI_EXETYPE
|
SHGFI_PIDL
)))
return
FALSE
;
/* windows initializes this values regardless of the flags */
if
(
psfi
!=
NULL
)
{
psfi
->
szDisplayName
[
0
]
=
'\0'
;
psfi
->
szTypeName
[
0
]
=
'\0'
;
psfi
->
iIcon
=
0
;
}
if
(
!
(
flags
&
SHGFI_PIDL
))
{
/* SHGetFileInfo should work with absolute and relative paths */
if
(
PathIsRelativeW
(
path
))
{
GetCurrentDirectoryW
(
MAX_PATH
,
szLocation
);
PathCombineW
(
szFullPath
,
szLocation
,
path
);
}
else
{
lstrcpynW
(
szFullPath
,
path
,
MAX_PATH
);
}
}
if
(
flags
&
SHGFI_EXETYPE
)
{
if
(
flags
!=
SHGFI_EXETYPE
)
return
0
;
return
shgfi_get_exe_type
(
szFullPath
);
}
}
/*
/*
...
...
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