ole32: Remove the BIG_BLOCK_SIZE define.
Big block sizes can be 512 or 4096, so we define arrays that are large enough in either case.
This commit is contained in:
parent
b90ab46a82
commit
7b43123762
|
@ -2651,7 +2651,7 @@ static HRESULT StorageImpl_Construct(
|
|||
if (create)
|
||||
{
|
||||
ULARGE_INTEGER size;
|
||||
BYTE bigBlockBuffer[BIG_BLOCK_SIZE];
|
||||
BYTE bigBlockBuffer[MAX_BIG_BLOCK_SIZE];
|
||||
|
||||
/*
|
||||
* Initialize all header variables:
|
||||
|
@ -2848,7 +2848,7 @@ static ULONG StorageImpl_GetNextFreeBigBlock(
|
|||
StorageImpl* This)
|
||||
{
|
||||
ULONG depotBlockIndexPos;
|
||||
BYTE depotBuffer[BIG_BLOCK_SIZE];
|
||||
BYTE depotBuffer[MAX_BIG_BLOCK_SIZE];
|
||||
BOOL success;
|
||||
ULONG depotBlockOffset;
|
||||
ULONG blocksPerDepot = This->bigBlockSize / sizeof(ULONG);
|
||||
|
@ -2983,7 +2983,7 @@ static ULONG StorageImpl_GetNextFreeBigBlock(
|
|||
*/
|
||||
static void Storage32Impl_AddBlockDepot(StorageImpl* This, ULONG blockIndex)
|
||||
{
|
||||
BYTE blockBuffer[BIG_BLOCK_SIZE];
|
||||
BYTE blockBuffer[MAX_BIG_BLOCK_SIZE];
|
||||
|
||||
/*
|
||||
* Initialize blocks as free
|
||||
|
@ -3066,7 +3066,7 @@ static ULONG Storage32Impl_AddExtBlockDepot(StorageImpl* This)
|
|||
{
|
||||
ULONG numExtBlocks = This->extBigBlockDepotCount;
|
||||
ULONG nextExtBlock = This->extBigBlockDepotStart;
|
||||
BYTE depotBuffer[BIG_BLOCK_SIZE];
|
||||
BYTE depotBuffer[MAX_BIG_BLOCK_SIZE];
|
||||
ULONG index = BLOCK_UNUSED;
|
||||
ULONG nextBlockOffset = This->bigBlockSize - sizeof(ULONG);
|
||||
ULONG blocksPerDepotBlock = This->bigBlockSize / sizeof(ULONG);
|
||||
|
@ -3156,7 +3156,7 @@ static HRESULT StorageImpl_GetNextBlockInChain(
|
|||
ULONG offsetInDepot = blockIndex * sizeof (ULONG);
|
||||
ULONG depotBlockCount = offsetInDepot / This->bigBlockSize;
|
||||
ULONG depotBlockOffset = offsetInDepot % This->bigBlockSize;
|
||||
BYTE depotBuffer[BIG_BLOCK_SIZE];
|
||||
BYTE depotBuffer[MAX_BIG_BLOCK_SIZE];
|
||||
BOOL success;
|
||||
ULONG depotBlockIndexPos;
|
||||
int index;
|
||||
|
@ -5745,7 +5745,7 @@ static ULONG SmallBlockChainStream_GetNextFreeBlock(
|
|||
|
||||
ULONG sbdIndex = This->parentStorage->smallBlockDepotStart;
|
||||
ULONG nextBlock, newsbdIndex;
|
||||
BYTE smallBlockDepot[BIG_BLOCK_SIZE];
|
||||
BYTE smallBlockDepot[MAX_BIG_BLOCK_SIZE];
|
||||
|
||||
nextBlock = sbdIndex;
|
||||
while (nextBlock != BLOCK_END_OF_CHAIN)
|
||||
|
|
|
@ -81,6 +81,9 @@ static const ULONG DIRENTRY_NULL = 0xFFFFFFFF;
|
|||
|
||||
#define HEADER_SIZE 512
|
||||
|
||||
#define MIN_BIG_BLOCK_SIZE 0x200
|
||||
#define MAX_BIG_BLOCK_SIZE 0x1000
|
||||
|
||||
/*
|
||||
* Type of child entry link
|
||||
*/
|
||||
|
@ -98,7 +101,6 @@ static const ULONG DIRENTRY_NULL = 0xFFFFFFFF;
|
|||
* if the blocksize is different. Some changes will have to be done if it
|
||||
* becomes the case.
|
||||
*/
|
||||
#define BIG_BLOCK_SIZE 0x200
|
||||
#define COUNT_BBDEPOTINHEADER 109
|
||||
#define LIMIT_TO_USE_SMALL_BLOCK 0x1000
|
||||
#define NUM_BLOCKS_PER_DEPOT_BLOCK 128
|
||||
|
|
Loading…
Reference in New Issue