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
972e4a22
Commit
972e4a22
authored
Aug 19, 2009
by
Andrew Eikum
Committed by
Alexandre Julliard
Aug 20, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Allow small block chains with no property.
parent
7ca31e83
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
20 deletions
+67
-20
stg_stream.c
dlls/ole32/stg_stream.c
+2
-0
storage32.c
dlls/ole32/storage32.c
+61
-18
storage32.h
dlls/ole32/storage32.h
+4
-2
No files found.
dlls/ole32/stg_stream.c
View file @
972e4a22
...
...
@@ -232,6 +232,7 @@ static void StgStreamImpl_OpenBlockChain(
{
This
->
smallBlockChain
=
SmallBlockChainStream_Construct
(
This
->
parentStorage
->
ancestorStorage
,
NULL
,
This
->
ownerProperty
);
}
else
...
...
@@ -591,6 +592,7 @@ static HRESULT WINAPI StgStreamImpl_SetSize(
{
This
->
smallBlockChain
=
SmallBlockChainStream_Construct
(
This
->
parentStorage
->
ancestorStorage
,
NULL
,
This
->
ownerProperty
);
}
else
...
...
dlls/ole32/storage32.c
View file @
972e4a22
...
...
@@ -4579,7 +4579,6 @@ HRESULT BlockChainStream_ReadAt(BlockChainStream* This,
* BlockChainStream_WriteAt
*
* Writes the specified number of bytes to this chain at the specified offset.
* bytesWritten may be NULL.
* Will fail if not all specified number of bytes have been written.
*/
HRESULT
BlockChainStream_WriteAt
(
BlockChainStream
*
This
,
...
...
@@ -4931,6 +4930,7 @@ static ULARGE_INTEGER BlockChainStream_GetSize(BlockChainStream* This)
SmallBlockChainStream
*
SmallBlockChainStream_Construct
(
StorageImpl
*
parentStorage
,
ULONG
*
headOfStreamPlaceHolder
,
ULONG
propertyIndex
)
{
SmallBlockChainStream
*
newStream
;
...
...
@@ -4938,6 +4938,7 @@ SmallBlockChainStream* SmallBlockChainStream_Construct(
newStream
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
SmallBlockChainStream
));
newStream
->
parentStorage
=
parentStorage
;
newStream
->
headOfStreamPlaceHolder
=
headOfStreamPlaceHolder
;
newStream
->
ownerPropertyIndex
=
propertyIndex
;
return
newStream
;
...
...
@@ -4960,6 +4961,9 @@ static ULONG SmallBlockChainStream_GetHeadOfChain(
StgProperty
chainProperty
;
BOOL
readSuccessful
;
if
(
This
->
headOfStreamPlaceHolder
!=
NULL
)
return
*
(
This
->
headOfStreamPlaceHolder
);
if
(
This
->
ownerPropertyIndex
)
{
readSuccessful
=
StorageImpl_ReadProperty
(
...
...
@@ -5322,7 +5326,6 @@ HRESULT SmallBlockChainStream_ReadAt(
* SmallBlockChainStream_WriteAt
*
* Writes the specified number of bytes to this chain at the specified offset.
* bytesWritten may be NULL.
* Will fail if not all specified number of bytes have been written.
*/
HRESULT
SmallBlockChainStream_WriteAt
(
...
...
@@ -5362,9 +5365,6 @@ HRESULT SmallBlockChainStream_WriteAt(
/*
* Start writing the buffer.
*
* Here, I'm casting away the constness on the buffer variable
* This is OK since we don't intend to modify that buffer.
*/
*
bytesWritten
=
0
;
bufferWalker
=
buffer
;
...
...
@@ -5511,26 +5511,32 @@ static BOOL SmallBlockChainStream_Enlarge(
blockIndex
=
SmallBlockChainStream_GetHeadOfChain
(
This
);
/*
* Empty chain
* Empty chain
. Create the head.
*/
if
(
blockIndex
==
BLOCK_END_OF_CHAIN
)
{
blockIndex
=
SmallBlockChainStream_GetNextFreeBlock
(
This
);
SmallBlockChainStream_SetNextBlockInChain
(
This
,
blockIndex
,
BLOCK_END_OF_CHAIN
);
StgProperty
chainProp
;
StorageImpl_ReadProperty
(
This
->
parentStorage
,
This
->
ownerPropertyIndex
,
&
chainProp
);
if
(
This
->
headOfStreamPlaceHolder
!=
NULL
)
{
*
(
This
->
headOfStreamPlaceHolder
)
=
blockIndex
;
}
else
{
StgProperty
chainProp
;
chainProp
.
startingBlock
=
SmallBlockChainStream_GetNextFreeBlock
(
This
);
StorageImpl_ReadProperty
(
This
->
parentStorage
,
This
->
ownerPropertyIndex
,
&
chainProp
);
StorageImpl_WriteProperty
(
This
->
parentStorage
,
This
->
ownerPropertyIndex
,
&
chainProp
);
chainProp
.
startingBlock
=
blockIndex
;
blockIndex
=
chainProp
.
startingBlock
;
SmallBlockChainStream_SetNextBlockInChain
(
This
,
blockIndex
,
BLOCK_END_OF_CHAIN
);
StorageImpl_WriteProperty
(
This
->
parentStorage
,
This
->
ownerPropertyIndex
,
&
chainProp
);
}
}
currentBlock
=
blockIndex
;
...
...
@@ -5606,6 +5612,32 @@ BOOL SmallBlockChainStream_SetSize(
}
/******************************************************************************
* SmallBlockChainStream_GetCount
*
* Returns the number of small blocks that comprises this chain.
* This is not the size of the stream as the last block may not be full!
*
*/
static
ULONG
SmallBlockChainStream_GetCount
(
SmallBlockChainStream
*
This
)
{
ULONG
blockIndex
;
ULONG
count
=
0
;
blockIndex
=
SmallBlockChainStream_GetHeadOfChain
(
This
);
while
(
blockIndex
!=
BLOCK_END_OF_CHAIN
)
{
count
++
;
if
(
FAILED
(
SmallBlockChainStream_GetNextBlockInChain
(
This
,
blockIndex
,
&
blockIndex
)))
return
0
;
}
return
count
;
}
/******************************************************************************
* SmallBlockChainStream_GetSize
*
* Returns the size of this chain.
...
...
@@ -5614,6 +5646,17 @@ static ULARGE_INTEGER SmallBlockChainStream_GetSize(SmallBlockChainStream* This)
{
StgProperty
chainProperty
;
if
(
This
->
headOfStreamPlaceHolder
!=
NULL
)
{
ULARGE_INTEGER
result
;
result
.
u
.
HighPart
=
0
;
result
.
u
.
LowPart
=
SmallBlockChainStream_GetCount
(
This
)
*
This
->
parentStorage
->
smallBlockSize
;
return
result
;
}
StorageImpl_ReadProperty
(
This
->
parentStorage
,
This
->
ownerPropertyIndex
,
...
...
dlls/ole32/storage32.h
View file @
972e4a22
...
...
@@ -464,14 +464,16 @@ struct SmallBlockChainStream
{
StorageImpl
*
parentStorage
;
ULONG
ownerPropertyIndex
;
ULONG
*
headOfStreamPlaceHolder
;
};
/*
* Methods of the SmallBlockChainStream class.
*/
SmallBlockChainStream
*
SmallBlockChainStream_Construct
(
StorageImpl
*
parentStorage
,
ULONG
propertyIndex
);
StorageImpl
*
parentStorage
,
ULONG
*
headOfStreamPlaceHolder
,
ULONG
propertyIndex
);
void
SmallBlockChainStream_Destroy
(
SmallBlockChainStream
*
This
);
...
...
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