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
d8c15078
Commit
d8c15078
authored
Sep 29, 2012
by
Marcus Meissner
Committed by
Alexandre Julliard
Oct 01, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut2: Pass up errors on typelib writeout (Coverity).
parent
86d589b2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
typelib2.c
dlls/oleaut32/typelib2.c
+14
-7
No files found.
dlls/oleaut32/typelib2.c
View file @
d8c15078
...
...
@@ -4531,6 +4531,7 @@ static int ctl2_write_chunk(HANDLE hFile, const void *segment, int length)
{
DWORD
dwWritten
;
if
(
!
WriteFile
(
hFile
,
segment
,
length
,
&
dwWritten
,
0
))
{
TRACE
(
"Writefile(%p, %d) failed, lasterror %d
\n
"
,
segment
,
length
,
GetLastError
());
CloseHandle
(
hFile
);
return
0
;
}
...
...
@@ -4581,7 +4582,7 @@ static int ctl2_finalize_segment(ICreateTypeLib2Impl *This, int filepos, int seg
return
This
->
typelib_segdir
[
segment
].
length
;
}
static
void
ctl2_write_typeinfos
(
ICreateTypeLib2Impl
*
This
,
HANDLE
hFile
)
static
int
ctl2_write_typeinfos
(
ICreateTypeLib2Impl
*
This
,
HANDLE
hFile
)
{
ICreateTypeInfo2Impl
*
typeinfo
;
...
...
@@ -4592,21 +4593,27 @@ static void ctl2_write_typeinfos(ICreateTypeLib2Impl *This, HANDLE hFile)
if
(
!
typeinfo
->
typedata
)
continue
;
iter
=
typeinfo
->
typedata
->
next
;
ctl2_write_chunk
(
hFile
,
&
iter
->
u
.
val
,
sizeof
(
int
));
if
(
!
ctl2_write_chunk
(
hFile
,
&
iter
->
u
.
val
,
sizeof
(
int
)))
return
0
;
for
(
iter
=
iter
->
next
;
iter
!=
typeinfo
->
typedata
->
next
;
iter
=
iter
->
next
)
ctl2_write_chunk
(
hFile
,
iter
->
u
.
data
,
ctl2_get_record_size
(
iter
));
if
(
!
ctl2_write_chunk
(
hFile
,
iter
->
u
.
data
,
ctl2_get_record_size
(
iter
)))
return
0
;
for
(
iter
=
typeinfo
->
typedata
->
next
->
next
;
iter
!=
typeinfo
->
typedata
->
next
;
iter
=
iter
->
next
)
ctl2_write_chunk
(
hFile
,
&
iter
->
indice
,
sizeof
(
int
));
if
(
!
ctl2_write_chunk
(
hFile
,
&
iter
->
indice
,
sizeof
(
int
)))
return
0
;
for
(
iter
=
typeinfo
->
typedata
->
next
->
next
;
iter
!=
typeinfo
->
typedata
->
next
;
iter
=
iter
->
next
)
ctl2_write_chunk
(
hFile
,
&
iter
->
name
,
sizeof
(
int
));
if
(
!
ctl2_write_chunk
(
hFile
,
&
iter
->
name
,
sizeof
(
int
)))
return
0
;
for
(
iter
=
typeinfo
->
typedata
->
next
->
next
;
iter
!=
typeinfo
->
typedata
->
next
;
iter
=
iter
->
next
)
{
ctl2_write_chunk
(
hFile
,
&
offset
,
sizeof
(
int
));
if
(
!
ctl2_write_chunk
(
hFile
,
&
offset
,
sizeof
(
int
)))
return
0
;
offset
+=
ctl2_get_record_size
(
iter
);
}
}
return
1
;
}
/******************************************************************************
...
...
@@ -4669,7 +4676,7 @@ static HRESULT WINAPI ICreateTypeLib2_fnSaveAllChanges(ICreateTypeLib2 * iface)
if
(
!
ctl2_write_segment
(
This
,
hFile
,
MSFT_SEG_CUSTDATA
))
return
retval
;
if
(
!
ctl2_write_segment
(
This
,
hFile
,
MSFT_SEG_CUSTDATAGUID
))
return
retval
;
ctl2_write_typeinfos
(
This
,
hFile
)
;
if
(
!
ctl2_write_typeinfos
(
This
,
hFile
))
return
retval
;
if
(
!
CloseHandle
(
hFile
))
return
retval
;
...
...
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