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
3ea18db3
Commit
3ea18db3
authored
Apr 22, 1999
by
Juergen Schmied
Committed by
Alexandre Julliard
Apr 22, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- more checks for valid pidl formats
parent
55c0bcaf
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
6 deletions
+63
-6
folders.c
dlls/shell32/folders.c
+1
-1
iconcache.c
dlls/shell32/iconcache.c
+5
-3
pidl.c
dlls/shell32/pidl.c
+51
-0
pidl.h
dlls/shell32/pidl.h
+1
-0
shell32_main.h
dlls/shell32/shell32_main.h
+1
-1
shelllink.c
dlls/shell32/shelllink.c
+4
-1
No files found.
dlls/shell32/folders.c
View file @
3ea18db3
...
...
@@ -195,7 +195,7 @@ static HRESULT WINAPI IExtractIconA_fnGetIconLocation(
}
}
TRACE
(
shell
,
"-- %s %x
\n
"
,
debugstr_a
(
szIconFile
)
,
*
piIndex
);
TRACE
(
shell
,
"-- %s %x
\n
"
,
(
ret
==
NOERROR
)
?
debugstr_a
(
szIconFile
)
:
"[error]"
,
*
piIndex
);
return
ret
;
}
/**************************************************************************
...
...
dlls/shell32/iconcache.c
View file @
3ea18db3
...
...
@@ -694,11 +694,13 @@ BOOL PidlToSicIndex (IShellFolder * sh, LPITEMIDLIST pidl, BOOL bBigIcon, UINT *
BOOL
ret
=
FALSE
;
UINT
dwFlags
=
0
;
TRACE
(
shell
,
"sf=%p pidl=%p
\n
"
,
sh
,
pidl
);
if
(
SUCCEEDED
(
IShellFolder_GetUIObjectOf
(
sh
,
0
,
1
,
&
pidl
,
&
IID_IExtractIconA
,
0
,
(
void
**
)
&
ei
)))
{
if
(
SUCCEEDED
(
IExtractIconA_GetIconLocation
(
ei
,
0
,
szIconFile
,
MAX_PATH
,
&
iSourceIndex
,
&
dwFlags
)
))
{
*
pIndex
=
SIC_GetIconIndex
(
szIconFile
,
iSourceIndex
);
ret
=
TRUE
;
if
(
NOERROR
==
IExtractIconA_GetIconLocation
(
ei
,
0
,
szIconFile
,
MAX_PATH
,
&
iSourceIndex
,
&
dwFlags
))
{
*
pIndex
=
SIC_GetIconIndex
(
szIconFile
,
iSourceIndex
);
ret
=
TRUE
;
}
IExtractIconA_Release
(
ei
);
}
...
...
dlls/shell32/pidl.c
View file @
3ea18db3
...
...
@@ -54,6 +54,45 @@ void pdump (LPCITEMIDLIST pidl)
TRACE
(
pidl
,
"empty pidl (Desktop)
\n
"
);
}
BOOL
pcheck
(
LPCITEMIDLIST
pidl
)
{
DWORD
type
,
ret
=
TRUE
;
LPITEMIDLIST
pidltemp
=
pidl
;
if
(
pidltemp
&&
pidltemp
->
mkid
.
cb
)
{
do
{
type
=
_ILGetDataPointer
(
pidltemp
)
->
type
;
switch
(
type
)
{
case
PT_DESKTOP
:
case
PT_MYCOMP
:
case
PT_SPECIAL
:
case
PT_DRIVE
:
case
PT_FOLDER
:
case
PT_VALUE
:
break
;
default
:
{
char
szTemp
[
100
];
/* 3*32 + 3 + 1 */
int
i
;
for
(
i
=
0
;
i
<
pidltemp
->
mkid
.
cb
;
i
++
)
{
sprintf
(
&
(
szTemp
[
i
*
3
]),
"%02x "
,
((
LPBYTE
)
pidltemp
)[
i
]);
if
(
i
>=
31
)
{
sprintf
(
&
(
szTemp
[
i
*
3
+
3
]),
"..."
);
break
;
}
}
ERR
(
pidl
,
"unknown IDLIST type size=%u type=%lx
\n
%s
\n
"
,
pidltemp
->
mkid
.
cb
,
type
,
szTemp
);
ret
=
FALSE
;
}
}
pidltemp
=
ILGetNext
(
pidltemp
);
}
while
(
pidltemp
->
mkid
.
cb
);
}
return
ret
;
}
/*************************************************************************
* ILGetDisplayName [SHELL32.15]
*/
...
...
@@ -169,6 +208,13 @@ HRESULT WINAPI ILLoadFromStream (IStream * pStream, LPITEMIDLIST * ppPidl)
*
ppPidl
=
NULL
;
}
}
/* we are not jet fully compatible */
if
(
!
pcheck
(
*
ppPidl
))
{
SHFree
(
*
ppPidl
);
*
ppPidl
=
NULL
;
}
IStream_Release
(
pStream
);
...
...
@@ -274,6 +320,11 @@ BOOL WINAPI ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
TRACE
(
pidl
,
"pidl1=%p pidl2=%p
\n
"
,
pidl1
,
pidl2
);
/* explorer reads from registry directly (StreamMRU),
so we can only check here */
if
((
!
pcheck
(
pidl1
))
||
(
!
pcheck
(
pidl2
)))
return
FALSE
;
pdump
(
pidl1
);
pdump
(
pidl2
);
...
...
dlls/shell32/pidl.h
View file @
3ea18db3
...
...
@@ -121,4 +121,5 @@ LPSTR WINAPI _ILGetTextPointer(PIDLTYPE type, LPPIDLDATA pidldata);
LPSTR
WINAPI
_ILGetSTextPointer
(
PIDLTYPE
type
,
LPPIDLDATA
pidldata
);
void
pdump
(
LPCITEMIDLIST
pidl
);
BOOL
pcheck
(
LPCITEMIDLIST
pidl
);
#endif
dlls/shell32/shell32_main.h
View file @
3ea18db3
...
...
@@ -74,7 +74,7 @@ HRESULT WINAPI StrRetToStrN (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST
#define INVALID_INDEX -1
BOOL
SIC_Initialize
(
void
);
void
SIC_Destroy
(
void
);
/*INT32 SIC_GetIconIndex (LPCSTR sSourceFile, INT32 dwSourceIndex );*/
BOOL
PidlToSicIndex
(
IShellFolder
*
sh
,
LPITEMIDLIST
pidl
,
BOOL
bBigIcon
,
UINT
*
pIndex
);
/* Classes Root */
BOOL
HCR_MapTypeToValue
(
LPCSTR
szExtension
,
LPSTR
szFileType
,
DWORD
len
);
...
...
dlls/shell32/shelllink.c
View file @
3ea18db3
...
...
@@ -209,11 +209,14 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile* iface, LPCOLESTR pszFile
pdump
(
&
pImage
->
Pidl
);
}
if
(
!
pcheck
(
&
pImage
->
Pidl
))
goto
end_3
;
This
->
pPidl
=
ILClone
(
&
pImage
->
Pidl
);
_ILGetPidlPath
(
&
pImage
->
Pidl
,
sTemp
,
512
);
This
->
sPath
=
HEAP_strdupA
(
GetProcessHeap
(),
0
,
sTemp
);
hRet
=
NOERROR
;
end_3:
UnmapViewOfFile
(
pImage
);
end_2:
CloseHandle
(
hMapping
);
...
...
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