Commit a841fec2 authored by Thuy Nguyen's avatar Thuy Nguyen Committed by Alexandre Julliard

Return error if not a valid OLE compound file.

parent 4d998184
......@@ -1915,7 +1915,14 @@ HRESULT StorageImpl_Construct(
/*
* Load the header for the file.
*/
StorageImpl_LoadFileHeader(This);
hr = StorageImpl_LoadFileHeader(This);
if (FAILED(hr))
{
BIGBLOCKFILE_Destructor(This->bigBlockFile);
return hr;
}
}
/*
......@@ -2599,6 +2606,8 @@ HRESULT StorageImpl_LoadFileHeader(
* Release the block.
*/
StorageImpl_ReleaseBigBlock(This, headerBigBlock);
hr = S_OK;
}
return hr;
......@@ -4939,7 +4948,6 @@ ULARGE_INTEGER SmallBlockChainStream_GetSize(SmallBlockChainStream* This)
/******************************************************************************
* StgCreateDocfile32 [OLE32.144]
* TODO Validate grfMode (STGM)
*/
HRESULT WINAPI StgCreateDocfile(
LPCOLESTR pwcsName,
......@@ -5035,7 +5043,10 @@ HRESULT WINAPI StgCreateDocfile(
grfMode);
if (FAILED(hr))
{
HeapFree(GetProcessHeap(), 0, newStorage);
return hr;
}
/*
* Get an "out" pointer for the caller.
......@@ -5116,7 +5127,10 @@ HRESULT WINAPI StgOpenStorage(
grfMode);
if (FAILED(hr))
{
HeapFree(GetProcessHeap(), 0, newStorage);
return hr;
}
/*
* Get an "out" pointer for the caller.
......
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