From: Dmitry Timoshkov <dmitry@baikal.ru> Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru> --- dlls/ole32/storage32.c | 18 +++++++++++++++++- dlls/ole32/tests/storage32.c | 3 --- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index fed7eb760f0..39700ca785f 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -2387,7 +2387,6 @@ static HRESULT WINAPI StorageBaseImpl_MoveElementTo(IStorage *iface, create_mode = STGM_WRITE | STGM_SHARE_EXCLUSIVE; create_mode |= (mode == STGMOVE_MOVE) ? STGM_FAILIFTHERE : STGM_CREATE; - /* FIXME: Handle STGTY_STORAGE */ hr = IStorage_OpenStream(iface, name, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &src); if (hr == S_OK) { @@ -2409,6 +2408,23 @@ static HRESULT WINAPI StorageBaseImpl_MoveElementTo(IStorage *iface, IStream_Release(src); } + else if (hr == STG_E_FILENOTFOUND) + { + IStorage *src_stg, *dst_stg; + + hr = IStorage_OpenStorage(iface, name, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, NULL, 0, &src_stg); + if (hr == S_OK) + { + hr = IStorage_CreateStorage(dest, new_name, create_mode, 0, 0, &dst_stg); + if (hr == S_OK) + { + hr = IStorage_CopyTo(src_stg, 0, NULL, NULL, dst_stg); + IStorage_Release(dst_stg); + } + + IStorage_Release(src_stg); + } + } if (hr == S_OK && mode == STGMOVE_MOVE) hr = IStorage_DestroyElement(iface, name); diff --git a/dlls/ole32/tests/storage32.c b/dlls/ole32/tests/storage32.c index 66382548f60..7bca822aa96 100644 --- a/dlls/ole32/tests/storage32.c +++ b/dlls/ole32/tests/storage32.c @@ -4010,9 +4010,7 @@ static void test_MoveElementTo(void) /* STGTY_STORAGE */ hr = IStorage_MoveElementTo(src, stgA_name, dst, stgB_name, STGMOVE_COPY); - todo_wine ok(hr == S_OK, "got %#lx\n", hr); - if (hr != S_OK) goto done; /* STGMOVE_COPY doesn't fail if the target already exsists */ hr = IStorage_MoveElementTo(src, stgA_name, dst, stgB_name, STGMOVE_COPY); @@ -4041,7 +4039,6 @@ static void test_MoveElementTo(void) ok(hr == S_OK, "got %#lx\n", hr); IStorage_Release(stg); -done: IStorage_Release(src); IStorage_Release(dst); DeleteFileW(src_name); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11054