Rebase against ff187dc851c1d9f992049688a7e7190b83250ae4.

This commit is contained in:
Alistair Leslie-Hughes
2025-10-24 09:57:11 +11:00
parent 194b2de8dc
commit f12010f53d
15 changed files with 42 additions and 995 deletions

View File

@@ -1,20 +1,20 @@
From d683f0129b0df79227b23133874960284b76baa8 Mon Sep 17 00:00:00 2001
From 5415f4b6355c3d28d1fbe34aa3627554cea04e36 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Fri, 11 Sep 2020 17:55:59 +1000
Subject: [PATCH] include: Remove interfaces already define in msxml6.idl
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
dlls/msxml3/factory.c | 3 +-
dlls/msxml3/tests/saxreader.c | 1 +
dlls/msxml3/tests/schema.c | 5 ++
dlls/msxml3/uuid.c | 10 ++++
include/msxml2.idl | 101 ----------------------------------
include/msxml6.idl | 24 ++++----
6 files changed, 29 insertions(+), 115 deletions(-)
dlls/msxml3/factory.c | 3 +--
dlls/msxml3/tests/saxreader.c | 1 +
dlls/msxml3/tests/schema.c | 5 +++++
dlls/msxml3/uuid.c | 3 +++
include/msxml2.idl | 9 ---------
include/msxml6.idl | 24 ++++++++++++------------
6 files changed, 22 insertions(+), 23 deletions(-)
diff --git a/dlls/msxml3/factory.c b/dlls/msxml3/factory.c
index e91666c6d79..e35839db2a3 100644
index cd10ec5f8de..782df43dc06 100644
--- a/dlls/msxml3/factory.c
+++ b/dlls/msxml3/factory.c
@@ -31,6 +31,7 @@
@@ -25,7 +25,7 @@ index e91666c6d79..e35839db2a3 100644
#include "xmlparser.h"
/* undef the #define in msxml2 so that we can access the v.2 version
@@ -43,8 +44,6 @@
@@ -52,8 +53,6 @@ DEFINE_GUID(CLSID_XSLTemplate60, 0x88d96a08, 0xf192, 0x11d4, 0xa6, 0x5f, 0x00, 0
WINE_DEFAULT_DEBUG_CHANNEL(msxml);
@@ -35,7 +35,7 @@ index e91666c6d79..e35839db2a3 100644
typedef HRESULT (*DOMFactoryCreateInstanceFunc)(MSXML_VERSION, void**);
diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c
index e123d4eba5a..48cfa8f5593 100644
index 31424aa62b6..e847c399814 100644
--- a/dlls/msxml3/tests/saxreader.c
+++ b/dlls/msxml3/tests/saxreader.c
@@ -29,6 +29,7 @@
@@ -63,92 +63,24 @@ index 50e5a743b82..c83e72e136a 100644
static const WCHAR xdr_schema1_uri[] = L"x-schema:test1.xdr";
diff --git a/dlls/msxml3/uuid.c b/dlls/msxml3/uuid.c
index 7e50b439146..7214d23c5dc 100644
index 7e50b439146..a51e3b27580 100644
--- a/dlls/msxml3/uuid.c
+++ b/dlls/msxml3/uuid.c
@@ -41,6 +41,16 @@
@@ -41,6 +41,9 @@
#include "initguid.h"
#include "msxml2.h"
+/* Cannot include msxml6 here since we will get a duplicate LIBID_MSXML2 error. */
+DEFINE_GUID(CLSID_FreeThreadedDOMDocument60, 0x88d96a06, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+DEFINE_GUID(CLSID_MXNamespaceManager60, 0x88d96a11, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+DEFINE_GUID(CLSID_MXXMLWriter60, 0x88d96a0f, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+DEFINE_GUID(CLSID_SAXAttributes60, 0x88d96a0e, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+DEFINE_GUID(CLSID_SAXXMLReader60, 0x88d96a0c, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+DEFINE_GUID(CLSID_ServerXMLHTTP60, 0x88d96a0b, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+DEFINE_GUID(CLSID_XMLHTTP60, 0x88d96a0a, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+DEFINE_GUID(CLSID_XSLTemplate60, 0x88d96a08, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+
/*
* Note that because of a #define in msxml2.h, we end up initializing
* CLSID_DOMDocument2 to be the v.3 version independent DOMDocument
diff --git a/include/msxml2.idl b/include/msxml2.idl
index 848bc13952a..85bb6a5b0cb 100644
index d91087bec93..85bb6a5b0cb 100644
--- a/include/msxml2.idl
+++ b/include/msxml2.idl
@@ -1612,15 +1612,6 @@ coclass FreeThreadedDOMDocument40
[default, source] dispinterface XMLDOMDocumentEvents;
}
-[
- uuid(88d96a06-f192-11d4-a65f-0040963251e5),
-]
-coclass FreeThreadedDOMDocument60
-{
- [default] interface IXMLDOMDocument3;
- [default, source] dispinterface XMLDOMDocumentEvents;
-}
-
[
helpstring("Free threaded XML DOM Document"),
progid("Msxml2.FreeThreadedDOMDocument"),
@@ -1662,14 +1653,6 @@ coclass XMLHTTP40
[default] interface IXMLHTTPRequest;
}
-[
- uuid(88d96a0a-f192-11d4-a65f-0040963251e5)
-]
-coclass XMLHTTP60
-{
- [default] interface IXMLHTTPRequest;
-}
-
[
helpstring("XML HTTP"),
progid("Msxml2.XMLHTTP"),
@@ -1702,14 +1685,6 @@ coclass ServerXMLHTTP40
[default] interface IServerXMLHTTPRequest2;
}
-[
- uuid(88d96a0b-f192-11d4-a65f-0040963251e5)
-]
-coclass ServerXMLHTTP60
-{
- [default] interface IServerXMLHTTPRequest2;
-}
-
[
helpstring("Server XML HTTP"),
progid("Msxml2.ServerXMLHTTP"),
@@ -1790,14 +1765,6 @@ coclass XSLTemplate40
[default] interface IXSLTemplate;
}
-[
- uuid(88d96a08-f192-11d4-a65f-0040963251e5)
-]
-coclass XSLTemplate60
-{
- [default] interface IXSLTemplate;
-}
-
[
helpstring("XSL Template"),
progid("Msxml2.XSLTemplate"),
@@ -3289,15 +3256,6 @@ coclass SAXXMLReader40
@@ -3256,15 +3256,6 @@ coclass SAXXMLReader40
interface ISAXXMLReader;
}
@@ -164,95 +96,8 @@ index 848bc13952a..85bb6a5b0cb 100644
[
helpstring("SAX XML Reader"),
progid("Msxml2.SAXXMLReader"),
@@ -3372,26 +3330,6 @@ coclass MXHTMLWriter40
interface IVBSAXLexicalHandler;
}
-[
- uuid(88d96a10-f192-11d4-a65f-0040963251e5)
-]
-coclass MXHTMLWriter60
-{
- [default] interface IMXWriter;
-
- interface ISAXContentHandler;
- interface ISAXDeclHandler;
- interface ISAXDTDHandler;
- interface ISAXErrorHandler;
- interface ISAXLexicalHandler;
-
- interface IVBSAXContentHandler;
- interface IVBSAXDeclHandler;
- interface IVBSAXDTDHandler;
- interface IVBSAXErrorHandler;
- interface IVBSAXLexicalHandler;
-}
-
[
helpstring("MXXMLWriter 3.0"),
progid("Msxml2.MXXMLWriter.3.0"),
@@ -3436,26 +3374,6 @@ coclass MXXMLWriter40
interface IVBSAXLexicalHandler;
}
-[
- uuid(88d96a0f-f192-11d4-a65f-0040963251e5)
-]
-coclass MXXMLWriter60
-{
- [default] interface IMXWriter;
-
- interface ISAXContentHandler;
- interface ISAXDeclHandler;
- interface ISAXDTDHandler;
- interface ISAXErrorHandler;
- interface ISAXLexicalHandler;
-
- interface IVBSAXContentHandler;
- interface IVBSAXDeclHandler;
- interface IVBSAXDTDHandler;
- interface IVBSAXErrorHandler;
- interface IVBSAXLexicalHandler;
-}
-
[
helpstring("MXXMLWriter"),
progid("Msxml2.MXXMLWriter"),
@@ -3498,15 +3416,6 @@ coclass MXNamespaceManager40
interface IMXNamespaceManager;
}
-[
- uuid(88d96a11-f192-11d4-a65f-0040963251e5)
-]
-coclass MXNamespaceManager60
-{
- [default] interface IVBMXNamespaceManager;
- interface IMXNamespaceManager;
-}
-
[
helpstring("SAXAttributes 3.0"),
progid("Msxml2.SAXAttributes.3.0"),
@@ -3531,16 +3440,6 @@ coclass SAXAttributes40
interface ISAXAttributes;
}
-[
- uuid(88d96a0e-f192-11d4-a65f-0040963251e5)
-]
-coclass SAXAttributes60
-{
- [default] interface IMXAttributes;
- interface IVBSAXAttributes;
- interface ISAXAttributes;
-}
-
[
helpstring("SAXAttributes"),
progid("Msxml2.SAXAttributes"),
diff --git a/include/msxml6.idl b/include/msxml6.idl
index d4a5c490243..7396826a1f6 100644
index ead87be7516..bf7e0905057 100644
--- a/include/msxml6.idl
+++ b/include/msxml6.idl
@@ -3065,18 +3065,6 @@ coclass DOMDocument60
@@ -294,5 +139,5 @@ index d4a5c490243..7396826a1f6 100644
helpstring("XML HTTP 6.0"),
progid("Msxml2.XMLHTTP.6.0"),
--
2.43.0
2.51.0

View File

@@ -1,4 +1,4 @@
From 5bcc58b53dd99c5d6d85141d5658a5d7e98d8253 Mon Sep 17 00:00:00 2001
From a6a004bc410fbe8fc5106c4f0fa379bfde612725 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Tue, 8 Sep 2020 18:43:52 +0200
Subject: [PATCH] msxml3: Implement FreeThreadedXMLHTTP60.
@@ -11,9 +11,9 @@ Update from Gijs Vermeulen <gijsvrm@gmail.com>
dlls/msxml3/msxml_private.h | 1 +
dlls/msxml3/tests/httpreq.c | 395 +++++++++++++++++++++++++++-
dlls/msxml3/tests/schema.c | 6 +
dlls/msxml3/uuid.c | 5 +
dlls/msxml3/uuid.c | 6 +-
include/msxml6.idl | 22 +-
8 files changed, 915 insertions(+), 16 deletions(-)
8 files changed, 915 insertions(+), 17 deletions(-)
diff --git a/dlls/msxml3/Makefile.in b/dlls/msxml3/Makefile.in
index 7e59a223143..5044c4e2c79 100644
@@ -27,10 +27,10 @@ index 7e59a223143..5044c4e2c79 100644
SOURCES = \
diff --git a/dlls/msxml3/factory.c b/dlls/msxml3/factory.c
index e35839db2a3..0e2482d61be 100644
index 782df43dc06..f479d6bd17e 100644
--- a/dlls/msxml3/factory.c
+++ b/dlls/msxml3/factory.c
@@ -279,6 +279,7 @@ static HRESULT DOMClassFactory_Create(const GUID *clsid, REFIID riid, void **ppv
@@ -288,6 +288,7 @@ static HRESULT DOMClassFactory_Create(const GUID *clsid, REFIID riid, void **ppv
static ClassFactory xmldoccf = { { &ClassFactoryVtbl }, XMLDocument_create };
static ClassFactory httpreqcf = { { &ClassFactoryVtbl }, XMLHTTPRequest_create };
@@ -38,7 +38,7 @@ index e35839db2a3..0e2482d61be 100644
static ClassFactory serverhttp = { { &ClassFactoryVtbl }, ServerXMLHTTP_create };
static ClassFactory xsltemplatecf = { { &ClassFactoryVtbl }, XSLTemplate_create };
static ClassFactory mxnsmanagercf = { {&ClassFactoryVtbl }, MXNamespaceManager_create };
@@ -340,6 +341,10 @@ HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID riid, void **ppv )
@@ -349,6 +350,10 @@ HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID riid, void **ppv )
{
cf = &httpreqcf.IClassFactory_iface;
}
@@ -1038,28 +1038,22 @@ index c83e72e136a..c896f1e6a04 100644
#include "wine/test.h"
diff --git a/dlls/msxml3/uuid.c b/dlls/msxml3/uuid.c
index 7214d23c5dc..320a7e04fa3 100644
index a51e3b27580..e2b564cf891 100644
--- a/dlls/msxml3/uuid.c
+++ b/dlls/msxml3/uuid.c
@@ -43,6 +43,7 @@
@@ -43,7 +43,11 @@
/* Cannot include msxml6 here since we will get a duplicate LIBID_MSXML2 error. */
DEFINE_GUID(CLSID_FreeThreadedDOMDocument60, 0x88d96a06, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
DEFINE_GUID(CLSID_SAXXMLReader60, 0x88d96a0c, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
-
+DEFINE_GUID(CLSID_FreeThreadedXMLHTTP60, 0x88d96a09, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
DEFINE_GUID(CLSID_MXNamespaceManager60, 0x88d96a11, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
DEFINE_GUID(CLSID_MXXMLWriter60, 0x88d96a0f, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
DEFINE_GUID(CLSID_SAXAttributes60, 0x88d96a0e, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
@@ -50,6 +51,10 @@ DEFINE_GUID(CLSID_SAXXMLReader60, 0x88d96a0c, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x
DEFINE_GUID(CLSID_ServerXMLHTTP60, 0x88d96a0b, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
DEFINE_GUID(CLSID_XMLHTTP60, 0x88d96a0a, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
DEFINE_GUID(CLSID_XSLTemplate60, 0x88d96a08, 0xf192, 0x11d4, 0xa6,0x5f, 0x00,0x40,0x96,0x32,0x51,0xe5);
+DEFINE_GUID(IID_IXMLHTTPRequest2, 0xe5d37dc0, 0x552a, 0x4d52, 0x9c,0xc0, 0xa1,0x4d,0x54,0x6f,0xbd,0x04);
+DEFINE_GUID(IID_IXMLHTTPRequest3, 0xa1c9feee, 0x0617, 0x4f23, 0x9d,0x58, 0x89,0x61,0xea,0x43,0x56,0x7c);
+DEFINE_GUID(IID_IXMLHTTPRequest2Callback, 0xa44a9299, 0xe321, 0x40de, 0x88,0x66, 0x34,0x1b,0x41,0x66,0x91,0x62);
+DEFINE_GUID(IID_IXMLHTTPRequest3Callback, 0xb9e57830, 0x8c6c, 0x4a6f, 0x9c,0x13, 0x47,0x77,0x2b,0xb0,0x47,0xbb);
/*
* Note that because of a #define in msxml2.h, we end up initializing
* CLSID_DOMDocument2 to be the v.3 version independent DOMDocument
diff --git a/include/msxml6.idl b/include/msxml6.idl
index bf7e0905057..a02f7b2db14 100644
--- a/include/msxml6.idl
@@ -1101,5 +1095,5 @@ index bf7e0905057..a02f7b2db14 100644
helpstring("XML DOM Document 6.0"),
progid("Msxml2.DOMDocument.6.0"),
--
2.47.2
2.51.0

View File

@@ -1,19 +1,18 @@
From 9409a546aa17e178a6f1ce07cdaa8e0186429239 Mon Sep 17 00:00:00 2001
From a1d009010d674af140dbcb7d8b4dab4fad7dbc2e Mon Sep 17 00:00:00 2001
From: Jefferson Carpenter <jeffersoncarpenter2@gmail.com>
Date: Thu, 4 Nov 2021 22:30:05 +0000
Subject: [PATCH] msxml3: Write to DOMDocument mxwriter destination in
endDocument.
---
dlls/msxml3/mxwriter.c | 41 +++++++++++++++++++++++++++++++++--
dlls/msxml3/tests/saxreader.c | 1 +
2 files changed, 40 insertions(+), 2 deletions(-)
dlls/msxml3/mxwriter.c | 41 +++++++++++++++++++++++++++++++++++++++--
1 file changed, 39 insertions(+), 2 deletions(-)
diff --git a/dlls/msxml3/mxwriter.c b/dlls/msxml3/mxwriter.c
index 4a2844bcf08..8caf8979692 100644
index 29b286356ec..1f4030db7cb 100644
--- a/dlls/msxml3/mxwriter.c
+++ b/dlls/msxml3/mxwriter.c
@@ -189,6 +189,7 @@ typedef struct
@@ -168,6 +168,7 @@ typedef struct
BSTR element;
IStream *dest;
@@ -21,7 +20,7 @@ index 4a2844bcf08..8caf8979692 100644
output_buffer buffer;
} mxwriter;
@@ -850,6 +851,7 @@ static ULONG WINAPI mxwriter_Release(IMXWriter *iface)
@@ -829,6 +830,7 @@ static ULONG WINAPI mxwriter_Release(IMXWriter *iface)
free_output_buffer(&This->buffer);
if (This->dest) IStream_Release(This->dest);
@@ -29,7 +28,7 @@ index 4a2844bcf08..8caf8979692 100644
SysFreeString(This->version);
SysFreeString(This->encoding);
@@ -914,6 +916,8 @@ static HRESULT WINAPI mxwriter_put_output(IMXWriter *iface, VARIANT dest)
@@ -893,6 +895,8 @@ static HRESULT WINAPI mxwriter_put_output(IMXWriter *iface, VARIANT dest)
{
if (This->dest) IStream_Release(This->dest);
This->dest = NULL;
@@ -38,7 +37,7 @@ index 4a2844bcf08..8caf8979692 100644
close_output_buffer(This);
break;
}
@@ -929,12 +933,33 @@ static HRESULT WINAPI mxwriter_put_output(IMXWriter *iface, VARIANT dest)
@@ -908,12 +912,33 @@ static HRESULT WINAPI mxwriter_put_output(IMXWriter *iface, VARIANT dest)
if (This->dest) IStream_Release(This->dest);
This->dest = stream;
@@ -72,7 +71,7 @@ index 4a2844bcf08..8caf8979692 100644
default:
FIXME("unhandled destination type %s\n", debugstr_variant(&dest));
return E_NOTIMPL;
@@ -1201,7 +1226,7 @@ static HRESULT WINAPI SAXContentHandler_putDocumentLocator(
@@ -1180,7 +1205,7 @@ static HRESULT WINAPI SAXContentHandler_putDocumentLocator(
{
mxwriter *This = impl_from_ISAXContentHandler( iface );
FIXME("(%p)->(%p)\n", This, locator);
@@ -81,7 +80,7 @@ index 4a2844bcf08..8caf8979692 100644
}
static HRESULT WINAPI SAXContentHandler_startDocument(ISAXContentHandler *iface)
@@ -1239,10 +1264,21 @@ static HRESULT WINAPI SAXContentHandler_startDocument(ISAXContentHandler *iface)
@@ -1218,10 +1243,21 @@ static HRESULT WINAPI SAXContentHandler_startDocument(ISAXContentHandler *iface)
static HRESULT WINAPI SAXContentHandler_endDocument(ISAXContentHandler *iface)
{
@@ -104,7 +103,7 @@ index 4a2844bcf08..8caf8979692 100644
}
static HRESULT WINAPI SAXContentHandler_startPrefixMapping(
@@ -2630,6 +2666,7 @@ HRESULT MXWriter_create(MSXML_VERSION version, void **ppObj)
@@ -2608,6 +2644,7 @@ HRESULT MXWriter_create(MSXML_VERSION version, void **ppObj)
This->newline = FALSE;
This->dest = NULL;
@@ -112,18 +111,6 @@ index 4a2844bcf08..8caf8979692 100644
hr = init_output_buffer(This->xml_enc, &This->buffer);
if (hr != S_OK) {
diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c
index e123d4eba5a..f933ffe85a2 100644
--- a/dlls/msxml3/tests/saxreader.c
+++ b/dlls/msxml3/tests/saxreader.c
@@ -4563,6 +4563,7 @@ static void test_mxwriter_domdoc(void)
todo_wine
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ if (!node) return;
hr = IXMLDOMNode_get_nodeName(node, &str);
todo_wine {
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
--
2.43.0
2.51.0

View File

@@ -1,74 +0,0 @@
From 291a45af5ab416fc896f1343453c7e3a24f188d8 Mon Sep 17 00:00:00 2001
From: Robert Wilhelm <robert.wilhelm@gmx.net>
Date: Wed, 29 Jun 2022 16:05:48 +0200
Subject: [PATCH] scrrun: Implement MoveFolder().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52128
Signed-off-by: Robert Wilhelm <robert.wilhelm@gmx.net>
---
dlls/scrrun/filesystem.c | 7 +++----
dlls/scrrun/tests/filesystem.c | 20 ++++++++++++++++++++
2 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c
index e53355267db..ab02d4680cd 100644
--- a/dlls/scrrun/filesystem.c
+++ b/dlls/scrrun/filesystem.c
@@ -3803,12 +3803,11 @@ static HRESULT WINAPI filesys_MoveFile(IFileSystem3 *iface, BSTR source, BSTR de
return MoveFileW(source, destination) ? S_OK : create_error(GetLastError());
}
-static HRESULT WINAPI filesys_MoveFolder(IFileSystem3 *iface,BSTR Source,
- BSTR Destination)
+static HRESULT WINAPI filesys_MoveFolder(IFileSystem3 *iface, BSTR source, BSTR destination)
{
- FIXME("%p %s %s\n", iface, debugstr_w(Source), debugstr_w(Destination));
+ TRACE("%p %s %s\n", iface, debugstr_w(source), debugstr_w(destination));
- return E_NOTIMPL;
+ return MoveFileW(source, destination) ? S_OK : create_error(GetLastError());
}
static inline HRESULT copy_file(const WCHAR *source, DWORD source_len,
diff --git a/dlls/scrrun/tests/filesystem.c b/dlls/scrrun/tests/filesystem.c
index e53bd092ce9..7a5de4407a8 100644
--- a/dlls/scrrun/tests/filesystem.c
+++ b/dlls/scrrun/tests/filesystem.c
@@ -2639,6 +2639,25 @@ static void test_MoveFile(void)
SysFreeString(str);
}
+static void test_MoveFolder(void)
+{
+ BSTR src, dst;
+ WCHAR buffW1[MAX_PATH],buffW2[MAX_PATH];
+ HRESULT hr;
+
+ get_temp_path(L"foo", buffW1);
+ get_temp_path(L"bar", buffW2);
+
+ ok(CreateDirectoryW(buffW1, NULL), "CreateDirectory(%s) failed\n", wine_dbgstr_w(buffW1));
+ src = SysAllocString(buffW1);
+ dst = SysAllocString(buffW2);
+ hr = IFileSystem3_MoveFolder(fs3, src, dst);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ SysFreeString(src);
+ SysFreeString(dst);
+ ok(RemoveDirectoryW(buffW2), "can't remove %s directory\n", wine_dbgstr_w(buffW2));
+}
+
static void test_DoOpenPipeStream(void)
{
static const char testdata[] = "test";
@@ -2772,6 +2791,7 @@ START_TEST(filesystem)
test_GetExtensionName();
test_GetSpecialFolder();
test_MoveFile();
+ test_MoveFolder();
test_DoOpenPipeStream();
IFileSystem3_Release(fs3);
--
2.43.0

View File

@@ -1,61 +0,0 @@
From 0e42b8f30afc0984703f09258e1fbc6224c207fa Mon Sep 17 00:00:00 2001
From: Robert Wilhelm <robert.wilhelm@gmx.net>
Date: Wed, 29 Jun 2022 16:11:56 +0200
Subject: [PATCH] scrrun: Check for null and empty arguments in MoveFolder.
Signed-off-by: Robert Wilhelm <robert.wilhelm@gmx.net>
---
dlls/scrrun/filesystem.c | 3 +++
dlls/scrrun/tests/filesystem.c | 15 ++++++++++++++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c
index ab02d4680cd..a56af2f0461 100644
--- a/dlls/scrrun/filesystem.c
+++ b/dlls/scrrun/filesystem.c
@@ -3807,6 +3807,9 @@ static HRESULT WINAPI filesys_MoveFolder(IFileSystem3 *iface, BSTR source, BSTR
{
TRACE("%p %s %s\n", iface, debugstr_w(source), debugstr_w(destination));
+ if(!source || !source[0] || !destination || !destination[0])
+ return E_INVALIDARG;
+
return MoveFileW(source, destination) ? S_OK : create_error(GetLastError());
}
diff --git a/dlls/scrrun/tests/filesystem.c b/dlls/scrrun/tests/filesystem.c
index 7a5de4407a8..3ddd782a6fe 100644
--- a/dlls/scrrun/tests/filesystem.c
+++ b/dlls/scrrun/tests/filesystem.c
@@ -2641,7 +2641,7 @@ static void test_MoveFile(void)
static void test_MoveFolder(void)
{
- BSTR src, dst;
+ BSTR src, dst, str, empty;
WCHAR buffW1[MAX_PATH],buffW2[MAX_PATH];
HRESULT hr;
@@ -2656,6 +2656,19 @@ static void test_MoveFolder(void)
SysFreeString(src);
SysFreeString(dst);
ok(RemoveDirectoryW(buffW2), "can't remove %s directory\n", wine_dbgstr_w(buffW2));
+
+ str = SysAllocString(L"null.dir");
+ empty = SysAllocString(L"");
+ hr = IFileSystem3_MoveFolder(fs3, str, NULL);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
+ hr = IFileSystem3_MoveFolder(fs3, NULL, str);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
+ hr = IFileSystem3_MoveFolder(fs3, str, empty);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
+ hr = IFileSystem3_MoveFolder(fs3, empty, str);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
+ SysFreeString(str);
+ SysFreeString(empty);
}
static void test_DoOpenPipeStream(void)
--
2.43.0

View File

@@ -1,35 +0,0 @@
From 8aadb303edcc5b1fc951bbdef62269a1d42ad7aa Mon Sep 17 00:00:00 2001
From: Robert Wilhelm <robert.wilhelm@gmx.net>
Date: Wed, 29 Jun 2022 16:15:47 +0200
Subject: [PATCH] scrrun: Test MoveFolder with already existing destination.
Signed-off-by: Robert Wilhelm <robert.wilhelm@gmx.net>
---
dlls/scrrun/tests/filesystem.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/dlls/scrrun/tests/filesystem.c b/dlls/scrrun/tests/filesystem.c
index 3ddd782a6fe..4305ac394e6 100644
--- a/dlls/scrrun/tests/filesystem.c
+++ b/dlls/scrrun/tests/filesystem.c
@@ -2669,6 +2669,17 @@ static void test_MoveFolder(void)
ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
SysFreeString(str);
SysFreeString(empty);
+
+ ok(CreateDirectoryW(buffW1, NULL), "CreateDirectory(%s) failed\n", wine_dbgstr_w(buffW1));
+ ok(CreateDirectoryW(buffW2, NULL), "CreateDirectory(%s) failed\n", wine_dbgstr_w(buffW2));
+ src = SysAllocString(buffW1);
+ dst = SysAllocString(buffW2);
+ hr = IFileSystem3_MoveFolder(fs3, src, dst); /* dst already exists */
+ ok(hr == CTL_E_FILEALREADYEXISTS, "Unexpected hr %#lx.\n", hr);
+ SysFreeString(src);
+ SysFreeString(dst);
+ ok(RemoveDirectoryW(buffW1), "can't remove %s directory\n", wine_dbgstr_w(buffW1));
+ ok(RemoveDirectoryW(buffW2), "can't remove %s directory\n", wine_dbgstr_w(buffW2));
}
static void test_DoOpenPipeStream(void)
--
2.43.0

View File

@@ -1,66 +0,0 @@
From bbf3d65137f48e763a8a7e4c1eee1dcaed657fd9 Mon Sep 17 00:00:00 2001
From: Robert Wilhelm <robert.wilhelm@gmx.net>
Date: Wed, 29 Jun 2022 16:24:40 +0200
Subject: [PATCH] scrrun: Check for non-existant source in MoveFolder().
Signed-off-by: Robert Wilhelm <robert.wilhelm@gmx.net>
---
dlls/scrrun/filesystem.c | 16 +++++++++++++++-
dlls/scrrun/tests/filesystem.c | 7 +++++++
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c
index a56af2f0461..5c4b13d48b8 100644
--- a/dlls/scrrun/filesystem.c
+++ b/dlls/scrrun/filesystem.c
@@ -3803,6 +3803,20 @@ static HRESULT WINAPI filesys_MoveFile(IFileSystem3 *iface, BSTR source, BSTR de
return MoveFileW(source, destination) ? S_OK : create_error(GetLastError());
}
+static inline HRESULT create_movefolder_error(DWORD err)
+{
+ switch(err) {
+ case ERROR_FILE_NOT_FOUND:
+ case ERROR_PATH_NOT_FOUND: return CTL_E_PATHNOTFOUND;
+ case ERROR_ACCESS_DENIED: return CTL_E_PERMISSIONDENIED;
+ case ERROR_FILE_EXISTS: return CTL_E_FILEALREADYEXISTS;
+ case ERROR_ALREADY_EXISTS: return CTL_E_FILEALREADYEXISTS;
+ default:
+ FIXME("Unsupported error code: %ld\n", err);
+ return E_FAIL;
+ }
+}
+
static HRESULT WINAPI filesys_MoveFolder(IFileSystem3 *iface, BSTR source, BSTR destination)
{
TRACE("%p %s %s\n", iface, debugstr_w(source), debugstr_w(destination));
@@ -3810,7 +3824,7 @@ static HRESULT WINAPI filesys_MoveFolder(IFileSystem3 *iface, BSTR source, BSTR
if(!source || !source[0] || !destination || !destination[0])
return E_INVALIDARG;
- return MoveFileW(source, destination) ? S_OK : create_error(GetLastError());
+ return MoveFileW(source, destination) ? S_OK : create_movefolder_error(GetLastError());
}
static inline HRESULT copy_file(const WCHAR *source, DWORD source_len,
diff --git a/dlls/scrrun/tests/filesystem.c b/dlls/scrrun/tests/filesystem.c
index 4305ac394e6..9b352797073 100644
--- a/dlls/scrrun/tests/filesystem.c
+++ b/dlls/scrrun/tests/filesystem.c
@@ -2680,6 +2680,13 @@ static void test_MoveFolder(void)
SysFreeString(dst);
ok(RemoveDirectoryW(buffW1), "can't remove %s directory\n", wine_dbgstr_w(buffW1));
ok(RemoveDirectoryW(buffW2), "can't remove %s directory\n", wine_dbgstr_w(buffW2));
+
+ src = SysAllocString(buffW1);
+ dst = SysAllocString(buffW2);
+ hr = IFileSystem3_MoveFolder(fs3, src, dst); /* src nonexistant */
+ ok(hr == CTL_E_PATHNOTFOUND, "Unexpected hr %#lx.\n", hr);
+ SysFreeString(src);
+ SysFreeString(dst);
}
static void test_DoOpenPipeStream(void)
--
2.43.0

View File

@@ -1,79 +0,0 @@
From e7ce13576f0ef1b73622a32568fce45eda879613 Mon Sep 17 00:00:00 2001
From: Robert Wilhelm <robert.wilhelm@gmx.net>
Date: Wed, 29 Jun 2022 16:29:55 +0200
Subject: [PATCH] scrrun: Check that source is directory in MoveFolder().
Signed-off-by: Robert Wilhelm <robert.wilhelm@gmx.net>
---
dlls/scrrun/filesystem.c | 10 +++++++++-
dlls/scrrun/tests/filesystem.c | 14 ++++++++++++++
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c
index 5c4b13d48b8..72a15aae545 100644
--- a/dlls/scrrun/filesystem.c
+++ b/dlls/scrrun/filesystem.c
@@ -3806,6 +3806,7 @@ static HRESULT WINAPI filesys_MoveFile(IFileSystem3 *iface, BSTR source, BSTR de
static inline HRESULT create_movefolder_error(DWORD err)
{
switch(err) {
+ case ERROR_INVALID_NAME:
case ERROR_FILE_NOT_FOUND:
case ERROR_PATH_NOT_FOUND: return CTL_E_PATHNOTFOUND;
case ERROR_ACCESS_DENIED: return CTL_E_PERMISSIONDENIED;
@@ -3819,12 +3820,19 @@ static inline HRESULT create_movefolder_error(DWORD err)
static HRESULT WINAPI filesys_MoveFolder(IFileSystem3 *iface, BSTR source, BSTR destination)
{
+ int len;
+ WCHAR src_path[MAX_PATH];
+
TRACE("%p %s %s\n", iface, debugstr_w(source), debugstr_w(destination));
if(!source || !source[0] || !destination || !destination[0])
return E_INVALIDARG;
- return MoveFileW(source, destination) ? S_OK : create_movefolder_error(GetLastError());
+ len = SysStringLen(source);
+ lstrcpyW(src_path, source);
+ if (source[len-1] != '\\' && source[len-1] != '/') wcscat(src_path, L"\\");
+
+ return MoveFileW(src_path, destination) ? S_OK : create_movefolder_error(GetLastError());
}
static inline HRESULT copy_file(const WCHAR *source, DWORD source_len,
diff --git a/dlls/scrrun/tests/filesystem.c b/dlls/scrrun/tests/filesystem.c
index 9b352797073..0236a02aa74 100644
--- a/dlls/scrrun/tests/filesystem.c
+++ b/dlls/scrrun/tests/filesystem.c
@@ -2644,6 +2644,7 @@ static void test_MoveFolder(void)
BSTR src, dst, str, empty;
WCHAR buffW1[MAX_PATH],buffW2[MAX_PATH];
HRESULT hr;
+ HANDLE file;
get_temp_path(L"foo", buffW1);
get_temp_path(L"bar", buffW2);
@@ -2687,6 +2688,19 @@ static void test_MoveFolder(void)
ok(hr == CTL_E_PATHNOTFOUND, "Unexpected hr %#lx.\n", hr);
SysFreeString(src);
SysFreeString(dst);
+
+ file = CreateFileW(buffW1, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
+ FILE_ATTRIBUTE_NORMAL, NULL);
+ ok(file != INVALID_HANDLE_VALUE, "CreateFile failed\n");
+ CloseHandle(file);
+
+ src = SysAllocString(buffW1);
+ dst = SysAllocString(buffW2);
+ hr = IFileSystem3_MoveFolder(fs3, src, dst); /* src is regular file */
+ ok(hr == CTL_E_PATHNOTFOUND, "Unexpected hr %#lx.\n", hr);
+ SysFreeString(src);
+ SysFreeString(dst);
+ DeleteFileW(buffW1);
}
static void test_DoOpenPipeStream(void)
--
2.43.0

View File

@@ -1,111 +0,0 @@
From 30c175a9e90bc7889f97ad54ae82a34a832650dc Mon Sep 17 00:00:00 2001
From: Robert Wilhelm <robert.wilhelm@gmx.net>
Date: Wed, 29 Jun 2022 17:21:10 +0200
Subject: [PATCH] scrrun: Move source dir into destination dir if destination
ends with separator in MoveFolder().
Signed-off-by: Robert Wilhelm <robert.wilhelm@gmx.net>
---
dlls/scrrun/filesystem.c | 22 +++++++++++++++-----
dlls/scrrun/tests/filesystem.c | 38 +++++++++++++++++++++++++++++++++-
2 files changed, 54 insertions(+), 6 deletions(-)
diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c
index 72a15aae545..2c364ec6e08 100644
--- a/dlls/scrrun/filesystem.c
+++ b/dlls/scrrun/filesystem.c
@@ -3820,18 +3820,30 @@ static inline HRESULT create_movefolder_error(DWORD err)
static HRESULT WINAPI filesys_MoveFolder(IFileSystem3 *iface, BSTR source, BSTR destination)
{
- int len;
- WCHAR src_path[MAX_PATH];
+ int src_len, dst_len;
+ WCHAR src_path[MAX_PATH], dst_path[MAX_PATH];
+ WCHAR *filename;
TRACE("%p %s %s\n", iface, debugstr_w(source), debugstr_w(destination));
if(!source || !source[0] || !destination || !destination[0])
return E_INVALIDARG;
- len = SysStringLen(source);
- lstrcpyW(src_path, source);
- if (source[len-1] != '\\' && source[len-1] != '/') wcscat(src_path, L"\\");
+ if (!GetFullPathNameW(source, MAX_PATH, src_path, &filename))
+ return E_FAIL;
+ src_len = SysStringLen(src_path);
+ if (src_path[src_len-1] != '\\' && src_path[src_len-1] != '/')
+ wcscat(src_path, L"\\");
+
+ dst_len = lstrlenW(destination);
+ if (destination[dst_len-1] == '\\' || destination[dst_len-1] == '/') {
+ lstrcpyW(dst_path, destination);
+ lstrcatW(dst_path, filename);
+ TRACE("move %s to %s\n", debugstr_w(src_path), debugstr_w(dst_path));
+ return MoveFileW(src_path, dst_path) ? S_OK : create_movefolder_error(GetLastError());
+ }
+ TRACE("move %s to %s\n", debugstr_w(src_path), debugstr_w(destination));
return MoveFileW(src_path, destination) ? S_OK : create_movefolder_error(GetLastError());
}
diff --git a/dlls/scrrun/tests/filesystem.c b/dlls/scrrun/tests/filesystem.c
index 0236a02aa74..d237e21e9a6 100644
--- a/dlls/scrrun/tests/filesystem.c
+++ b/dlls/scrrun/tests/filesystem.c
@@ -2642,7 +2642,7 @@ static void test_MoveFile(void)
static void test_MoveFolder(void)
{
BSTR src, dst, str, empty;
- WCHAR buffW1[MAX_PATH],buffW2[MAX_PATH];
+ WCHAR buffW1[MAX_PATH],buffW2[MAX_PATH],pathW[MAX_PATH];
HRESULT hr;
HANDLE file;
@@ -2701,6 +2701,42 @@ static void test_MoveFolder(void)
SysFreeString(src);
SysFreeString(dst);
DeleteFileW(buffW1);
+
+ GetTempPathW(MAX_PATH, buffW1);
+ lstrcatW(buffW1,L"foo");
+ GetTempPathW(MAX_PATH, buffW2);
+ lstrcatW(buffW2,L"bar");
+ ok(CreateDirectoryW(buffW1, NULL), "CreateDirectory(%s) failed\n", wine_dbgstr_w(buffW1));
+ ok(CreateDirectoryW(buffW2, NULL), "CreateDirectory(%s) failed\n", wine_dbgstr_w(buffW2));
+ lstrcpyW(pathW,buffW2);
+ lstrcatW(pathW,L"\\");
+ src = SysAllocString(buffW1);
+ dst = SysAllocString(pathW);
+ hr = IFileSystem3_MoveFolder(fs3, src, dst);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ SysFreeString(src);
+ SysFreeString(dst);
+ lstrcatW(pathW,L"foo");
+ ok(RemoveDirectoryW(pathW), "can't remove %s directory\n", wine_dbgstr_w(pathW));
+ ok(RemoveDirectoryW(buffW2), "can't remove %s directory\n", wine_dbgstr_w(buffW2));
+
+ GetTempPathW(MAX_PATH, buffW1);
+ lstrcatW(buffW1,L"foo");
+ GetTempPathW(MAX_PATH, buffW2);
+ lstrcatW(buffW2,L"bar");
+ ok(CreateDirectoryW(buffW1, NULL), "CreateDirectory(%s) failed\n", wine_dbgstr_w(buffW1));
+ ok(CreateDirectoryW(buffW2, NULL), "CreateDirectory(%s) failed\n", wine_dbgstr_w(buffW2));
+ lstrcpyW(pathW,buffW2);
+ lstrcatW(pathW,L"/");
+ src = SysAllocString(buffW1);
+ dst = SysAllocString(pathW);
+ hr = IFileSystem3_MoveFolder(fs3, src, dst);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ SysFreeString(src);
+ SysFreeString(dst);
+ lstrcatW(pathW,L"foo");
+ ok(RemoveDirectoryW(pathW), "can't remove %s directory\n", wine_dbgstr_w(pathW));
+ ok(RemoveDirectoryW(buffW2), "can't remove %s directory\n", wine_dbgstr_w(buffW2));
}
static void test_DoOpenPipeStream(void)
--
2.43.0

View File

@@ -1,131 +0,0 @@
From 870d98b28ca3ff52c21feedfb3b1e5f3d6ade7b9 Mon Sep 17 00:00:00 2001
From: Robert Wilhelm <robert.wilhelm@gmx.net>
Date: Wed, 29 Jun 2022 17:40:58 +0200
Subject: [PATCH] scrrun: Support wildcards in MoveFolder().
Signed-off-by: Robert Wilhelm <robert.wilhelm@gmx.net>
---
dlls/scrrun/filesystem.c | 49 ++++++++++++++++++++++++++--------
dlls/scrrun/tests/filesystem.c | 27 ++++++++++++++++++-
2 files changed, 64 insertions(+), 12 deletions(-)
diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c
index 2c364ec6e08..749a06739c7 100644
--- a/dlls/scrrun/filesystem.c
+++ b/dlls/scrrun/filesystem.c
@@ -3820,9 +3820,12 @@ static inline HRESULT create_movefolder_error(DWORD err)
static HRESULT WINAPI filesys_MoveFolder(IFileSystem3 *iface, BSTR source, BSTR destination)
{
- int src_len, dst_len;
+ int src_len, dst_len, name_len;
WCHAR src_path[MAX_PATH], dst_path[MAX_PATH];
WCHAR *filename;
+ WIN32_FIND_DATAW ffd;
+ HANDLE f;
+ BOOL wildcard = FALSE, separator = FALSE;
TRACE("%p %s %s\n", iface, debugstr_w(source), debugstr_w(destination));
@@ -3832,19 +3835,43 @@ static HRESULT WINAPI filesys_MoveFolder(IFileSystem3 *iface, BSTR source, BSTR
if (!GetFullPathNameW(source, MAX_PATH, src_path, &filename))
return E_FAIL;
- src_len = SysStringLen(src_path);
- if (src_path[src_len-1] != '\\' && src_path[src_len-1] != '/')
- wcscat(src_path, L"\\");
+ if (wcspbrk(filename,L"*?"))
+ wildcard = TRUE;
dst_len = lstrlenW(destination);
- if (destination[dst_len-1] == '\\' || destination[dst_len-1] == '/') {
- lstrcpyW(dst_path, destination);
- lstrcatW(dst_path, filename);
- TRACE("move %s to %s\n", debugstr_w(src_path), debugstr_w(dst_path));
- return MoveFileW(src_path, dst_path) ? S_OK : create_movefolder_error(GetLastError());
+ if (destination[dst_len-1] == '\\' || destination[dst_len-1] == '/')
+ separator = TRUE;
+
+ if (!wildcard && !separator) {
+ src_len = SysStringLen(src_path);
+ if (src_path[src_len-1] != '\\' && src_path[src_len-1] != '/')
+ wcscat(src_path, L"\\");
+ TRACE("move %s to %s\n", debugstr_w(src_path), debugstr_w(destination));
+ return MoveFileW(src_path, destination) ? S_OK : create_movefolder_error(GetLastError());
}
- TRACE("move %s to %s\n", debugstr_w(src_path), debugstr_w(destination));
- return MoveFileW(src_path, destination) ? S_OK : create_movefolder_error(GetLastError());
+
+ memcpy(dst_path, destination, dst_len*sizeof(WCHAR));
+ if (!separator)
+ dst_path[dst_len++] = '\\';
+ src_len = filename - src_path;
+ f = FindFirstFileW(source, &ffd);
+ if(f == INVALID_HANDLE_VALUE)
+ return create_error(GetLastError());
+
+ do {
+ name_len = lstrlenW(ffd.cFileName);
+ if(src_len+name_len+1 >= MAX_PATH || dst_len+name_len+1 >= MAX_PATH) {
+ FindClose(f);
+ return E_FAIL;
+ }
+ memcpy(filename, ffd.cFileName, (name_len+1)*sizeof(WCHAR));
+ memcpy(dst_path + dst_len, ffd.cFileName, (name_len+1)*sizeof(WCHAR));
+ TRACE("move %s to %s\n", debugstr_w(src_path), debugstr_w(dst_path));
+ if (!MoveFileW(src_path, dst_path)) return create_error(GetLastError());
+ } while(FindNextFileW(f, &ffd));
+ FindClose(f);
+
+ return S_OK;
}
static inline HRESULT copy_file(const WCHAR *source, DWORD source_len,
diff --git a/dlls/scrrun/tests/filesystem.c b/dlls/scrrun/tests/filesystem.c
index d237e21e9a6..4f5f1b0a7b8 100644
--- a/dlls/scrrun/tests/filesystem.c
+++ b/dlls/scrrun/tests/filesystem.c
@@ -2642,7 +2642,7 @@ static void test_MoveFile(void)
static void test_MoveFolder(void)
{
BSTR src, dst, str, empty;
- WCHAR buffW1[MAX_PATH],buffW2[MAX_PATH],pathW[MAX_PATH];
+ WCHAR buffW1[MAX_PATH], buffW2[MAX_PATH], pathW[MAX_PATH], srcW[MAX_PATH];
HRESULT hr;
HANDLE file;
@@ -2737,6 +2737,31 @@ static void test_MoveFolder(void)
lstrcatW(pathW,L"foo");
ok(RemoveDirectoryW(pathW), "can't remove %s directory\n", wine_dbgstr_w(pathW));
ok(RemoveDirectoryW(buffW2), "can't remove %s directory\n", wine_dbgstr_w(buffW2));
+
+ GetTempPathW(MAX_PATH, buffW1);
+ lstrcatW(buffW1,L"foo1");
+ GetTempPathW(MAX_PATH, buffW2);
+ lstrcatW(buffW2,L"foo2");
+ GetTempPathW(MAX_PATH, srcW);
+ lstrcatW(srcW,L"foo?");
+ GetTempPathW(MAX_PATH, pathW);
+ lstrcatW(pathW,L"bar");
+ ok(CreateDirectoryW(buffW1, NULL), "CreateDirectory(%s) failed\n", wine_dbgstr_w(buffW1));
+ ok(CreateDirectoryW(buffW2, NULL), "CreateDirectory(%s) failed\n", wine_dbgstr_w(buffW2));
+ ok(CreateDirectoryW(pathW, NULL), "CreateDirectory(%s) failed\n", wine_dbgstr_w(pathW));
+ src = SysAllocString(srcW);
+ dst = SysAllocString(pathW);
+ hr = IFileSystem3_MoveFolder(fs3, src, dst);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ SysFreeString(src);
+ SysFreeString(dst);
+ lstrcpyW(buffW1,pathW);
+ lstrcatW(buffW1,L"\\foo1");
+ lstrcpyW(buffW2,pathW);
+ lstrcatW(buffW2,L"\\foo2");
+ ok(RemoveDirectoryW(buffW1), "can't remove %s directory\n", wine_dbgstr_w(buffW1));
+ ok(RemoveDirectoryW(buffW2), "can't remove %s directory\n", wine_dbgstr_w(buffW2));
+ ok(RemoveDirectoryW(pathW), "can't remove %s directory\n", wine_dbgstr_w(pathW));
}
static void test_DoOpenPipeStream(void)
--
2.43.0

View File

@@ -1,81 +0,0 @@
From 58989b73e856ab5c757991fc61e4690afc70c59d Mon Sep 17 00:00:00 2001
From: Robert Wilhelm <robert.wilhelm@gmx.net>
Date: Mon, 18 Jul 2022 11:53:08 +0200
Subject: [PATCH] scrrun: Move directories only in MoveFolder().
Signed-off-by: Robert Wilhelm <robert.wilhelm@gmx.net>
---
dlls/scrrun/filesystem.c | 8 ++++++--
dlls/scrrun/tests/filesystem.c | 10 +++++++++-
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c
index 749a06739c7..79cd3439ea2 100644
--- a/dlls/scrrun/filesystem.c
+++ b/dlls/scrrun/filesystem.c
@@ -3860,14 +3860,18 @@ static HRESULT WINAPI filesys_MoveFolder(IFileSystem3 *iface, BSTR source, BSTR
do {
name_len = lstrlenW(ffd.cFileName);
- if(src_len+name_len+1 >= MAX_PATH || dst_len+name_len+1 >= MAX_PATH) {
+ if(src_len+name_len+2 >= MAX_PATH || dst_len+name_len+1 >= MAX_PATH) {
FindClose(f);
return E_FAIL;
}
memcpy(filename, ffd.cFileName, (name_len+1)*sizeof(WCHAR));
+ wcscat(filename, L"\\");
memcpy(dst_path + dst_len, ffd.cFileName, (name_len+1)*sizeof(WCHAR));
TRACE("move %s to %s\n", debugstr_w(src_path), debugstr_w(dst_path));
- if (!MoveFileW(src_path, dst_path)) return create_error(GetLastError());
+ if (!MoveFileW(src_path, dst_path)) {
+ if (GetLastError() == ERROR_INVALID_NAME) continue;
+ return create_movefolder_error(GetLastError());
+ }
} while(FindNextFileW(f, &ffd));
FindClose(f);
diff --git a/dlls/scrrun/tests/filesystem.c b/dlls/scrrun/tests/filesystem.c
index 4f5f1b0a7b8..1d6e7da921b 100644
--- a/dlls/scrrun/tests/filesystem.c
+++ b/dlls/scrrun/tests/filesystem.c
@@ -2642,7 +2642,7 @@ static void test_MoveFile(void)
static void test_MoveFolder(void)
{
BSTR src, dst, str, empty;
- WCHAR buffW1[MAX_PATH], buffW2[MAX_PATH], pathW[MAX_PATH], srcW[MAX_PATH];
+ WCHAR buffW1[MAX_PATH], buffW2[MAX_PATH], buffW3[MAX_PATH], pathW[MAX_PATH], srcW[MAX_PATH];
HRESULT hr;
HANDLE file;
@@ -2742,6 +2742,8 @@ static void test_MoveFolder(void)
lstrcatW(buffW1,L"foo1");
GetTempPathW(MAX_PATH, buffW2);
lstrcatW(buffW2,L"foo2");
+ GetTempPathW(MAX_PATH, buffW3);
+ lstrcatW(buffW3,L"foo3");
GetTempPathW(MAX_PATH, srcW);
lstrcatW(srcW,L"foo?");
GetTempPathW(MAX_PATH, pathW);
@@ -2749,6 +2751,11 @@ static void test_MoveFolder(void)
ok(CreateDirectoryW(buffW1, NULL), "CreateDirectory(%s) failed\n", wine_dbgstr_w(buffW1));
ok(CreateDirectoryW(buffW2, NULL), "CreateDirectory(%s) failed\n", wine_dbgstr_w(buffW2));
ok(CreateDirectoryW(pathW, NULL), "CreateDirectory(%s) failed\n", wine_dbgstr_w(pathW));
+ /* create a file, should not be moved by MoveFolder() */
+ file = CreateFileW(buffW3, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
+ FILE_ATTRIBUTE_NORMAL, NULL);
+ ok(file != INVALID_HANDLE_VALUE, "CreateFile failed\n");
+ CloseHandle(file);
src = SysAllocString(srcW);
dst = SysAllocString(pathW);
hr = IFileSystem3_MoveFolder(fs3, src, dst);
@@ -2762,6 +2769,7 @@ static void test_MoveFolder(void)
ok(RemoveDirectoryW(buffW1), "can't remove %s directory\n", wine_dbgstr_w(buffW1));
ok(RemoveDirectoryW(buffW2), "can't remove %s directory\n", wine_dbgstr_w(buffW2));
ok(RemoveDirectoryW(pathW), "can't remove %s directory\n", wine_dbgstr_w(pathW));
+ ok(DeleteFileW(buffW3), "can't remove %s\n", wine_dbgstr_w(buffW3));
}
static void test_DoOpenPipeStream(void)
--
2.43.0

View File

@@ -1,57 +0,0 @@
From c76079238f5cd3d4d2baf2ec037b4af38dcc084c Mon Sep 17 00:00:00 2001
From: Robert Wilhelm <robert.wilhelm@gmx.net>
Date: Tue, 2 Aug 2022 22:19:10 +0200
Subject: [PATCH] scrrun: return path not found error if source ends with path
separator in MoveFolder().
---
dlls/scrrun/filesystem.c | 4 ++++
dlls/scrrun/tests/filesystem.c | 17 +++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c
index 79cd3439ea2..dd1c18ed406 100644
--- a/dlls/scrrun/filesystem.c
+++ b/dlls/scrrun/filesystem.c
@@ -3832,6 +3832,10 @@ static HRESULT WINAPI filesys_MoveFolder(IFileSystem3 *iface, BSTR source, BSTR
if(!source || !source[0] || !destination || !destination[0])
return E_INVALIDARG;
+ src_len = SysStringLen(source);
+ if (source[src_len-1] == '\\' || source[src_len-1] == '/')
+ return CTL_E_PATHNOTFOUND;
+
if (!GetFullPathNameW(source, MAX_PATH, src_path, &filename))
return E_FAIL;
diff --git a/dlls/scrrun/tests/filesystem.c b/dlls/scrrun/tests/filesystem.c
index 1d6e7da921b..a5bc7964f2a 100644
--- a/dlls/scrrun/tests/filesystem.c
+++ b/dlls/scrrun/tests/filesystem.c
@@ -2720,6 +2720,23 @@ static void test_MoveFolder(void)
ok(RemoveDirectoryW(pathW), "can't remove %s directory\n", wine_dbgstr_w(pathW));
ok(RemoveDirectoryW(buffW2), "can't remove %s directory\n", wine_dbgstr_w(buffW2));
+ GetTempPathW(MAX_PATH, buffW1);
+ lstrcatW(buffW1,L"foo");
+ GetTempPathW(MAX_PATH, buffW2);
+ lstrcatW(buffW2,L"bar");
+ ok(CreateDirectoryW(buffW1, NULL), "CreateDirectory(%s) failed\n", wine_dbgstr_w(buffW1));
+ ok(CreateDirectoryW(buffW2, NULL), "CreateDirectory(%s) failed\n", wine_dbgstr_w(buffW2));
+ lstrcpyW(pathW,buffW1);
+ lstrcatW(pathW,L"\\");
+ src = SysAllocString(pathW);
+ dst = SysAllocString(buffW2);
+ hr = IFileSystem3_MoveFolder(fs3, src, dst);
+ ok(hr == CTL_E_PATHNOTFOUND, "Unexpected hr %#lx.\n", hr);
+ SysFreeString(src);
+ SysFreeString(dst);
+ ok(RemoveDirectoryW(buffW1), "can't remove %s directory\n", wine_dbgstr_w(buffW1));
+ ok(RemoveDirectoryW(buffW2), "can't remove %s directory\n", wine_dbgstr_w(buffW2));
+
GetTempPathW(MAX_PATH, buffW1);
lstrcatW(buffW1,L"foo");
GetTempPathW(MAX_PATH, buffW2);
--
2.43.0

View File

@@ -1,79 +0,0 @@
From 435f38808b5812571fa17f1da3f387c52d206b11 Mon Sep 17 00:00:00 2001
From: Robert Wilhelm <robert.wilhelm@gmx.net>
Date: Tue, 2 Aug 2022 22:31:17 +0200
Subject: [PATCH] scrrun: Return path not found error if no folders were moved
in MoveFolder().
---
dlls/scrrun/filesystem.c | 5 +++--
dlls/scrrun/tests/filesystem.c | 28 ++++++++++++++++++++++++++++
2 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c
index dd1c18ed406..af4521898a7 100644
--- a/dlls/scrrun/filesystem.c
+++ b/dlls/scrrun/filesystem.c
@@ -3825,7 +3825,7 @@ static HRESULT WINAPI filesys_MoveFolder(IFileSystem3 *iface, BSTR source, BSTR
WCHAR *filename;
WIN32_FIND_DATAW ffd;
HANDLE f;
- BOOL wildcard = FALSE, separator = FALSE;
+ BOOL wildcard = FALSE, separator = FALSE, success = FALSE;
TRACE("%p %s %s\n", iface, debugstr_w(source), debugstr_w(destination));
@@ -3876,10 +3876,11 @@ static HRESULT WINAPI filesys_MoveFolder(IFileSystem3 *iface, BSTR source, BSTR
if (GetLastError() == ERROR_INVALID_NAME) continue;
return create_movefolder_error(GetLastError());
}
+ success = TRUE;
} while(FindNextFileW(f, &ffd));
FindClose(f);
- return S_OK;
+ return success ? S_OK : CTL_E_PATHNOTFOUND;
}
static inline HRESULT copy_file(const WCHAR *source, DWORD source_len,
diff --git a/dlls/scrrun/tests/filesystem.c b/dlls/scrrun/tests/filesystem.c
index a5bc7964f2a..8cd465f1454 100644
--- a/dlls/scrrun/tests/filesystem.c
+++ b/dlls/scrrun/tests/filesystem.c
@@ -2787,6 +2787,34 @@ static void test_MoveFolder(void)
ok(RemoveDirectoryW(buffW2), "can't remove %s directory\n", wine_dbgstr_w(buffW2));
ok(RemoveDirectoryW(pathW), "can't remove %s directory\n", wine_dbgstr_w(pathW));
ok(DeleteFileW(buffW3), "can't remove %s\n", wine_dbgstr_w(buffW3));
+
+ GetTempPathW(MAX_PATH, buffW1);
+ lstrcatW(buffW1,L"foo1");
+ GetTempPathW(MAX_PATH, buffW2);
+ lstrcatW(buffW2,L"foo2");
+ GetTempPathW(MAX_PATH, srcW);
+ lstrcatW(srcW,L"foo*");
+ GetTempPathW(MAX_PATH, pathW);
+ lstrcatW(pathW,L"bar");
+ ok(CreateDirectoryW(pathW, NULL), "CreateDirectory(%s) failed\n", wine_dbgstr_w(pathW));
+ /* create two files, should not be moved by MoveFolder() */
+ file = CreateFileW(buffW1, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
+ FILE_ATTRIBUTE_NORMAL, NULL);
+ ok(file != INVALID_HANDLE_VALUE, "CreateFile failed\n");
+ CloseHandle(file);
+ file = CreateFileW(buffW2, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
+ FILE_ATTRIBUTE_NORMAL, NULL);
+ ok(file != INVALID_HANDLE_VALUE, "CreateFile failed\n");
+ CloseHandle(file);
+ src = SysAllocString(srcW);
+ dst = SysAllocString(pathW);
+ hr = IFileSystem3_MoveFolder(fs3, src, dst);
+ ok(hr == CTL_E_PATHNOTFOUND, "Unexpected hr %#lx.\n", hr);
+ SysFreeString(src);
+ SysFreeString(dst);
+ ok(RemoveDirectoryW(pathW), "can't remove %s directory\n", wine_dbgstr_w(pathW));
+ ok(DeleteFileW(buffW1), "can't remove %s\n", wine_dbgstr_w(buffW1));
+ ok(DeleteFileW(buffW2), "can't remove %s\n", wine_dbgstr_w(buffW2));
}
static void test_DoOpenPipeStream(void)
--
2.43.0

View File

@@ -1,5 +0,0 @@
Fixes: [52128] scrrun: Implement IFileSystem3 MoveFolder.
# MR: https://gitlab.winehq.org/wine/wine/-/merge_requests/391/commits
# Other Reference
# https://gitlab.winehq.org/wine/wine/-/merge_requests/343

View File

@@ -1 +1 @@
833f57698015a9e0c9d0606d8a99254c36c9b9d8
ff187dc851c1d9f992049688a7e7190b83250ae4