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
106156cb
Commit
106156cb
authored
Sep 11, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Sep 11, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Remove some assertions in the stuctured storage code by
returning error codes to the caller and by handling the error condition.
parent
79f7318a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
storage32.c
dlls/ole32/storage32.c
+18
-17
No files found.
dlls/ole32/storage32.c
View file @
106156cb
...
...
@@ -3557,7 +3557,7 @@ BlockChainStream* Storage32Impl_SmallBlocksToBigBlocks(
ULARGE_INTEGER
size
,
offset
;
ULONG
cbRead
,
cbWritten
,
cbTotalRead
,
cbTotalWritten
;
ULONG
propertyIndex
;
HRESULT
resWrite
;
HRESULT
resWrite
=
S_OK
;
HRESULT
resRead
;
StgProperty
chainProperty
;
BYTE
*
buffer
;
...
...
@@ -3593,7 +3593,7 @@ BlockChainStream* Storage32Impl_SmallBlocksToBigBlocks(
{
resRead
=
SmallBlockChainStream_ReadAt
(
*
ppsbChain
,
offset
,
DEF_SMALL_BLOCK_SIZE
,
This
->
smallBlockSize
,
buffer
,
&
cbRead
);
if
(
FAILED
(
resRead
))
...
...
@@ -3618,7 +3618,12 @@ BlockChainStream* Storage32Impl_SmallBlocksToBigBlocks(
}
while
(
cbRead
>
0
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
assert
(
cbTotalRead
==
cbTotalWritten
);
if
(
FAILED
(
resRead
)
||
FAILED
(
resWrite
))
{
ERR
(
"conversion failed: resRead = 0x%08lx, resWrite = 0x%08lx
\n
"
,
resRead
,
resWrite
);
BlockChainStream_Destroy
(
bbTempChain
);
return
NULL
;
}
/*
* Destroy the small block chain.
...
...
@@ -5319,8 +5324,6 @@ HRESULT SmallBlockChainStream_ReadAt(
if
(
FAILED
(
rc
))
return
rc
;
assert
(
bytesReadFromBigBlockFile
==
bytesToReadInBuffer
);
/*
* Step to the next big block.
*/
...
...
@@ -5328,10 +5331,10 @@ HRESULT SmallBlockChainStream_ReadAt(
if
(
FAILED
(
rc
))
return
STG_E_DOCFILECORRUPT
;
bufferWalker
+=
bytes
ToReadInBuffer
;
size
-=
bytes
ToReadInBuffer
;
*
bytesRead
+=
bytes
ToReadInBuffer
;
offsetInBlock
=
0
;
/* There is no offset on the next block */
bufferWalker
+=
bytes
ReadFromBigBlockFile
;
size
-=
bytes
ReadFromBigBlockFile
;
*
bytesRead
+=
bytes
ReadFromBigBlockFile
;
offsetInBlock
=
(
offsetInBlock
+
bytesReadFromBigBlockFile
)
%
This
->
parentStorage
->
smallBlockSize
;
}
return
(
size
==
0
)
?
S_OK
:
STG_E_READFAULT
;
...
...
@@ -5358,7 +5361,7 @@ HRESULT SmallBlockChainStream_WriteAt(
ULONG
offsetInBlock
=
offset
.
u
.
LowPart
%
This
->
parentStorage
->
smallBlockSize
;
ULONG
bytesToWriteInBuffer
;
ULONG
blockIndex
;
ULONG
bytesWritten
From
BigBlockFile
;
ULONG
bytesWritten
To
BigBlockFile
;
const
BYTE
*
bufferWalker
;
HRESULT
res
;
...
...
@@ -5412,22 +5415,20 @@ HRESULT SmallBlockChainStream_WriteAt(
offsetInBigBlockFile
,
bytesToWriteInBuffer
,
bufferWalker
,
&
bytesWritten
From
BigBlockFile
);
&
bytesWritten
To
BigBlockFile
);
if
(
FAILED
(
res
))
return
res
;
assert
(
bytesWrittenFromBigBlockFile
==
bytesToWriteInBuffer
);
/*
* Step to the next big block.
*/
if
(
FAILED
(
SmallBlockChainStream_GetNextBlockInChain
(
This
,
blockIndex
,
&
blockIndex
)))
return
FALSE
;
bufferWalker
+=
bytes
ToWriteInBuffer
;
size
-=
bytes
ToWriteInBuffer
;
*
bytesWritten
+=
bytes
ToWriteInBuffer
;
offsetInBlock
=
0
;
/* There is no offset on the next block */
bufferWalker
+=
bytes
WrittenToBigBlockFile
;
size
-=
bytes
WrittenToBigBlockFile
;
*
bytesWritten
+=
bytes
WrittenToBigBlockFile
;
offsetInBlock
=
(
offsetInBlock
+
bytesWrittenToBigBlockFile
)
%
This
->
parentStorage
->
smallBlockSize
;
}
return
(
size
==
0
)
?
S_OK
:
STG_E_WRITEFAULT
;
...
...
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