Commit 92666974 authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

ole32: Remove the NUM_BLOCKS_PER_DEPOT_BLOCK define.

This should always be calculated based on the big block size.
parent 7b431237
......@@ -3159,7 +3159,7 @@ static HRESULT StorageImpl_GetNextBlockInChain(
BYTE depotBuffer[MAX_BIG_BLOCK_SIZE];
BOOL success;
ULONG depotBlockIndexPos;
int index;
int index, num_blocks;
*nextBlockIndex = BLOCK_SPECIAL;
......@@ -3194,7 +3194,9 @@ static HRESULT StorageImpl_GetNextBlockInChain(
if (!success)
return STG_E_READFAULT;
for (index = 0; index < NUM_BLOCKS_PER_DEPOT_BLOCK; index++)
num_blocks = This->bigBlockSize / 4;
for (index = 0; index < num_blocks; index++)
{
StorageUtl_ReadDWord(depotBuffer, index*sizeof(ULONG), nextBlockIndex);
This->blockDepotCached[index] = *nextBlockIndex;
......
......@@ -96,14 +96,8 @@ static const ULONG DIRENTRY_NULL = 0xFFFFFFFF;
*/
#define STGTY_ROOT 0x05
/*
* These defines assume a hardcoded blocksize. The code will assert
* if the blocksize is different. Some changes will have to be done if it
* becomes the case.
*/
#define COUNT_BBDEPOTINHEADER 109
#define LIMIT_TO_USE_SMALL_BLOCK 0x1000
#define NUM_BLOCKS_PER_DEPOT_BLOCK 128
#define STGM_ACCESS_MODE(stgm) ((stgm)&0x0000f)
#define STGM_SHARE_MODE(stgm) ((stgm)&0x000f0)
......@@ -363,7 +357,7 @@ struct StorageImpl
ULONG extBigBlockDepotCount;
ULONG bigBlockDepotStart[COUNT_BBDEPOTINHEADER];
ULONG blockDepotCached[NUM_BLOCKS_PER_DEPOT_BLOCK];
ULONG blockDepotCached[MAX_BIG_BLOCK_SIZE / 4];
ULONG indexBlockDepotCached;
ULONG prevFreeBlock;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment