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
8d6a673c
Commit
8d6a673c
authored
May 23, 2005
by
Robert Shearman
Committed by
Alexandre Julliard
May 23, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Add error messages on failure in file moniker load function.
- Fix incorrect pointer check in both monikers. - Fix max size calculation of item moniker to match native.
parent
27d73d61
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
6 deletions
+20
-6
filemoniker.c
dlls/ole32/filemoniker.c
+16
-1
itemmoniker.c
dlls/ole32/itemmoniker.c
+4
-5
No files found.
dlls/ole32/filemoniker.c
View file @
8d6a673c
...
@@ -198,31 +198,46 @@ FileMonikerImpl_Load(IMoniker* iface,IStream* pStm)
...
@@ -198,31 +198,46 @@ FileMonikerImpl_Load(IMoniker* iface,IStream* pStm)
/* first WORD is non significative */
/* first WORD is non significative */
res
=
IStream_Read
(
pStm
,
&
wbuffer
,
sizeof
(
WORD
),
&
bread
);
res
=
IStream_Read
(
pStm
,
&
wbuffer
,
sizeof
(
WORD
),
&
bread
);
if
(
bread
!=
sizeof
(
WORD
)
||
wbuffer
!=
0
)
if
(
bread
!=
sizeof
(
WORD
)
||
wbuffer
!=
0
)
{
ERR
(
"Couldn't read 0 word
\n
"
);
return
E_FAIL
;
return
E_FAIL
;
}
/* read filePath string length (plus one) */
/* read filePath string length (plus one) */
res
=
IStream_Read
(
pStm
,
&
length
,
sizeof
(
DWORD
),
&
bread
);
res
=
IStream_Read
(
pStm
,
&
length
,
sizeof
(
DWORD
),
&
bread
);
if
(
bread
!=
sizeof
(
DWORD
))
if
(
bread
!=
sizeof
(
DWORD
))
{
ERR
(
"Couldn't read file string length
\n
"
);
return
E_FAIL
;
return
E_FAIL
;
}
/* read filePath string */
/* read filePath string */
filePathA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
length
);
filePathA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
length
);
res
=
IStream_Read
(
pStm
,
filePathA
,
length
,
&
bread
);
res
=
IStream_Read
(
pStm
,
filePathA
,
length
,
&
bread
);
HeapFree
(
GetProcessHeap
(),
0
,
filePathA
);
HeapFree
(
GetProcessHeap
(),
0
,
filePathA
);
if
(
bread
!=
length
)
if
(
bread
!=
length
)
{
ERR
(
"Couldn't read file path string
\n
"
);
return
E_FAIL
;
return
E_FAIL
;
}
/* read the first constant */
/* read the first constant */
IStream_Read
(
pStm
,
&
dwbuffer
,
sizeof
(
DWORD
),
&
bread
);
IStream_Read
(
pStm
,
&
dwbuffer
,
sizeof
(
DWORD
),
&
bread
);
if
(
bread
!=
sizeof
(
DWORD
)
||
dwbuffer
!=
0xDEADFFFF
)
if
(
bread
!=
sizeof
(
DWORD
)
||
dwbuffer
!=
0xDEADFFFF
)
{
ERR
(
"Couldn't read 0xDEADFFFF constant
\n
"
);
return
E_FAIL
;
return
E_FAIL
;
}
length
--
;
length
--
;
for
(
i
=
0
;
i
<
10
;
i
++
){
for
(
i
=
0
;
i
<
10
;
i
++
){
res
=
IStream_Read
(
pStm
,
&
wbuffer
,
sizeof
(
WORD
),
&
bread
);
res
=
IStream_Read
(
pStm
,
&
wbuffer
,
sizeof
(
WORD
),
&
bread
);
if
(
bread
!=
sizeof
(
WORD
)
||
wbuffer
!=
0
)
if
(
bread
!=
sizeof
(
WORD
)
||
wbuffer
!=
0
)
{
ERR
(
"Couldn't read 0 padding
\n
"
);
return
E_FAIL
;
return
E_FAIL
;
}
}
}
if
(
length
>
8
)
if
(
length
>
8
)
...
@@ -364,7 +379,7 @@ FileMonikerImpl_GetSizeMax(IMoniker* iface, ULARGE_INTEGER* pcbSize)
...
@@ -364,7 +379,7 @@ FileMonikerImpl_GetSizeMax(IMoniker* iface, ULARGE_INTEGER* pcbSize)
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pcbSize
);
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pcbSize
);
if
(
pcbSize
!=
NULL
)
if
(
!
pcbSize
)
return
E_POINTER
;
return
E_POINTER
;
/* for more details see FileMonikerImpl_Save coments */
/* for more details see FileMonikerImpl_Save coments */
...
...
dlls/ole32/itemmoniker.c
View file @
8d6a673c
...
@@ -369,17 +369,16 @@ HRESULT WINAPI ItemMonikerImpl_GetSizeMax(IMoniker* iface,
...
@@ -369,17 +369,16 @@ HRESULT WINAPI ItemMonikerImpl_GetSizeMax(IMoniker* iface,
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pcbSize
);
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pcbSize
);
if
(
pcbSize
!=
NULL
)
if
(
!
pcbSize
)
return
E_POINTER
;
return
E_POINTER
;
/* for more details see ItemMonikerImpl_Save coments */
/* for more details see ItemMonikerImpl_Save coments */
pcbSize
->
u
.
LowPart
=
sizeof
(
DWORD
)
+
/* DWORD which contains delimiter length */
pcbSize
->
u
.
LowPart
=
sizeof
(
DWORD
)
+
/* DWORD which contains delimiter length */
delimiterLength
+
/* item delimiter string */
delimiterLength
*
4
+
/* item delimiter string */
sizeof
(
DWORD
)
+
/* DWORD which contains item name length */
sizeof
(
DWORD
)
+
/* DWORD which contains item name length */
nameLength
+
/* item name string */
nameLength
*
4
+
/* item name string */
34
;
/* this constant was added ! because when I tested this function it usually */
18
;
/* strange, but true */
/* returns 34 bytes more than the number of bytes used by IMoniker::Save function */
pcbSize
->
u
.
HighPart
=
0
;
pcbSize
->
u
.
HighPart
=
0
;
return
S_OK
;
return
S_OK
;
...
...
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