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
fc69e4cf
Commit
fc69e4cf
authored
Jan 23, 2004
by
Martin Fuchs
Committed by
Alexandre Julliard
Jan 23, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved error handling.
SHELL32_GetItemAttributes(): support for SFGAO_LINK attribute.
parent
4cc64c8e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
7 deletions
+26
-7
shlfolder.c
dlls/shell32/shlfolder.c
+26
-7
No files found.
dlls/shell32/shlfolder.c
View file @
fc69e4cf
...
...
@@ -108,7 +108,7 @@ LPCWSTR GetNextElementW (LPCWSTR pszNext, LPWSTR pszOut, DWORD dwOut)
HRESULT
SHELL32_ParseNextElement
(
IShellFolder2
*
psf
,
HWND
hwndOwner
,
LPBC
pbc
,
LPITEMIDLIST
*
pidlInOut
,
LPOLESTR
szNext
,
DWORD
*
pEaten
,
DWORD
*
pdwAttributes
)
{
HRESULT
hr
=
E_
OUTOFMEMORY
;
HRESULT
hr
=
E_
INVALIDARG
;
LPITEMIDLIST
pidlOut
=
NULL
,
pidlTemp
=
NULL
;
IShellFolder
*
psfChild
;
...
...
@@ -124,6 +124,9 @@ HRESULT SHELL32_ParseNextElement (IShellFolder2 * psf, HWND hwndOwner, LPBC pbc,
pidlTemp
=
ILCombine
(
*
pidlInOut
,
pidlOut
);
if
(
!
pidlTemp
)
hr
=
E_OUTOFMEMORY
;
if
(
pidlOut
)
ILFree
(
pidlOut
);
}
...
...
@@ -150,17 +153,18 @@ HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot,
TRACE
(
"%p %p
\n
"
,
pidlRoot
,
pidlChild
);
if
(
SUCCEEDED
((
hr
=
SHCoCreateInstance
(
NULL
,
clsid
,
NULL
,
iid
,
ppvOut
))))
{
IPersistFolder
*
pPF
;
if
(
SUCCEEDED
((
hr
=
IUnknown_QueryInterface
((
IUnknown
*
)
*
ppvOut
,
&
IID_IPersistFolder
,
(
LPVOID
*
)
&
pPF
))))
{
LPITEMIDLIST
pidlAbsolute
;
pidlAbsolute
=
ILCombine
(
pidlRoot
,
pidlChild
);
IPersistFolder_Initialize
(
pPF
,
pidlAbsolute
);
IPersistFolder_Release
(
pPF
);
SHFree
(
pidlAbsolute
);
if
(
!
pidlAbsolute
)
hr
=
E_OUTOFMEMORY
;
}
}
...
...
@@ -207,8 +211,14 @@ HRESULT SHELL32_CoCreateInitSFEx (LPCITEMIDLIST pidlRoot,
szDestPath
[
0
]
=
'\0'
;
}
if
(
pidlChild
)
lstrcatA
(
szDestPath
,
_ILGetTextPointer
(
pidlChild
));
if
(
pidlChild
)
{
LPSTR
pszChild
=
_ILGetTextPointer
(
pidlChild
);
if
(
pszChild
)
lstrcatA
(
szDestPath
,
pszChild
);
else
hr
=
E_INVALIDARG
;
}
/* fill the PERSIST_FOLDER_TARGET_INFO */
ppfti
.
dwAttributes
=
-
1
;
...
...
@@ -289,7 +299,7 @@ HRESULT SHELL32_GetDisplayNameOfChild (IShellFolder2 * psf,
LPCITEMIDLIST
pidl
,
DWORD
dwFlags
,
LPSTR
szOut
,
DWORD
dwOutLen
)
{
LPITEMIDLIST
pidlFirst
;
HRESULT
hr
=
E_
OUTOFMEMORY
;
HRESULT
hr
=
E_
INVALIDARG
;
TRACE
(
"(%p)->(pidl=%p 0x%08lx %p 0x%08lx)
\n
"
,
psf
,
pidl
,
dwFlags
,
szOut
,
dwOutLen
);
pdump
(
pidl
);
...
...
@@ -310,7 +320,8 @@ HRESULT SHELL32_GetDisplayNameOfChild (IShellFolder2 * psf,
IShellFolder_Release
(
psfChild
);
}
ILFree
(
pidlFirst
);
}
}
else
hr
=
E_OUTOFMEMORY
;
TRACE
(
"-- ret=0x%08lx %s
\n
"
,
hr
,
szOut
);
...
...
@@ -346,6 +357,7 @@ HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWO
SFGAO_CANDELETE
|
/*0x00000020 */
SFGAO_HASPROPSHEET
|
/*0x00000040 */
SFGAO_DROPTARGET
|
/*0x00000100 */
SFGAO_LINK
|
/*0x00010000 */
SFGAO_READONLY
|
/*0x00040000 */
SFGAO_HIDDEN
|
/*0x00080000 */
SFGAO_FILESYSANCESTOR
|
/*0x10000000 */
...
...
@@ -381,6 +393,13 @@ HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWO
if
((
SFGAO_READONLY
&
*
pdwAttributes
)
&&
!
(
dwAttributes
&
FILE_ATTRIBUTE_READONLY
))
*
pdwAttributes
&=
~
SFGAO_READONLY
;
if
(
SFGAO_LINK
&
*
pdwAttributes
)
{
char
ext
[
MAX_PATH
];
if
(
!
_ILGetExtension
(
pidl
,
ext
,
MAX_PATH
)
||
strcasecmp
(
ext
,
"lnk"
))
*
pdwAttributes
&=
~
SFGAO_LINK
;
}
}
else
{
*
pdwAttributes
&=
SFGAO_HASSUBFOLDER
|
SFGAO_FOLDER
|
SFGAO_FILESYSANCESTOR
|
SFGAO_DROPTARGET
|
SFGAO_HASPROPSHEET
|
SFGAO_CANRENAME
|
SFGAO_CANLINK
;
}
...
...
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