diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index bc1fb96cbb9..d136837e54c 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -4096,9 +4096,11 @@ static HRESULT StorageBaseImpl_CopyStream( if (SUCCEEDED(hr)) hr = StorageBaseImpl_StreamWriteAt(dst, dst_entry, bytes_copied, bytestocopy, data, &byteswritten); - if (SUCCEEDED(hr) && byteswritten != bytestocopy) hr = STG_E_WRITEFAULT; - - bytes_copied.QuadPart += byteswritten; + if (SUCCEEDED(hr)) + { + if (byteswritten != bytestocopy) hr = STG_E_WRITEFAULT; + bytes_copied.QuadPart += byteswritten; + } } } @@ -4370,7 +4372,7 @@ static HRESULT TransactedSnapshotImpl_CopyTree(TransactedSnapshotImpl* This) { DirRef cursor; TransactedDirEntry *entry; - HRESULT hr; + HRESULT hr = S_OK; cursor = This->base.storageDirEntry; entry = &This->entries[cursor];