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
114975d9
Commit
114975d9
authored
Jun 25, 2005
by
Michael Jung
Committed by
Alexandre Julliard
Jun 25, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a lurking infinite loop in SHGetPathFromIDList.
parent
41a97576
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
15 deletions
+27
-15
shlfolder.c
dlls/shell32/shlfolder.c
+27
-15
No files found.
dlls/shell32/shlfolder.c
View file @
114975d9
...
...
@@ -70,14 +70,26 @@ static const WCHAR wszDotShellClassInfo[] = {
* TRUE if returned non-NULL value.
* FALSE otherwise.
*/
BOOL
SHELL32_GetCustomFolderAttribute
(
LP
CITEMIDLIST
pidl
,
LPCWSTR
pwszHeading
,
LPCWSTR
pwszAttribute
,
static
inline
BOOL
SHELL32_GetCustomFolderAttributeFromPath
(
LP
WSTR
pwszFolderPath
,
LPCWSTR
pwszHeading
,
LPCWSTR
pwszAttribute
,
LPWSTR
pwszValue
,
DWORD
cchValue
)
{
static
const
WCHAR
wszDesktopIni
[]
=
{
'd'
,
'e'
,
's'
,
'k'
,
't'
,
'o'
,
'p'
,
'.'
,
'i'
,
'n'
,
'i'
,
0
};
static
const
WCHAR
wszDefault
[]
=
{
0
};
PathAddBackslashW
(
pwszFolderPath
);
PathAppendW
(
pwszFolderPath
,
wszDesktopIni
);
return
GetPrivateProfileStringW
(
pwszHeading
,
pwszAttribute
,
wszDefault
,
pwszValue
,
cchValue
,
pwszFolderPath
);
}
BOOL
SHELL32_GetCustomFolderAttribute
(
LPCITEMIDLIST
pidl
,
LPCWSTR
pwszHeading
,
LPCWSTR
pwszAttribute
,
LPWSTR
pwszValue
,
DWORD
cchValue
)
{
DWORD
dwAttrib
=
FILE_ATTRIBUTE_SYSTEM
;
WCHAR
wszFolderPath
[
MAX_PATH
];
/* Hack around not having system attribute on non-Windows file systems */
if
(
0
)
...
...
@@ -85,20 +97,15 @@ BOOL SHELL32_GetCustomFolderAttribute(
if
(
dwAttrib
&
FILE_ATTRIBUTE_SYSTEM
)
{
DWORD
ret
;
WCHAR
wszDesktopIniPath
[
MAX_PATH
];
if
(
!
SHGetPathFromIDListW
(
pidl
,
wszDesktopIniPath
))
if
(
!
SHGetPathFromIDListW
(
pidl
,
wszFolderPath
))
return
FALSE
;
PathAppendW
(
wszDesktopIniPath
,
wszDesktopIni
);
ret
=
GetPrivateProfileStringW
(
pwszHeading
,
pwszAttribute
,
wszDefault
,
pwszValue
,
cchValue
,
wszDesktopIniPath
);
return
ret
;
return
SHELL32_GetCustomFolderAttributeFromPath
(
wszFolderPath
,
pwszHeading
,
pwszAttribute
,
pwszValue
,
cchValue
);
}
return
FALSE
;
}
/***************************************************************************
* GetNextElement (internal function)
*
...
...
@@ -277,13 +284,18 @@ HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot,
/* file system folder */
CLSID
clsidFolder
=
CLSID_ShellFSFolder
;
static
const
WCHAR
wszCLSID
[]
=
{
'C'
,
'L'
,
'S'
,
'I'
,
'D'
,
0
};
WCHAR
wszCLSIDValue
[
CHARS_IN_GUID
];
LPITEMIDLIST
pidlAbsolute
=
ILCombine
(
pidlRoot
,
pidlChild
);
WCHAR
wszCLSIDValue
[
CHARS_IN_GUID
]
,
wszFolderPath
[
MAX_PATH
],
*
pwszPathTail
=
wszFolderPath
;
/* see if folder CLSID should be overridden by desktop.ini file */
if
(
SHELL32_GetCustomFolderAttribute
(
pidlAbsolute
,
if
(
pathRoot
)
{
MultiByteToWideChar
(
CP_ACP
,
0
,
pathRoot
,
-
1
,
wszFolderPath
,
MAX_PATH
);
pwszPathTail
=
PathAddBackslashW
(
wszFolderPath
);
}
MultiByteToWideChar
(
CP_ACP
,
0
,
_ILGetTextPointer
(
pidlChild
),
-
1
,
pwszPathTail
,
MAX_PATH
);
if
(
SHELL32_GetCustomFolderAttributeFromPath
(
wszFolderPath
,
wszDotShellClassInfo
,
wszCLSID
,
wszCLSIDValue
,
CHARS_IN_GUID
))
CLSIDFromString
(
wszCLSIDValue
,
&
clsidFolder
);
ILFree
(
pidlAbsolute
);
hr
=
SHELL32_CoCreateInitSF
(
pidlRoot
,
pathRoot
,
pidlChild
,
&
clsidFolder
,
&
IID_IShellFolder
,
(
LPVOID
*
)
&
pSF
);
}
...
...
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