[PATCH 0/4] MR5671: shell32: Implement some file_operation apis.
Fixes the Netmarble launcher and allows installing games -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5671
From: Etaash Mathamsetty <etaash.mathamsetty(a)gmail.com> --- dlls/shell32/shlfileop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c index a7e88c813d2..63779600ced 100644 --- a/dlls/shell32/shlfileop.c +++ b/dlls/shell32/shlfileop.c @@ -1874,7 +1874,7 @@ static HRESULT WINAPI file_operation_SetOperationFlags(IFileOperation *iface, DW { FIXME("(%p, %lx): stub.\n", iface, flags); - return E_NOTIMPL; + return S_OK; } static HRESULT WINAPI file_operation_SetProgressMessage(IFileOperation *iface, LPCWSTR message) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/5671
From: Etaash Mathamsetty <etaash.mathamsetty(a)gmail.com> --- dlls/shell32/shlfileop.c | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c index 63779600ced..c3602a46928 100644 --- a/dlls/shell32/shlfileop.c +++ b/dlls/shell32/shlfileop.c @@ -1937,9 +1937,42 @@ static HRESULT WINAPI file_operation_RenameItems(IFileOperation *iface, IUnknown static HRESULT WINAPI file_operation_MoveItem(IFileOperation *iface, IShellItem *item, IShellItem *folder, LPCWSTR name, IFileOperationProgressSink *sink) { - FIXME("(%p, %p, %p, %s, %p): stub.\n", iface, item, folder, debugstr_w(name), sink); + LPWSTR source; + LPWSTR dest; + HRESULT hr; + BOOL ret; + FIXME("(%p, %p, %p, %s, %p): semi-stub.\n", iface, item, folder, debugstr_w(name), sink); - return E_NOTIMPL; + hr = IShellItem_GetDisplayName(item, SIGDN_FILESYSPATH, &source); + + if (FAILED(hr)) + return hr; + + hr = IShellItem_GetDisplayName(folder, SIGDN_FILESYSPATH, &dest); + + if (FAILED(hr)) + { + CoTaskMemFree(source); + return hr; + } + + dest = CoTaskMemRealloc(dest, (lstrlenW(dest) + lstrlenW(name) + 2) * sizeof(WCHAR)); + + if (!dest) + { + CoTaskMemFree(source); + return E_OUTOFMEMORY; + } + + wcscat(dest, L"\\"); + wcscat(dest, name); + + ret = MoveFileW(source, dest); + + CoTaskMemFree(source); + CoTaskMemFree(dest); + + return ret ? S_OK : E_FAIL; } static HRESULT WINAPI file_operation_MoveItems(IFileOperation *iface, IUnknown *items, IShellItem *folder) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/5671
From: Etaash Mathamsetty <etaash.mathamsetty(a)gmail.com> --- dlls/shell32/shlfileop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c index c3602a46928..4ed9c64a3ce 100644 --- a/dlls/shell32/shlfileop.c +++ b/dlls/shell32/shlfileop.c @@ -2025,7 +2025,7 @@ static HRESULT WINAPI file_operation_PerformOperations(IFileOperation *iface) { FIXME("(%p): stub.\n", iface); - return E_NOTIMPL; + return S_OK; } static HRESULT WINAPI file_operation_GetAnyOperationsAborted(IFileOperation *iface, BOOL *aborted) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/5671
From: Etaash Mathamsetty <etaash.mathamsetty(a)gmail.com> --- dlls/shell32/shlfileop.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c index 4ed9c64a3ce..f4b3ae1c25b 100644 --- a/dlls/shell32/shlfileop.c +++ b/dlls/shell32/shlfileop.c @@ -2032,7 +2032,9 @@ static HRESULT WINAPI file_operation_GetAnyOperationsAborted(IFileOperation *ifa { FIXME("(%p, %p): stub.\n", iface, aborted); - return E_NOTIMPL; + *aborted = FALSE; + + return S_OK; } static const IFileOperationVtbl file_operation_vtbl = -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/5671
This merge request was closed by Etaash Mathamsetty. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5671
closing since it has been superseeded by a much better implementation -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5671#note_78787
participants (2)
-
Etaash Mathamsetty -
Etaash Mathamsetty (@etaash.mathamsetty)