ole32: Don't treat the header as a big block in StorageImpl_LoadFileHeader.

The header is always 512 bytes, regardless of the big block size.
This commit is contained in:
Vincent Povirk 2010-03-10 13:49:04 -06:00 committed by Alexandre Julliard
parent 671136693b
commit 7f3211f383
2 changed files with 13 additions and 6 deletions

View File

@ -3290,26 +3290,31 @@ static void StorageImpl_SetNextBlockInChain(
/****************************************************************************** /******************************************************************************
* Storage32Impl_LoadFileHeader * Storage32Impl_LoadFileHeader
* *
* This method will read in the file header, i.e. big block index -1. * This method will read in the file header
*/ */
static HRESULT StorageImpl_LoadFileHeader( static HRESULT StorageImpl_LoadFileHeader(
StorageImpl* This) StorageImpl* This)
{ {
HRESULT hr = STG_E_FILENOTFOUND; HRESULT hr;
BYTE headerBigBlock[BIG_BLOCK_SIZE]; BYTE headerBigBlock[HEADER_SIZE];
BOOL success;
int index; int index;
ULARGE_INTEGER offset;
DWORD bytes_read;
TRACE("\n"); TRACE("\n");
/* /*
* Get a pointer to the big block of data containing the header. * Get a pointer to the big block of data containing the header.
*/ */
success = StorageImpl_ReadBigBlock(This, -1, headerBigBlock); offset.u.HighPart = 0;
offset.u.LowPart = 0;
hr = StorageImpl_ReadAt(This, offset, headerBigBlock, HEADER_SIZE, &bytes_read);
if (SUCCEEDED(hr) && bytes_read != HEADER_SIZE)
hr = STG_E_FILENOTFOUND;
/* /*
* Extract the information from the header. * Extract the information from the header.
*/ */
if (success) if (SUCCEEDED(hr))
{ {
/* /*
* Check for the "magic number" signature and return an error if it is not * Check for the "magic number" signature and return an error if it is not

View File

@ -79,6 +79,8 @@ static const ULONG DIRENTRY_NULL = 0xFFFFFFFF;
#define RAW_DIRENTRY_SIZE 0x00000080 #define RAW_DIRENTRY_SIZE 0x00000080
#define HEADER_SIZE 512
/* /*
* Type of child entry link * Type of child entry link
*/ */