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

ole32: Discard existing data when creating a new storage on an ILockBytes.

parent 7df35e9b
......@@ -2740,6 +2740,10 @@ static HRESULT StorageImpl_Construct(
ULARGE_INTEGER size;
BYTE bigBlockBuffer[MAX_BIG_BLOCK_SIZE];
/* Discard any existing data. */
size.QuadPart = 0;
ILockBytes_SetSize(This->lockBytes, size);
/*
* Initialize all header variables:
* - The big block depot consists of one block and it is at block 0
......
......@@ -2971,7 +2971,7 @@ static void test_hglobal_storage_creation(void)
r = StgOpenStorageOnILockBytes(ilb, NULL, STGM_READ|STGM_SHARE_EXCLUSIVE,
NULL, 0, &stg);
todo_wine ok(r == S_OK, "StgOpenStorageOnILockBytes failed, hr=%x\n", r);
ok(r == S_OK, "StgOpenStorageOnILockBytes failed, hr=%x\n", r);
if (SUCCEEDED(r))
{
......
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