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
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(
...
@@ -2461,6 +2461,7 @@ void StorageImpl_SetNextBlockInChain(
void
*
depotBuffer
;
void
*
depotBuffer
;
assert
(
depotBlockCount
<
This
->
bigBlockDepotCount
);
assert
(
depotBlockCount
<
This
->
bigBlockDepotCount
);
assert
(
blockIndex
!=
nextBlock
);
if
(
depotBlockCount
<
COUNT_BBDEPOTINHEADER
)
if
(
depotBlockCount
<
COUNT_BBDEPOTINHEADER
)
{
{
...
@@ -2713,7 +2714,7 @@ BOOL StorageImpl_ReadProperty(
...
@@ -2713,7 +2714,7 @@ BOOL StorageImpl_ReadProperty(
ULARGE_INTEGER
offsetInPropSet
;
ULARGE_INTEGER
offsetInPropSet
;
BOOL
readSucessful
;
BOOL
readSucessful
;
ULONG
bytesRead
;
ULONG
bytesRead
;
offsetInPropSet
.
HighPart
=
0
;
offsetInPropSet
.
HighPart
=
0
;
offsetInPropSet
.
LowPart
=
index
*
PROPSET_BLOCK_SIZE
;
offsetInPropSet
.
LowPart
=
index
*
PROPSET_BLOCK_SIZE
;
...
@@ -3740,12 +3741,28 @@ BlockChainStream* BlockChainStream_Construct(
...
@@ -3740,12 +3741,28 @@ BlockChainStream* BlockChainStream_Construct(
ULONG
propertyIndex
)
ULONG
propertyIndex
)
{
{
BlockChainStream
*
newStream
;
BlockChainStream
*
newStream
;
ULONG
blockIndex
;
newStream
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
BlockChainStream
));
newStream
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
BlockChainStream
));
newStream
->
parentStorage
=
parentStorage
;
newStream
->
parentStorage
=
parentStorage
;
newStream
->
headOfStreamPlaceHolder
=
headOfStreamPlaceHolder
;
newStream
->
headOfStreamPlaceHolder
=
headOfStreamPlaceHolder
;
newStream
->
ownerPropertyIndex
=
propertyIndex
;
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
;
return
newStream
;
}
}
...
@@ -3833,10 +3850,24 @@ BOOL BlockChainStream_ReadAt(BlockChainStream* This,
...
@@ -3833,10 +3850,24 @@ BOOL BlockChainStream_ReadAt(BlockChainStream* This,
BYTE
*
bufferWalker
;
BYTE
*
bufferWalker
;
BYTE
*
bigBlockBuffer
;
BYTE
*
bigBlockBuffer
;
if
(
This
->
lastBlockNoInSequence
==
0xFFFFFFFF
)
This
->
lastBlockNoInSequence
=
blockNoInSequence
;
/*
/*
* Find the first block in the stream that contains part of the buffer.
* 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
))
while
(
(
blockNoInSequence
>
0
)
&&
(
blockIndex
!=
BLOCK_END_OF_CHAIN
))
{
{
...
@@ -3846,6 +3877,8 @@ BOOL BlockChainStream_ReadAt(BlockChainStream* This,
...
@@ -3846,6 +3877,8 @@ BOOL BlockChainStream_ReadAt(BlockChainStream* This,
blockNoInSequence
--
;
blockNoInSequence
--
;
}
}
This
->
lastBlockNoInSequenceIndex
=
blockIndex
;
/*
/*
* Start reading the buffer.
* Start reading the buffer.
*/
*/
...
@@ -3906,11 +3939,26 @@ BOOL BlockChainStream_WriteAt(BlockChainStream* This,
...
@@ -3906,11 +3939,26 @@ BOOL BlockChainStream_WriteAt(BlockChainStream* This,
BYTE
*
bufferWalker
;
BYTE
*
bufferWalker
;
BYTE
*
bigBlockBuffer
;
BYTE
*
bigBlockBuffer
;
if
(
This
->
lastBlockNoInSequence
==
0xFFFFFFFF
)
This
->
lastBlockNoInSequence
=
blockNoInSequence
;
/*
/*
* Find the first block in the stream that contains part of the buffer.
* 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
))
while
(
(
blockNoInSequence
>
0
)
&&
(
blockIndex
!=
BLOCK_END_OF_CHAIN
))
{
{
blockIndex
=
blockIndex
=
...
@@ -3919,6 +3967,8 @@ BOOL BlockChainStream_WriteAt(BlockChainStream* This,
...
@@ -3919,6 +3967,8 @@ BOOL BlockChainStream_WriteAt(BlockChainStream* This,
blockNoInSequence
--
;
blockNoInSequence
--
;
}
}
This
->
lastBlockNoInSequenceIndex
=
blockIndex
;
/*
/*
* Here, I'm casting away the constness on the buffer variable
* Here, I'm casting away the constness on the buffer variable
* This is OK since we don't intend to modify that buffer.
* This is OK since we don't intend to modify that buffer.
...
@@ -4001,6 +4051,9 @@ BOOL BlockChainStream_Shrink(BlockChainStream* This,
...
@@ -4001,6 +4051,9 @@ BOOL BlockChainStream_Shrink(BlockChainStream* This,
blockIndex
,
blockIndex
,
BLOCK_END_OF_CHAIN
);
BLOCK_END_OF_CHAIN
);
This
->
tailIndex
=
blockIndex
;
This
->
numBlocks
=
numBlocks
;
/*
/*
* Mark the extra blocks as free
* Mark the extra blocks as free
*/
*/
...
@@ -4046,24 +4099,25 @@ BOOL BlockChainStream_Enlarge(BlockChainStream* This,
...
@@ -4046,24 +4099,25 @@ BOOL BlockChainStream_Enlarge(BlockChainStream* This,
}
}
else
else
{
{
StgProperty
chainProp
;
StgProperty
chainProp
;
assert
(
This
->
ownerPropertyIndex
!=
PROPERTY_NULL
);
assert
(
This
->
ownerPropertyIndex
!=
PROPERTY_NULL
);
StorageImpl_ReadProperty
(
StorageImpl_ReadProperty
(
This
->
parentStorage
,
This
->
parentStorage
,
This
->
ownerPropertyIndex
,
This
->
ownerPropertyIndex
,
&
chainProp
);
&
chainProp
);
chainProp
.
startingBlock
=
blockIndex
;
chainProp
.
startingBlock
=
blockIndex
;
StorageImpl_WriteProperty
(
StorageImpl_WriteProperty
(
This
->
parentStorage
,
This
->
parentStorage
,
This
->
ownerPropertyIndex
,
This
->
ownerPropertyIndex
,
&
chainProp
);
&
chainProp
);
}
}
}
currentBlock
=
blockIndex
;
This
->
tailIndex
=
blockIndex
;
This
->
numBlocks
=
1
;
}
/*
/*
* Figure out how many blocks are needed to contain this stream
* Figure out how many blocks are needed to contain this stream
...
@@ -4076,15 +4130,25 @@ BOOL BlockChainStream_Enlarge(BlockChainStream* This,
...
@@ -4076,15 +4130,25 @@ BOOL BlockChainStream_Enlarge(BlockChainStream* This,
/*
/*
* Go to the current end of chain
* Go to the current end of chain
*/
*/
while
(
blockIndex
!
=
BLOCK_END_OF_CHAIN
)
if
(
This
->
tailIndex
=
=
BLOCK_END_OF_CHAIN
)
{
{
oldNumBlocks
++
;
currentBlock
=
blockIndex
;
currentBlock
=
blockIndex
;
blockIndex
=
while
(
blockIndex
!=
BLOCK_END_OF_CHAIN
)
StorageImpl_GetNextBlockInChain
(
This
->
parentStorage
,
currentBlock
);
{
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
* Add new blocks to the chain
*/
*/
...
@@ -4106,6 +4170,9 @@ BOOL BlockChainStream_Enlarge(BlockChainStream* This,
...
@@ -4106,6 +4170,9 @@ BOOL BlockChainStream_Enlarge(BlockChainStream* This,
oldNumBlocks
++
;
oldNumBlocks
++
;
}
}
This
->
tailIndex
=
blockIndex
;
This
->
numBlocks
=
newNumBlocks
;
return
TRUE
;
return
TRUE
;
}
}
...
...
ole/storage32.h
View file @
454ed9f0
...
@@ -140,8 +140,7 @@ struct BigBlockFile
...
@@ -140,8 +140,7 @@ struct BigBlockFile
HANDLE
hfile
;
HANDLE
hfile
;
HANDLE
hfilemap
;
HANDLE
hfilemap
;
DWORD
flProtect
;
DWORD
flProtect
;
MappedPage
*
headmap_ro
;
MappedPage
*
maplisthead
;
MappedPage
*
headmap_w
;
BigBlock
*
headblock
;
BigBlock
*
headblock
;
};
};
...
@@ -724,8 +723,12 @@ void StorageUtl_CopyPropertyToSTATSTG(STATSTG* destination,
...
@@ -724,8 +723,12 @@ void StorageUtl_CopyPropertyToSTATSTG(STATSTG* destination,
struct
BlockChainStream
struct
BlockChainStream
{
{
StorageImpl
*
parentStorage
;
StorageImpl
*
parentStorage
;
ULONG
*
headOfStreamPlaceHolder
;
ULONG
*
headOfStreamPlaceHolder
;
ULONG
ownerPropertyIndex
;
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