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
03bbb464
Commit
03bbb464
authored
Aug 16, 2002
by
Mike McCormack
Committed by
Alexandre Julliard
Aug 16, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't try reading a PIDL in IPersistStream->Load if its size is 0.
Check the number of bytes read was correct. Small reorganization of error handling.
parent
9e4c409b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
18 deletions
+24
-18
shelllink.c
dlls/shell32/shelllink.c
+24
-18
No files found.
dlls/shell32/shelllink.c
View file @
03bbb464
...
...
@@ -870,17 +870,30 @@ static HRESULT WINAPI IPersistStream_fnLoad(
}
IStream_AddRef
(
pLoadStream
);
if
(
lpLinkHeader
)
{
if
(
SUCCEEDED
(
IStream_Read
(
pLoadStream
,
lpLinkHeader
,
LINK_HEADER_SIZE
,
&
dwBytesRead
)))
{
if
((
lpLinkHeader
->
MagicStr
==
0x0000004CL
)
&&
IsEqualIID
(
&
lpLinkHeader
->
MagicGuid
,
&
CLSID_ShellLink
))
if
(
!
lpLinkHeader
)
goto
end
;
dwBytesRead
=
0
;
if
(
!
(
SUCCEEDED
(
IStream_Read
(
pLoadStream
,
lpLinkHeader
,
LINK_HEADER_SIZE
,
&
dwBytesRead
))))
goto
end
;
if
(
dwBytesRead
!=
LINK_HEADER_SIZE
)
goto
end
;
if
(
(
lpLinkHeader
->
MagicStr
!=
0x0000004CL
)
||
!
IsEqualIID
(
&
lpLinkHeader
->
MagicGuid
,
&
CLSID_ShellLink
)
)
goto
end
;
if
(
lpLinkHeader
->
PidlSize
)
{
lpLinkHeader
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
lpLinkHeader
,
LINK_HEADER_SIZE
+
lpLinkHeader
->
PidlSize
);
if
(
lpLinkHeader
)
{
if
(
SUCCEEDED
(
IStream_Read
(
pLoadStream
,
&
(
lpLinkHeader
->
Pidl
),
lpLinkHeader
->
PidlSize
,
&
dwBytesRead
)))
{
if
(
!
lpLinkHeader
)
goto
end
;
dwBytesRead
=
0
;
if
(
!
(
SUCCEEDED
(
IStream_Read
(
pLoadStream
,
&
(
lpLinkHeader
->
Pidl
),
lpLinkHeader
->
PidlSize
,
&
dwBytesRead
))))
goto
end
;
if
(
dwBytesRead
!=
lpLinkHeader
->
PidlSize
)
goto
end
;
if
(
pcheck
(
&
lpLinkHeader
->
Pidl
))
{
This
->
pPidl
=
ILClone
(
&
lpLinkHeader
->
Pidl
);
...
...
@@ -888,6 +901,7 @@ static HRESULT WINAPI IPersistStream_fnLoad(
SHGetPathFromIDListA
(
&
lpLinkHeader
->
Pidl
,
sTemp
);
This
->
sPath
=
heap_strdup
(
sTemp
);
}
}
This
->
wHotKey
=
lpLinkHeader
->
wHotKey
;
FileTimeToSystemTime
(
&
lpLinkHeader
->
Time1
,
&
This
->
time1
);
FileTimeToSystemTime
(
&
lpLinkHeader
->
Time2
,
&
This
->
time2
);
...
...
@@ -902,16 +916,8 @@ static HRESULT WINAPI IPersistStream_fnLoad(
pdump
(
This
->
pPidl
);
#endif
ret
=
S_OK
;
}
}
}
else
{
WARN
(
"stream contains no link!
\n
"
);
}
}
}
end:
IStream_Release
(
pLoadStream
);
pdump
(
This
->
pPidl
);
...
...
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