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
454ed9f0
Commit
454ed9f0
authored
Mar 12, 1999
by
Thuy Nguyen
Committed by
Alexandre Julliard
Mar 12, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved performance.
parent
0d5fe583
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
95 additions
and
25 deletions
+95
-25
stg_bigblockfile.c
ole/stg_bigblockfile.c
+0
-0
storage32.c
ole/storage32.c
+88
-21
storage32.h
ole/storage32.h
+7
-4
No files found.
ole/stg_bigblockfile.c
View file @
454ed9f0
This diff is collapsed.
Click to expand it.
ole/storage32.c
View file @
454ed9f0
...
...
@@ -2461,6 +2461,7 @@ void StorageImpl_SetNextBlockInChain(
void
*
depotBuffer
;
assert
(
depotBlockCount
<
This
->
bigBlockDepotCount
);
assert
(
blockIndex
!=
nextBlock
);
if
(
depotBlockCount
<
COUNT_BBDEPOTINHEADER
)
{
...
...
@@ -2713,7 +2714,7 @@ BOOL StorageImpl_ReadProperty(
ULARGE_INTEGER
offsetInPropSet
;
BOOL
readSucessful
;
ULONG
bytesRead
;
offsetInPropSet
.
HighPart
=
0
;
offsetInPropSet
.
LowPart
=
index
*
PROPSET_BLOCK_SIZE
;
...
...
@@ -3740,12 +3741,28 @@ BlockChainStream* BlockChainStream_Construct(
ULONG
propertyIndex
)
{
BlockChainStream
*
newStream
;
ULONG
blockIndex
;
newStream
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
BlockChainStream
));
newStream
->
parentStorage
=
parentStorage
;
newStream
->
headOfStreamPlaceHolder
=
headOfStreamPlaceHolder
;
newStream
->
ownerPropertyIndex
=
propertyIndex
;
newStream
->
lastBlockNoInSequence
=
0xFFFFFFFF
;
newStream
->
tailIndex
=
BLOCK_END_OF_CHAIN
;
newStream
->
numBlocks
=
0
;
blockIndex
=
BlockChainStream_GetHeadOfChain
(
newStream
);
while
(
blockIndex
!=
BLOCK_END_OF_CHAIN
)
{
newStream
->
numBlocks
++
;
newStream
->
tailIndex
=
blockIndex
;
blockIndex
=
StorageImpl_GetNextBlockInChain
(
parentStorage
,
blockIndex
);
}
return
newStream
;
}
...
...
@@ -3833,10 +3850,24 @@ BOOL BlockChainStream_ReadAt(BlockChainStream* This,
BYTE
*
bufferWalker
;
BYTE
*
bigBlockBuffer
;
if
(
This
->
lastBlockNoInSequence
==
0xFFFFFFFF
)
This
->
lastBlockNoInSequence
=
blockNoInSequence
;
/*
* Find the first block in the stream that contains part of the buffer.
*/
blockIndex
=
BlockChainStream_GetHeadOfChain
(
This
);
if
(
blockNoInSequence
>
This
->
lastBlockNoInSequence
)
{
ULONG
temp
=
blockNoInSequence
;
blockIndex
=
This
->
lastBlockNoInSequenceIndex
;
blockNoInSequence
-=
This
->
lastBlockNoInSequence
;
This
->
lastBlockNoInSequence
=
temp
;
}
else
{
blockIndex
=
BlockChainStream_GetHeadOfChain
(
This
);
This
->
lastBlockNoInSequence
=
blockNoInSequence
;
}
while
(
(
blockNoInSequence
>
0
)
&&
(
blockIndex
!=
BLOCK_END_OF_CHAIN
))
{
...
...
@@ -3846,6 +3877,8 @@ BOOL BlockChainStream_ReadAt(BlockChainStream* This,
blockNoInSequence
--
;
}
This
->
lastBlockNoInSequenceIndex
=
blockIndex
;
/*
* Start reading the buffer.
*/
...
...
@@ -3906,11 +3939,26 @@ BOOL BlockChainStream_WriteAt(BlockChainStream* This,
BYTE
*
bufferWalker
;
BYTE
*
bigBlockBuffer
;
if
(
This
->
lastBlockNoInSequence
==
0xFFFFFFFF
)
This
->
lastBlockNoInSequence
=
blockNoInSequence
;
/*
* Find the first block in the stream that contains part of the buffer.
*/
blockIndex
=
BlockChainStream_GetHeadOfChain
(
This
);
if
(
blockNoInSequence
>
This
->
lastBlockNoInSequence
)
{
ULONG
temp
=
blockNoInSequence
;
blockIndex
=
This
->
lastBlockNoInSequenceIndex
;
blockNoInSequence
-=
This
->
lastBlockNoInSequence
;
This
->
lastBlockNoInSequence
=
temp
;
}
else
{
blockIndex
=
BlockChainStream_GetHeadOfChain
(
This
);
This
->
lastBlockNoInSequence
=
blockNoInSequence
;
}
while
(
(
blockNoInSequence
>
0
)
&&
(
blockIndex
!=
BLOCK_END_OF_CHAIN
))
{
blockIndex
=
...
...
@@ -3919,6 +3967,8 @@ BOOL BlockChainStream_WriteAt(BlockChainStream* This,
blockNoInSequence
--
;
}
This
->
lastBlockNoInSequenceIndex
=
blockIndex
;
/*
* Here, I'm casting away the constness on the buffer variable
* This is OK since we don't intend to modify that buffer.
...
...
@@ -4001,6 +4051,9 @@ BOOL BlockChainStream_Shrink(BlockChainStream* This,
blockIndex
,
BLOCK_END_OF_CHAIN
);
This
->
tailIndex
=
blockIndex
;
This
->
numBlocks
=
numBlocks
;
/*
* Mark the extra blocks as free
*/
...
...
@@ -4046,24 +4099,25 @@ BOOL BlockChainStream_Enlarge(BlockChainStream* This,
}
else
{
StgProperty
chainProp
;
assert
(
This
->
ownerPropertyIndex
!=
PROPERTY_NULL
);
StgProperty
chainProp
;
assert
(
This
->
ownerPropertyIndex
!=
PROPERTY_NULL
);
StorageImpl_ReadProperty
(
This
->
parentStorage
,
This
->
ownerPropertyIndex
,
&
chainProp
);
StorageImpl_ReadProperty
(
This
->
parentStorage
,
This
->
ownerPropertyIndex
,
&
chainProp
);
chainProp
.
startingBlock
=
blockIndex
;
StorageImpl_WriteProperty
(
This
->
parentStorage
,
This
->
ownerPropertyIndex
,
&
chainProp
);
}
}
StorageImpl_WriteProperty
(
This
->
parentStorage
,
This
->
ownerPropertyIndex
,
&
chainProp
);
}
currentBlock
=
blockIndex
;
This
->
tailIndex
=
blockIndex
;
This
->
numBlocks
=
1
;
}
/*
* Figure out how many blocks are needed to contain this stream
...
...
@@ -4076,15 +4130,25 @@ BOOL BlockChainStream_Enlarge(BlockChainStream* This,
/*
* Go to the current end of chain
*/
while
(
blockIndex
!
=
BLOCK_END_OF_CHAIN
)
if
(
This
->
tailIndex
=
=
BLOCK_END_OF_CHAIN
)
{
oldNumBlocks
++
;
currentBlock
=
blockIndex
;
blockIndex
=
StorageImpl_GetNextBlockInChain
(
This
->
parentStorage
,
currentBlock
);
while
(
blockIndex
!=
BLOCK_END_OF_CHAIN
)
{
This
->
numBlocks
++
;
currentBlock
=
blockIndex
;
blockIndex
=
StorageImpl_GetNextBlockInChain
(
This
->
parentStorage
,
currentBlock
);
}
This
->
tailIndex
=
currentBlock
;
}
currentBlock
=
This
->
tailIndex
;
oldNumBlocks
=
This
->
numBlocks
;
/*
* Add new blocks to the chain
*/
...
...
@@ -4106,6 +4170,9 @@ BOOL BlockChainStream_Enlarge(BlockChainStream* This,
oldNumBlocks
++
;
}
This
->
tailIndex
=
blockIndex
;
This
->
numBlocks
=
newNumBlocks
;
return
TRUE
;
}
...
...
ole/storage32.h
View file @
454ed9f0
...
...
@@ -140,8 +140,7 @@ struct BigBlockFile
HANDLE
hfile
;
HANDLE
hfilemap
;
DWORD
flProtect
;
MappedPage
*
headmap_ro
;
MappedPage
*
headmap_w
;
MappedPage
*
maplisthead
;
BigBlock
*
headblock
;
};
...
...
@@ -724,8 +723,12 @@ void StorageUtl_CopyPropertyToSTATSTG(STATSTG* destination,
struct
BlockChainStream
{
StorageImpl
*
parentStorage
;
ULONG
*
headOfStreamPlaceHolder
;
ULONG
ownerPropertyIndex
;
ULONG
*
headOfStreamPlaceHolder
;
ULONG
ownerPropertyIndex
;
ULONG
lastBlockNoInSequence
;
ULONG
lastBlockNoInSequenceIndex
;
ULONG
tailIndex
;
ULONG
numBlocks
;
};
/*
...
...
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