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
e6c58c74
Commit
e6c58c74
authored
Apr 23, 2014
by
Vincent Povirk
Committed by
Alexandre Julliard
Apr 29, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Reserve the range lock sector.
parent
a00f43d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
4 deletions
+21
-4
storage32.c
dlls/ole32/storage32.c
+21
-4
No files found.
dlls/ole32/storage32.c
View file @
e6c58c74
...
...
@@ -111,7 +111,7 @@ static void StorageImpl_SetNextBlockInChain(StorageImpl* This, ULONG blockIndex,
static
HRESULT
StorageImpl_LoadFileHeader
(
StorageImpl
*
This
);
static
void
StorageImpl_SaveFileHeader
(
StorageImpl
*
This
);
static
void
Storage32Impl_AddBlockDepot
(
StorageImpl
*
This
,
ULONG
blockIndex
);
static
void
Storage32Impl_AddBlockDepot
(
StorageImpl
*
This
,
ULONG
blockIndex
,
ULONG
depotIndex
);
static
ULONG
Storage32Impl_AddExtBlockDepot
(
StorageImpl
*
This
);
static
ULONG
Storage32Impl_GetNextExtendedBlock
(
StorageImpl
*
This
,
ULONG
blockIndex
);
static
ULONG
Storage32Impl_GetExtDepotBlock
(
StorageImpl
*
This
,
ULONG
depotIndex
);
...
...
@@ -3111,7 +3111,7 @@ static ULONG StorageImpl_GetNextFreeBigBlock(
/*
* Add a block depot.
*/
Storage32Impl_AddBlockDepot
(
This
,
depotBlockIndexPos
);
Storage32Impl_AddBlockDepot
(
This
,
depotBlockIndexPos
,
depotIndex
);
This
->
bigBlockDepotCount
++
;
This
->
bigBlockDepotStart
[
depotIndex
]
=
depotBlockIndexPos
;
...
...
@@ -3154,7 +3154,7 @@ static ULONG StorageImpl_GetNextFreeBigBlock(
/*
* Add a block depot and mark it in the extended block.
*/
Storage32Impl_AddBlockDepot
(
This
,
depotBlockIndexPos
);
Storage32Impl_AddBlockDepot
(
This
,
depotBlockIndexPos
,
depotIndex
);
This
->
bigBlockDepotCount
++
;
Storage32Impl_SetExtDepotBlock
(
This
,
depotIndex
,
depotBlockIndexPos
);
...
...
@@ -3219,14 +3219,24 @@ static ULONG StorageImpl_GetNextFreeBigBlock(
* This will create a depot block, essentially it is a block initialized
* to BLOCK_UNUSEDs.
*/
static
void
Storage32Impl_AddBlockDepot
(
StorageImpl
*
This
,
ULONG
blockIndex
)
static
void
Storage32Impl_AddBlockDepot
(
StorageImpl
*
This
,
ULONG
blockIndex
,
ULONG
depotIndex
)
{
BYTE
blockBuffer
[
MAX_BIG_BLOCK_SIZE
];
ULONG
rangeLockIndex
=
0x7fffff00
/
This
->
bigBlockSize
-
1
;
ULONG
blocksPerDepot
=
This
->
bigBlockSize
/
sizeof
(
ULONG
);
ULONG
rangeLockDepot
=
rangeLockIndex
/
blocksPerDepot
;
/*
* Initialize blocks as free
*/
memset
(
blockBuffer
,
BLOCK_UNUSED
,
This
->
bigBlockSize
);
/* Reserve the range lock sector */
if
(
depotIndex
==
rangeLockDepot
)
{
((
ULONG
*
)
blockBuffer
)[
rangeLockIndex
%
blocksPerDepot
]
=
BLOCK_END_OF_CHAIN
;
}
StorageImpl_WriteBigBlock
(
This
,
blockIndex
,
blockBuffer
);
}
...
...
@@ -3523,6 +3533,13 @@ static void StorageImpl_SetNextBlockInChain(
assert
(
depotBlockCount
<
This
->
bigBlockDepotCount
);
assert
(
blockIndex
!=
nextBlock
);
if
(
blockIndex
==
(
0x7fffff00
/
This
->
bigBlockSize
)
-
1
)
/* This should never happen (storage file format spec forbids it), but
* older versions of Wine may have generated broken files. We don't want to
* assert and potentially lose data, but we do want to know if this ever
* happens in a newly-created file. */
ERR
(
"Using range lock page
\n
"
);
if
(
depotBlockCount
<
COUNT_BBDEPOTINHEADER
)
{
depotBlockIndexPos
=
This
->
bigBlockDepotStart
[
depotBlockCount
];
...
...
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