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
4b7e7bd7
Commit
4b7e7bd7
authored
Mar 10, 2010
by
Vincent Povirk
Committed by
Alexandre Julliard
Mar 15, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Fix the big block offset calculation.
Use the actual big block size from the open storage file. Also, remove a special case that was only used for reading/writing the header.
parent
f3db25fc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
13 deletions
+8
-13
storage32.c
dlls/ole32/storage32.c
+8
-13
No files found.
dlls/ole32/storage32.c
View file @
4b7e7bd7
...
...
@@ -269,14 +269,9 @@ static void IEnumSTATSTGImpl_Destroy(IEnumSTATSTGImpl* This);
** Block Functions
*/
static
ULONG
BLOCK_GetBigBlockOffset
(
ULONG
index
)
static
ULONG
StorageImpl_GetBigBlockOffset
(
StorageImpl
*
This
,
ULONG
index
)
{
if
(
index
==
0xffffffff
)
index
=
0
;
else
index
++
;
return
index
*
BIG_BLOCK_SIZE
;
return
(
index
+
1
)
*
This
->
bigBlockSize
;
}
/************************************************************************
...
...
@@ -3740,7 +3735,7 @@ static BOOL StorageImpl_ReadBigBlock(
DWORD
read
;
ulOffset
.
u
.
HighPart
=
0
;
ulOffset
.
u
.
LowPart
=
BLOCK_GetBigBlockOffset
(
blockIndex
);
ulOffset
.
u
.
LowPart
=
StorageImpl_GetBigBlockOffset
(
This
,
blockIndex
);
StorageImpl_ReadAt
(
This
,
ulOffset
,
buffer
,
This
->
bigBlockSize
,
&
read
);
return
(
read
==
This
->
bigBlockSize
);
...
...
@@ -3757,7 +3752,7 @@ static BOOL StorageImpl_ReadDWordFromBigBlock(
DWORD
tmp
;
ulOffset
.
u
.
HighPart
=
0
;
ulOffset
.
u
.
LowPart
=
BLOCK_GetBigBlockOffset
(
blockIndex
);
ulOffset
.
u
.
LowPart
=
StorageImpl_GetBigBlockOffset
(
This
,
blockIndex
);
ulOffset
.
u
.
LowPart
+=
offset
;
StorageImpl_ReadAt
(
This
,
ulOffset
,
&
tmp
,
sizeof
(
DWORD
),
&
read
);
...
...
@@ -3774,7 +3769,7 @@ static BOOL StorageImpl_WriteBigBlock(
DWORD
wrote
;
ulOffset
.
u
.
HighPart
=
0
;
ulOffset
.
u
.
LowPart
=
BLOCK_GetBigBlockOffset
(
blockIndex
);
ulOffset
.
u
.
LowPart
=
StorageImpl_GetBigBlockOffset
(
This
,
blockIndex
);
StorageImpl_WriteAt
(
This
,
ulOffset
,
buffer
,
This
->
bigBlockSize
,
&
wrote
);
return
(
wrote
==
This
->
bigBlockSize
);
...
...
@@ -3790,7 +3785,7 @@ static BOOL StorageImpl_WriteDWordToBigBlock(
DWORD
wrote
;
ulOffset
.
u
.
HighPart
=
0
;
ulOffset
.
u
.
LowPart
=
BLOCK_GetBigBlockOffset
(
blockIndex
);
ulOffset
.
u
.
LowPart
=
StorageImpl_GetBigBlockOffset
(
This
,
blockIndex
);
ulOffset
.
u
.
LowPart
+=
offset
;
value
=
htole32
(
value
);
...
...
@@ -5180,7 +5175,7 @@ HRESULT BlockChainStream_ReadAt(BlockChainStream* This,
TRACE
(
"block %i
\n
"
,
blockIndex
);
ulOffset
.
u
.
HighPart
=
0
;
ulOffset
.
u
.
LowPart
=
BLOCK_GetBigBlockOffset
(
blockIndex
)
+
ulOffset
.
u
.
LowPart
=
StorageImpl_GetBigBlockOffset
(
This
->
parentStorage
,
blockIndex
)
+
offsetInBlock
;
StorageImpl_ReadAt
(
This
->
parentStorage
,
...
...
@@ -5276,7 +5271,7 @@ HRESULT BlockChainStream_WriteAt(BlockChainStream* This,
TRACE
(
"block %i
\n
"
,
blockIndex
);
ulOffset
.
u
.
HighPart
=
0
;
ulOffset
.
u
.
LowPart
=
BLOCK_GetBigBlockOffset
(
blockIndex
)
+
ulOffset
.
u
.
LowPart
=
StorageImpl_GetBigBlockOffset
(
This
->
parentStorage
,
blockIndex
)
+
offsetInBlock
;
StorageImpl_WriteAt
(
This
->
parentStorage
,
...
...
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