ole32: Remove the NUM_BLOCKS_PER_DEPOT_BLOCK define.

This should always be calculated based on the big block size.
This commit is contained in:
Vincent Povirk 2010-03-10 14:51:37 -06:00 committed by Alexandre Julliard
parent 7b43123762
commit 926669741e
2 changed files with 5 additions and 9 deletions

View File

@ -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;

View File

@ -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;