You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Rebase against 661cc2a1dec5e44e074702707272228178f21487.
This commit is contained in:
@@ -1,231 +0,0 @@
|
||||
From e6c1c1fe3fe2f4fe7d3e421b94d925c40063af22 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Fri, 5 Jul 2019 13:20:23 +0800
|
||||
Subject: [PATCH] cryptext: Implement CryptExtOpenCER.
|
||||
|
||||
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
---
|
||||
configure | 1 +
|
||||
configure.ac | 1 +
|
||||
dlls/cryptext/Makefile.in | 3 +-
|
||||
dlls/cryptext/cryptext.spec | 4 +--
|
||||
dlls/cryptext/cryptext_main.c | 64 +++++++++++++++++++++++++++++++++
|
||||
dlls/cryptext/tests/Makefile.in | 4 +++
|
||||
dlls/cryptext/tests/cryptext.c | 61 +++++++++++++++++++++++++++++++
|
||||
7 files changed, 135 insertions(+), 3 deletions(-)
|
||||
create mode 100644 dlls/cryptext/tests/Makefile.in
|
||||
create mode 100644 dlls/cryptext/tests/cryptext.c
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index ca6e87d4740..7033499399f 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -21660,6 +21660,7 @@ wine_fn_config_makefile dlls/crypt32/tests enable_tests
|
||||
wine_fn_config_makefile dlls/cryptdlg enable_cryptdlg
|
||||
wine_fn_config_makefile dlls/cryptdll enable_cryptdll
|
||||
wine_fn_config_makefile dlls/cryptext enable_cryptext
|
||||
+wine_fn_config_makefile dlls/cryptext/tests enable_tests
|
||||
wine_fn_config_makefile dlls/cryptnet enable_cryptnet
|
||||
wine_fn_config_makefile dlls/cryptnet/tests enable_tests
|
||||
wine_fn_config_makefile dlls/cryptowinrt enable_cryptowinrt
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index cba55126869..57064a05fe5 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -2477,6 +2477,7 @@ WINE_CONFIG_MAKEFILE(dlls/crypt32/tests)
|
||||
WINE_CONFIG_MAKEFILE(dlls/cryptdlg)
|
||||
WINE_CONFIG_MAKEFILE(dlls/cryptdll)
|
||||
WINE_CONFIG_MAKEFILE(dlls/cryptext)
|
||||
+WINE_CONFIG_MAKEFILE(dlls/cryptext/tests)
|
||||
WINE_CONFIG_MAKEFILE(dlls/cryptnet)
|
||||
WINE_CONFIG_MAKEFILE(dlls/cryptnet/tests)
|
||||
WINE_CONFIG_MAKEFILE(dlls/cryptowinrt)
|
||||
diff --git a/dlls/cryptext/Makefile.in b/dlls/cryptext/Makefile.in
|
||||
index 5598bfb78e0..acda4e4ac6d 100644
|
||||
--- a/dlls/cryptext/Makefile.in
|
||||
+++ b/dlls/cryptext/Makefile.in
|
||||
@@ -1,4 +1,5 @@
|
||||
-MODULE = cryptext.dll
|
||||
+MODULE = cryptext.dll
|
||||
+IMPORTS = crypt32 cryptui user32
|
||||
|
||||
EXTRADLLFLAGS = -Wb,--prefer-native
|
||||
|
||||
diff --git a/dlls/cryptext/cryptext.spec b/dlls/cryptext/cryptext.spec
|
||||
index ee3e155f457..24b4794c198 100644
|
||||
--- a/dlls/cryptext/cryptext.spec
|
||||
+++ b/dlls/cryptext/cryptext.spec
|
||||
@@ -12,8 +12,8 @@
|
||||
@ stub CryptExtAddSPCW
|
||||
@ stub CryptExtOpenCAT
|
||||
@ stub CryptExtOpenCATW
|
||||
-@ stub CryptExtOpenCER
|
||||
-@ stub CryptExtOpenCERW
|
||||
+@ stdcall CryptExtOpenCER(long ptr str long)
|
||||
+@ stdcall CryptExtOpenCERW(long ptr wstr long)
|
||||
@ stub CryptExtOpenCRL
|
||||
@ stub CryptExtOpenCRLW
|
||||
@ stub CryptExtOpenCTL
|
||||
diff --git a/dlls/cryptext/cryptext_main.c b/dlls/cryptext/cryptext_main.c
|
||||
index 537ba66cd3b..a4314518eac 100644
|
||||
--- a/dlls/cryptext/cryptext_main.c
|
||||
+++ b/dlls/cryptext/cryptext_main.c
|
||||
@@ -22,10 +22,29 @@
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
+#include "winnls.h"
|
||||
+#include "wincrypt.h"
|
||||
+#include "winuser.h"
|
||||
+#include "cryptuiapi.h"
|
||||
+
|
||||
+#include "wine/heap.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(cryptext);
|
||||
|
||||
+static WCHAR *heap_strdupAtoW(const char *str)
|
||||
+{
|
||||
+ WCHAR *ret;
|
||||
+ INT len;
|
||||
+
|
||||
+ if (!str) return NULL;
|
||||
+ len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
|
||||
+ ret = heap_alloc(len * sizeof(WCHAR));
|
||||
+ if (ret)
|
||||
+ MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
/***********************************************************************
|
||||
* CryptExtAddPFX (CRYPTEXT.@)
|
||||
*/
|
||||
@@ -43,3 +62,48 @@ HRESULT WINAPI CryptExtAddPFXW(LPCWSTR filename)
|
||||
FIXME("stub: %s\n", debugstr_w(filename));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
+
|
||||
+/***********************************************************************
|
||||
+ * CryptExtOpenCERW (CRYPTEXT.@)
|
||||
+ */
|
||||
+HRESULT WINAPI CryptExtOpenCERW(HWND hwnd, HINSTANCE hinst, LPCWSTR filename, DWORD showcmd)
|
||||
+{
|
||||
+ PCCERT_CONTEXT ctx;
|
||||
+ CRYPTUI_VIEWCERTIFICATE_STRUCTW info;
|
||||
+
|
||||
+ TRACE("(%p, %p, %s, %lu)\n", hwnd, hinst, debugstr_w(filename), showcmd);
|
||||
+
|
||||
+ if (!CryptQueryObject(CERT_QUERY_OBJECT_FILE, filename, CERT_QUERY_CONTENT_FLAG_CERT,
|
||||
+ CERT_QUERY_FORMAT_FLAG_ALL, 0, NULL, NULL, NULL, NULL, NULL,
|
||||
+ (const void **)&ctx))
|
||||
+ {
|
||||
+ /* FIXME: move to the resources */
|
||||
+ static const WCHAR msg[] = {'T','h','i','s',' ','i','s',' ','n','o','t',' ','a',' ','v','a','l','i','d',' ','c','e','r','t','i','f','i','c','a','t','e',0};
|
||||
+ MessageBoxW(NULL, msg, filename, MB_OK | MB_ICONERROR);
|
||||
+ return S_OK; /* according to the tests */
|
||||
+ }
|
||||
+
|
||||
+ memset(&info, 0, sizeof(info));
|
||||
+ info.dwSize = sizeof(info);
|
||||
+ info.pCertContext = ctx;
|
||||
+ CryptUIDlgViewCertificateW(&info, NULL);
|
||||
+ CertFreeCertificateContext(ctx);
|
||||
+
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
+/***********************************************************************
|
||||
+ * CryptExtOpenCER (CRYPTEXT.@)
|
||||
+ */
|
||||
+HRESULT WINAPI CryptExtOpenCER(HWND hwnd, HINSTANCE hinst, LPCSTR filename, DWORD showcmd)
|
||||
+{
|
||||
+ HRESULT hr;
|
||||
+ LPWSTR filenameW;
|
||||
+
|
||||
+ TRACE("(%p, %p, %s, %lu)\n", hwnd, hinst, debugstr_a(filename), showcmd);
|
||||
+
|
||||
+ filenameW = heap_strdupAtoW(filename);
|
||||
+ hr = CryptExtOpenCERW(hwnd, hinst, filenameW, showcmd);
|
||||
+ heap_free(filenameW);
|
||||
+ return hr;
|
||||
+}
|
||||
diff --git a/dlls/cryptext/tests/Makefile.in b/dlls/cryptext/tests/Makefile.in
|
||||
new file mode 100644
|
||||
index 00000000000..c3f4551fc00
|
||||
--- /dev/null
|
||||
+++ b/dlls/cryptext/tests/Makefile.in
|
||||
@@ -0,0 +1,4 @@
|
||||
+TESTDLL = cryptext.dll
|
||||
+
|
||||
+SOURCES = \
|
||||
+ cryptext.c
|
||||
diff --git a/dlls/cryptext/tests/cryptext.c b/dlls/cryptext/tests/cryptext.c
|
||||
new file mode 100644
|
||||
index 00000000000..ab1007dbd82
|
||||
--- /dev/null
|
||||
+++ b/dlls/cryptext/tests/cryptext.c
|
||||
@@ -0,0 +1,61 @@
|
||||
+/*
|
||||
+ * Copyright 2019 Dmitry Timoshkov
|
||||
+ *
|
||||
+ * This library is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU Lesser General Public
|
||||
+ * License as published by the Free Software Foundation; either
|
||||
+ * version 2.1 of the License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This library is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * Lesser General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU Lesser General Public
|
||||
+ * License along with this library; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
+ */
|
||||
+
|
||||
+#include <stdarg.h>
|
||||
+#include <assert.h>
|
||||
+#include <windef.h>
|
||||
+#include <winbase.h>
|
||||
+#include <winuser.h>
|
||||
+#include <winerror.h>
|
||||
+
|
||||
+#include "wine/test.h"
|
||||
+
|
||||
+static HRESULT (WINAPI *pCryptExtOpenCER)(HWND,HINSTANCE,LPCSTR,DWORD);
|
||||
+
|
||||
+static void test_CryptExtOpenCER(void)
|
||||
+{
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ if (!pCryptExtOpenCER)
|
||||
+ {
|
||||
+ win_skip("CryptExtOpenCER is not available on this platform\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (!winetest_interactive)
|
||||
+ {
|
||||
+ skip("CryptExtOpenCER test needs user interaction\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ SetLastError(0xdeadbeef);
|
||||
+ hr = pCryptExtOpenCER(0, 0, "dead.beef", SW_HIDE);
|
||||
+ ok(hr == S_OK, "got %#lx\n", hr);
|
||||
+
|
||||
+ hr = pCryptExtOpenCER(0, 0, "VeriSign Class 3 Public Primary Certification Authority - G4.txt", SW_SHOW);
|
||||
+ ok(hr == S_OK, "got %#lx\n", hr);
|
||||
+}
|
||||
+
|
||||
+START_TEST(cryptext)
|
||||
+{
|
||||
+ HMODULE hmod = LoadLibraryA("cryptext.dll");
|
||||
+
|
||||
+ pCryptExtOpenCER = (void *)GetProcAddress(hmod, "CryptExtOpenCER");
|
||||
+
|
||||
+ test_CryptExtOpenCER();
|
||||
+}
|
||||
--
|
||||
2.43.0
|
||||
|
@@ -1,2 +0,0 @@
|
||||
# Taken from the mailing list - July 2019.
|
||||
Fixes: cryptext: Implement CryptExtOpenCER.
|
@@ -1,4 +1,4 @@
|
||||
From 578afa6089ac629fca4aec814cba2b534aabbf28 Mon Sep 17 00:00:00 2001
|
||||
From 27709a4b0e9aa604d2936f8cf79c8958e9d94763 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 26 Feb 2015 23:21:26 +0100
|
||||
Subject: [PATCH] shell32: Pass FILE_INFORMATION into SHNotify* functions.
|
||||
@@ -9,12 +9,12 @@ Preparation of the progressbar work. Based on a patch by Huw Campbell.
|
||||
1 file changed, 104 insertions(+), 110 deletions(-)
|
||||
|
||||
diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c
|
||||
index 9d2d4dc3f82..4bd486a7426 100644
|
||||
index 40cc93eb53d..94e5ab45b37 100644
|
||||
--- a/dlls/shell32/shlfileop.c
|
||||
+++ b/dlls/shell32/shlfileop.c
|
||||
@@ -55,16 +55,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
#define DE_SAMEFILE 0x71
|
||||
#define DE_DESTSAMETREE 0x7D
|
||||
@@ -68,16 +68,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
#define DE_FLDDESTISFILE 0x7E
|
||||
#define DE_FILEDESTISFLD 0x80
|
||||
|
||||
-static DWORD SHNotifyCreateDirectoryA(LPCSTR path, LPSECURITY_ATTRIBUTES sec);
|
||||
-static DWORD SHNotifyCreateDirectoryW(LPCWSTR path, LPSECURITY_ATTRIBUTES sec);
|
||||
@@ -29,7 +29,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
typedef struct
|
||||
{
|
||||
SHFILEOPSTRUCTW *req;
|
||||
@@ -73,6 +63,42 @@ typedef struct
|
||||
@@ -86,6 +76,42 @@ typedef struct
|
||||
BOOL bCancelled;
|
||||
} FILE_OPERATION;
|
||||
|
||||
@@ -72,7 +72,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
/* Confirm dialogs with an optional "Yes To All" as used in file operations confirmations
|
||||
*/
|
||||
struct confirm_msg_info
|
||||
@@ -336,7 +362,7 @@ HRESULT WINAPI SHIsFileAvailableOffline(LPCWSTR path, LPDWORD status)
|
||||
@@ -349,7 +375,7 @@ HRESULT WINAPI SHIsFileAvailableOffline(LPCWSTR path, LPDWORD status)
|
||||
* Asks for confirmation when bShowUI is true and deletes the directory and
|
||||
* all its subdirectories and files if necessary.
|
||||
*/
|
||||
@@ -81,7 +81,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
{
|
||||
DWORD ret = 0;
|
||||
HANDLE hFind;
|
||||
@@ -346,16 +372,18 @@ static DWORD SHELL_DeleteDirectoryW(HWND hwnd, LPCWSTR pszDir, BOOL bShowUI)
|
||||
@@ -359,16 +385,18 @@ static DWORD SHELL_DeleteDirectoryW(HWND hwnd, LPCWSTR pszDir, BOOL bShowUI)
|
||||
PathCombineW(szTemp, pszDir, L"*");
|
||||
hFind = FindFirstFileW(szTemp, &wfd);
|
||||
|
||||
@@ -104,7 +104,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
} while (!ret && FindNextFileW(hFind, &wfd));
|
||||
}
|
||||
FindClose(hFind);
|
||||
@@ -486,22 +514,9 @@ BOOL WINAPI Win32RemoveDirectoryAW(LPCVOID path)
|
||||
@@ -499,22 +527,9 @@ BOOL WINAPI Win32RemoveDirectoryAW(LPCVOID path)
|
||||
return (SHNotifyRemoveDirectoryA(path) == ERROR_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
{
|
||||
LPWSTR wPath;
|
||||
DWORD retCode;
|
||||
@@ -511,7 +526,7 @@ static DWORD SHNotifyDeleteFileA(LPCSTR path)
|
||||
@@ -524,7 +539,7 @@ static DWORD SHNotifyDeleteFileA(LPCSTR path)
|
||||
retCode = SHELL32_AnsiToUnicodeBuf(path, &wPath, 0);
|
||||
if (!retCode)
|
||||
{
|
||||
@@ -139,7 +139,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
free(wPath);
|
||||
}
|
||||
return retCode;
|
||||
@@ -519,12 +534,14 @@ static DWORD SHNotifyDeleteFileA(LPCSTR path)
|
||||
@@ -532,12 +547,14 @@ static DWORD SHNotifyDeleteFileA(LPCSTR path)
|
||||
|
||||
/***********************************************************************/
|
||||
|
||||
@@ -155,7 +155,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
ret = DeleteFileW(path);
|
||||
if (!ret)
|
||||
{
|
||||
@@ -547,8 +564,8 @@ static DWORD SHNotifyDeleteFileW(LPCWSTR path)
|
||||
@@ -560,8 +577,8 @@ static DWORD SHNotifyDeleteFileW(LPCWSTR path)
|
||||
DWORD WINAPI Win32DeleteFileAW(LPCVOID path)
|
||||
{
|
||||
if (SHELL_OsIsUnicode())
|
||||
@@ -166,7 +166,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
@@ -557,18 +574,21 @@ DWORD WINAPI Win32DeleteFileAW(LPCVOID path)
|
||||
@@ -570,18 +587,21 @@ DWORD WINAPI Win32DeleteFileAW(LPCVOID path)
|
||||
* Moves a file. Also triggers a change notify if one exists.
|
||||
*
|
||||
* PARAMS
|
||||
@@ -189,7 +189,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
ret = MoveFileExW(src, dest, MOVEFILE_REPLACE_EXISTING);
|
||||
|
||||
/* MOVEFILE_REPLACE_EXISTING fails with dirs, so try MoveFile */
|
||||
@@ -603,6 +623,7 @@ static DWORD SHNotifyMoveFileW(LPCWSTR src, LPCWSTR dest)
|
||||
@@ -616,6 +636,7 @@ static DWORD SHNotifyMoveFileW(LPCWSTR src, LPCWSTR dest)
|
||||
* Copies a file. Also triggers a change notify if one exists.
|
||||
*
|
||||
* PARAMS
|
||||
@@ -197,7 +197,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
* src [I] path to source file to move
|
||||
* dest [I] path to target file to move to
|
||||
* bFailIfExists [I] if TRUE, the target file will not be overwritten if
|
||||
@@ -611,13 +632,15 @@ static DWORD SHNotifyMoveFileW(LPCWSTR src, LPCWSTR dest)
|
||||
@@ -624,13 +645,15 @@ static DWORD SHNotifyMoveFileW(LPCWSTR src, LPCWSTR dest)
|
||||
* RETURNS
|
||||
* ERROR_SUCCESS if successful
|
||||
*/
|
||||
@@ -214,7 +214,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
/* Destination file may already exist with read only attribute */
|
||||
attribs = GetFileAttributesW(dest);
|
||||
if (IsAttrib(attribs, FILE_ATTRIBUTE_READONLY))
|
||||
@@ -897,30 +920,6 @@ int WINAPI SHFileOperationA(LPSHFILEOPSTRUCTA lpFileOp)
|
||||
@@ -910,30 +933,6 @@ int WINAPI SHFileOperationA(LPSHFILEOPSTRUCTA lpFileOp)
|
||||
return retCode;
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
static inline void grow_list(FILE_LIST *list)
|
||||
{
|
||||
FILE_ENTRY *new = _recalloc(list->feFiles, list->num_alloc * 2, sizeof(*new));
|
||||
@@ -1085,7 +1084,7 @@ static void destroy_file_list(FILE_LIST *flList)
|
||||
@@ -1099,7 +1098,7 @@ static void destroy_file_list(FILE_LIST *flList)
|
||||
static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWSTR szDestPath)
|
||||
{
|
||||
WCHAR szFrom[MAX_PATH], szTo[MAX_PATH];
|
||||
@@ -254,7 +254,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
|
||||
if (IsDotDir(feFrom->szFilename))
|
||||
return;
|
||||
@@ -1111,17 +1110,16 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST
|
||||
@@ -1125,17 +1124,16 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST
|
||||
PathCombineW(szFrom, feFrom->szFullPath, L"*.*");
|
||||
szFrom[lstrlenW(szFrom) + 1] = '\0';
|
||||
|
||||
@@ -264,8 +264,8 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
- fileOp.fFlags &= ~FOF_MULTIDESTFILES; /* we know we're copying to one dir */
|
||||
+ ZeroMemory(&flFromNew, sizeof(FILE_LIST));
|
||||
+ ZeroMemory(&flToNew, sizeof(FILE_LIST));
|
||||
+ parse_file_list(&flFromNew, szFrom);
|
||||
+ parse_file_list(&flToNew, szTo);
|
||||
+ parse_file_list(&flFromNew, szFrom, TRUE);
|
||||
+ parse_file_list(&flToNew, szTo, TRUE);
|
||||
|
||||
- /* Don't ask the user about overwriting files when he accepted to overwrite the
|
||||
- folder. FIXME: this is not exactly what Windows does - e.g. there would be
|
||||
@@ -280,7 +280,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
}
|
||||
|
||||
static BOOL copy_file_to_file(FILE_OPERATION *op, const WCHAR *szFrom, const WCHAR *szTo)
|
||||
@@ -1132,7 +1130,7 @@ static BOOL copy_file_to_file(FILE_OPERATION *op, const WCHAR *szFrom, const WCH
|
||||
@@ -1146,7 +1144,7 @@ static BOOL copy_file_to_file(FILE_OPERATION *op, const WCHAR *szFrom, const WCH
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -289,7 +289,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
}
|
||||
|
||||
/* copy a file or directory to another directory */
|
||||
@@ -1172,7 +1170,7 @@ static void create_dest_dirs(LPCWSTR szDestDir)
|
||||
@@ -1186,7 +1184,7 @@ static void create_dest_dirs(LPCWSTR szDestDir)
|
||||
}
|
||||
|
||||
/* the FO_COPY operation */
|
||||
@@ -298,7 +298,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
{
|
||||
DWORD i;
|
||||
const FILE_ENTRY *entryToCopy;
|
||||
@@ -1195,7 +1193,7 @@ static int copy_files(FILE_OPERATION *op, const FILE_LIST *flFrom, FILE_LIST *fl
|
||||
@@ -1209,7 +1207,7 @@ static int copy_files(FILE_OPERATION *op, const FILE_LIST *flFrom, FILE_LIST *fl
|
||||
fileDest = &flTo->feFiles[0];
|
||||
}
|
||||
|
||||
@@ -307,7 +307,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
{
|
||||
if (flFrom->bAnyFromWildcard)
|
||||
return ERROR_CANCELLED;
|
||||
@@ -1247,8 +1245,7 @@ static int copy_files(FILE_OPERATION *op, const FILE_LIST *flFrom, FILE_LIST *fl
|
||||
@@ -1261,8 +1259,7 @@ static int copy_files(FILE_OPERATION *op, const FILE_LIST *flFrom, FILE_LIST *fl
|
||||
{
|
||||
entryToCopy = &flFrom->feFiles[i];
|
||||
|
||||
@@ -317,7 +317,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
{
|
||||
fileDest = &flTo->feFiles[i];
|
||||
}
|
||||
@@ -1319,7 +1316,7 @@ static BOOL confirm_delete_list(HWND hWnd, DWORD fFlags, BOOL fTrash, const FILE
|
||||
@@ -1333,7 +1330,7 @@ static BOOL confirm_delete_list(HWND hWnd, DWORD fFlags, BOOL fTrash, const FILE
|
||||
}
|
||||
|
||||
/* the FO_DELETE operation */
|
||||
@@ -326,7 +326,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
{
|
||||
const FILE_ENTRY *fileEntry;
|
||||
DWORD i;
|
||||
@@ -1330,12 +1327,12 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom)
|
||||
@@ -1344,12 +1341,12 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom)
|
||||
return ERROR_SUCCESS;
|
||||
|
||||
/* Windows also checks only the first item */
|
||||
@@ -343,7 +343,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1344,7 +1341,7 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom)
|
||||
@@ -1358,7 +1355,7 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom)
|
||||
fileEntry = &flFrom->feFiles[i];
|
||||
|
||||
if (!IsAttribFile(fileEntry->attributes) &&
|
||||
@@ -352,7 +352,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
continue;
|
||||
|
||||
if (bTrash)
|
||||
@@ -1354,14 +1351,14 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom)
|
||||
@@ -1368,14 +1365,14 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom)
|
||||
continue;
|
||||
|
||||
/* Note: Windows silently deletes the file in such a situation, we show a dialog */
|
||||
@@ -370,7 +370,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1371,7 +1368,7 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom)
|
||||
@@ -1385,7 +1382,7 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom)
|
||||
ret = DeleteFileW(fileEntry->szFullPath) ?
|
||||
ERROR_SUCCESS : GetLastError();
|
||||
else
|
||||
@@ -379,7 +379,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -1381,12 +1378,12 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom)
|
||||
@@ -1395,12 +1392,12 @@ static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom)
|
||||
}
|
||||
|
||||
/* move a directory to another directory */
|
||||
@@ -394,7 +394,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
lstrcpyW(to, feTo->szFullPath);
|
||||
else
|
||||
PathCombineW(to, feTo->szFullPath, feFrom->szFilename);
|
||||
@@ -1397,15 +1394,14 @@ static void move_dir_to_dir(LPSHFILEOPSTRUCTW lpFileOp, const FILE_ENTRY *feFrom
|
||||
@@ -1411,15 +1408,14 @@ static void move_dir_to_dir(LPSHFILEOPSTRUCTW lpFileOp, const FILE_ENTRY *feFrom
|
||||
with wildcard and restart SHFileOperationW */
|
||||
if (PathFileExistsW(to))
|
||||
{
|
||||
@@ -412,7 +412,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
|
||||
/* Don't ask the user about overwriting files when he accepted to overwrite the
|
||||
folder. FIXME: this is not exactly what Windows does - e.g. there would be
|
||||
@@ -1418,22 +1414,22 @@ static void move_dir_to_dir(LPSHFILEOPSTRUCTW lpFileOp, const FILE_ENTRY *feFrom
|
||||
@@ -1432,22 +1428,22 @@ static void move_dir_to_dir(LPSHFILEOPSTRUCTW lpFileOp, const FILE_ENTRY *feFrom
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -439,7 +439,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
{
|
||||
DWORD i;
|
||||
INT mismatched = 0;
|
||||
@@ -1447,14 +1443,12 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const
|
||||
@@ -1461,14 +1457,12 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const
|
||||
if (!flTo->dwNumFiles)
|
||||
return ERROR_FILE_NOT_FOUND;
|
||||
|
||||
@@ -456,7 +456,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
flFrom->dwNumFiles > flTo->dwNumFiles)
|
||||
{
|
||||
return ERROR_CANCELLED;
|
||||
@@ -1464,7 +1458,7 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const
|
||||
@@ -1478,7 +1472,7 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const
|
||||
if (ret && ret != ERROR_ALREADY_EXISTS)
|
||||
return ret;
|
||||
|
||||
@@ -465,7 +465,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
mismatched = flFrom->dwNumFiles - flTo->dwNumFiles;
|
||||
|
||||
fileDest = &flTo->feFiles[0];
|
||||
@@ -1475,7 +1469,7 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const
|
||||
@@ -1489,7 +1483,7 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const
|
||||
if (!PathFileExistsW(fileDest->szDirectory))
|
||||
return ERROR_CANCELLED;
|
||||
|
||||
@@ -474,7 +474,7 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
{
|
||||
if (i >= flTo->dwNumFiles)
|
||||
break;
|
||||
@@ -1491,12 +1485,12 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const
|
||||
@@ -1505,12 +1499,12 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const
|
||||
if (fileDest->bExists && IsAttribDir(fileDest->attributes))
|
||||
{
|
||||
if (IsAttribDir(entryToMove->attributes))
|
||||
@@ -490,25 +490,25 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
}
|
||||
|
||||
if (mismatched > 0)
|
||||
@@ -1511,7 +1505,7 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const
|
||||
@@ -1525,7 +1519,7 @@ static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const
|
||||
}
|
||||
|
||||
/* the FO_RENAME files */
|
||||
-static int rename_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const FILE_LIST *flTo)
|
||||
+static int rename_files(FILE_OPERATION *op, const FILE_LIST *flFrom, const FILE_LIST *flTo)
|
||||
/* The FO_RENAME operation of SHFileOperation. */
|
||||
-static DWORD rename_files(SHFILEOPSTRUCTW *op, const FILE_LIST *from, const FILE_LIST *to)
|
||||
+static DWORD rename_files(FILE_OPERATION *op, const FILE_LIST *from, const FILE_LIST *to)
|
||||
{
|
||||
const FILE_ENTRY *feFrom;
|
||||
const FILE_ENTRY *feTo;
|
||||
@@ -1533,7 +1527,7 @@ static int rename_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, con
|
||||
if (feTo->bExists)
|
||||
return ERROR_ALREADY_EXISTS;
|
||||
const FILE_ENTRY *entry_from, *entry_to;
|
||||
|
||||
- return SHNotifyMoveFileW(feFrom->szFullPath, feTo->szFullPath);
|
||||
+ return SHNotifyMoveFileW(op, feFrom->szFullPath, feTo->szFullPath);
|
||||
@@ -1550,7 +1544,7 @@ static DWORD rename_files(SHFILEOPSTRUCTW *op, const FILE_LIST *from, const FILE
|
||||
if (entry_to->bExists && IsAttribDir(entry_from->attributes) != IsAttribDir(entry_to->attributes))
|
||||
return IsAttribDir(entry_to->attributes) ? DE_FILEDESTISFLD : DE_FLDDESTISFILE;
|
||||
|
||||
- return SHNotifyMoveFileW(entry_from->szFullPath, entry_to->szFullPath);
|
||||
+ return SHNotifyMoveFileW(op, entry_from->szFullPath, entry_to->szFullPath);
|
||||
}
|
||||
|
||||
/* alert the user if an unsupported flag is used */
|
||||
@@ -1580,16 +1574,16 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
|
||||
@@ -1597,16 +1591,16 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
|
||||
switch (lpFileOp->wFunc)
|
||||
{
|
||||
case FO_COPY:
|
||||
@@ -530,5 +530,5 @@ index 9d2d4dc3f82..4bd486a7426 100644
|
||||
default:
|
||||
ret = ERROR_INVALID_PARAMETER;
|
||||
--
|
||||
2.43.0
|
||||
2.47.2
|
||||
|
||||
|
@@ -1 +1 @@
|
||||
647004cd5d7ee93ad8b53abb8939da87be3e25a0
|
||||
661cc2a1dec5e44e074702707272228178f21487
|
||||
|
Reference in New Issue
Block a user