Rebase against b6c7b2d322e0cd61eaeaac0d936dfc78c850f61b

This commit is contained in:
Alistair Leslie-Hughes
2018-06-16 14:02:13 +10:00
parent 03cdc2f2c8
commit 91b1d2470a
8 changed files with 108 additions and 106 deletions

View File

@@ -1,15 +1,15 @@
From eff135f5b221772d7ee3c44bd94c680bb9c8169c Mon Sep 17 00:00:00 2001
From 9189a69282518a2ef8aa1d9923b754b9353ad17a Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Thu, 20 Apr 2017 17:08:11 +0800
Subject: setupapi/tests: Add more tests for SPFILENOTIFY_FILEINCABINET
Subject: [PATCH] setupapi/tests: Add more tests for SPFILENOTIFY_FILEINCABINET
handler.
---
dlls/setupapi/tests/setupcab.c | 50 ++++++++++++++++++++++++++++++++----------
1 file changed, 38 insertions(+), 12 deletions(-)
dlls/setupapi/tests/setupcab.c | 46 ++++++++++++++++++++++++++--------
1 file changed, 36 insertions(+), 10 deletions(-)
diff --git a/dlls/setupapi/tests/setupcab.c b/dlls/setupapi/tests/setupcab.c
index 33daae922b..8fdc3734bd 100644
index bb9add035db..37254aa9621 100644
--- a/dlls/setupapi/tests/setupcab.c
+++ b/dlls/setupapi/tests/setupcab.c
@@ -299,11 +299,17 @@ static void test_invalid_callbackW(void)
@@ -40,7 +40,7 @@ index 33daae922b..8fdc3734bd 100644
- (*file_count)++;
+ ctx->count++;
if (index < sizeof(expected_files)/sizeof(char *))
if (index < ARRAY_SIZE(expected_files))
{
ok(!strcmp(expected_files[index], info->NameInCabinet),
"[%d] Expected file \"%s\", got \"%s\"\n",
@@ -52,7 +52,7 @@ index 33daae922b..8fdc3734bd 100644
index++;
return FILEOP_SKIP;
}
@@ -339,17 +350,19 @@ static void test_simple_enumerationA(void)
@@ -339,16 +350,18 @@ static void test_simple_enumerationA(void)
{
BOOL ret;
char source[MAX_PATH], temp[MAX_PATH];
@@ -69,14 +69,12 @@ index 33daae922b..8fdc3734bd 100644
+ ctx.cabinet = source;
+ ret = SetupIterateCabinetA(source, 0, simple_callbackA, &ctx);
ok(ret == 1, "Expected SetupIterateCabinetA to return 1, got %d\n", ret);
- ok(enum_count == sizeof(expected_files)/sizeof(char *),
- "Unexpectedly enumerated %d files\n", enum_count);
+ ok(ctx.count == sizeof(expected_files)/sizeof(char *),
+ "Unexpectedly enumerated %d files\n", ctx.count);
- ok(enum_count == ARRAY_SIZE(expected_files), "Unexpectedly enumerated %d files\n", enum_count);
+ ok(ctx.count == ARRAY_SIZE(expected_files), "Unexpectedly enumerated %d files\n", ctx.count);
DeleteFileA(source);
}
@@ -359,11 +372,17 @@ static const WCHAR wineW[] = {'w','i','n','e',0};
@@ -358,11 +371,17 @@ static const WCHAR wineW[] = {'w','i','n','e',0};
static const WCHAR shandyW[] = {'s','h','a','n','d','y',0};
static const WCHAR *expected_filesW[] = {tristramW, wineW, shandyW};
@@ -95,7 +93,7 @@ index 33daae922b..8fdc3734bd 100644
switch (Notification)
{
@@ -373,14 +392,19 @@ static UINT CALLBACK simple_callbackW(PVOID Context, UINT Notification,
@@ -372,14 +391,19 @@ static UINT CALLBACK simple_callbackW(PVOID Context, UINT Notification,
case SPFILENOTIFY_FILEINCABINET:
{
FILE_IN_CABINET_INFO_W *info = (FILE_IN_CABINET_INFO_W *)Param1;
@@ -104,7 +102,7 @@ index 33daae922b..8fdc3734bd 100644
- (*file_count)++;
+ ctx->count++;
if (index < sizeof(expected_filesW)/sizeof(WCHAR *))
if (index < ARRAY_SIZE(expected_filesW))
{
ok(!lstrcmpW(expected_filesW[index], info->NameInCabinet),
"[%d] Expected file %s, got %s\n",
@@ -116,7 +114,7 @@ index 33daae922b..8fdc3734bd 100644
index++;
return FILEOP_SKIP;
}
@@ -399,7 +423,7 @@ static void test_simple_enumerationW(void)
@@ -398,7 +422,7 @@ static void test_simple_enumerationW(void)
{
BOOL ret;
WCHAR source[MAX_PATH], temp[MAX_PATH];
@@ -125,7 +123,7 @@ index 33daae922b..8fdc3734bd 100644
ret = SetupIterateCabinetW(NULL, 0, NULL, NULL);
if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
@@ -413,10 +437,12 @@ static void test_simple_enumerationW(void)
@@ -412,9 +436,11 @@ static void test_simple_enumerationW(void)
create_source_fileW(source, comp_cab_zip_multi, sizeof(comp_cab_zip_multi));
@@ -134,13 +132,11 @@ index 33daae922b..8fdc3734bd 100644
+ ctx.cabinet = source;
+ ret = SetupIterateCabinetW(source, 0, simple_callbackW, &ctx);
ok(ret == 1, "Expected SetupIterateCabinetW to return 1, got %d\n", ret);
- ok(enum_count == sizeof(expected_files)/sizeof(WCHAR *),
- "Unexpectedly enumerated %d files\n", enum_count);
+ ok(ctx.count == sizeof(expected_files)/sizeof(WCHAR *),
+ "Unexpectedly enumerated %d files\n", ctx.count);
- ok(enum_count == ARRAY_SIZE(expected_files), "Unexpectedly enumerated %d files\n", enum_count);
+ ok(ctx.count == ARRAY_SIZE(expected_files), "Unexpectedly enumerated %d files\n", ctx.count);
DeleteFileW(source);
}
--
2.12.2
2.17.1

View File

@@ -1,7 +1,8 @@
From 3ddb06dbe75951815a5ca499d1bc2611ca8b5c0e Mon Sep 17 00:00:00 2001
From ff7a8116621fc755b47abcafa4462d01681eb517 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 2 May 2017 00:48:45 +0200
Subject: setupapi: Fix CabinetName passed to SPFILENOTIFY_CABINETINFO handler.
Subject: [PATCH] setupapi: Fix CabinetName passed to SPFILENOTIFY_CABINETINFO
handler.
---
dlls/setupapi/setupcab.c | 5 +++--
@@ -9,7 +10,7 @@ Subject: setupapi: Fix CabinetName passed to SPFILENOTIFY_CABINETINFO handler.
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/dlls/setupapi/setupcab.c b/dlls/setupapi/setupcab.c
index 54c0256ee9..0146e575d4 100644
index 54c0256ee99..0146e575d41 100644
--- a/dlls/setupapi/setupcab.c
+++ b/dlls/setupapi/setupcab.c
@@ -297,7 +297,7 @@ static INT_PTR CDECL sc_FNNOTIFY_A(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION p
@@ -39,7 +40,7 @@ index 54c0256ee9..0146e575d4 100644
if ((len > MAX_PATH) || (len <= 1))
buf[0] = '\0';
diff --git a/dlls/setupapi/tests/setupcab.c b/dlls/setupapi/tests/setupcab.c
index 8fdc3734bd..095107f225 100644
index 37254aa9621..e58d35fd8f0 100644
--- a/dlls/setupapi/tests/setupcab.c
+++ b/dlls/setupapi/tests/setupcab.c
@@ -314,8 +314,15 @@ static UINT CALLBACK simple_callbackA(PVOID Context, UINT Notification,
@@ -58,7 +59,7 @@ index 8fdc3734bd..095107f225 100644
case SPFILENOTIFY_FILEINCABINET:
{
FILE_IN_CABINET_INFO_A *info = (FILE_IN_CABINET_INFO_A *)Param1;
@@ -381,14 +388,22 @@ struct contextW
@@ -380,14 +387,22 @@ struct contextW
static UINT CALLBACK simple_callbackW(PVOID Context, UINT Notification,
UINT_PTR Param1, UINT_PTR Param2)
{
@@ -82,5 +83,5 @@ index 8fdc3734bd..095107f225 100644
{
FILE_IN_CABINET_INFO_W *info = (FILE_IN_CABINET_INFO_W *)Param1;
--
2.12.2
2.17.1

View File

@@ -1,15 +1,15 @@
From 7625977bb8c12499761e268ac4e6ddfc96892c84 Mon Sep 17 00:00:00 2001
From 669f74a3f2426810c296efdd4d38584bdbda7337 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 2 May 2017 01:15:03 +0200
Subject: setupapi/tests: Add tests for cabinet name passed to
Subject: [PATCH] setupapi/tests: Add tests for cabinet name passed to
SPFILENOTIFY_FILEEXTRACTED.
---
dlls/setupapi/tests/setupcab.c | 56 +++++++++++++++++++++++++++++++++++++++---
dlls/setupapi/tests/setupcab.c | 56 +++++++++++++++++++++++++++++++---
1 file changed, 52 insertions(+), 4 deletions(-)
diff --git a/dlls/setupapi/tests/setupcab.c b/dlls/setupapi/tests/setupcab.c
index 095107f225..010c9d559d 100644
index e58d35fd8f0..88516a67b0c 100644
--- a/dlls/setupapi/tests/setupcab.c
+++ b/dlls/setupapi/tests/setupcab.c
@@ -303,6 +303,7 @@ struct contextA
@@ -57,7 +57,7 @@ index 095107f225..010c9d559d 100644
default:
return NO_ERROR;
}
@@ -357,21 +377,25 @@ static void test_simple_enumerationA(void)
@@ -357,20 +377,24 @@ static void test_simple_enumerationA(void)
{
BOOL ret;
char source[MAX_PATH], temp[MAX_PATH];
@@ -75,15 +75,14 @@ index 095107f225..010c9d559d 100644
+ ctx.target = target;
ret = SetupIterateCabinetA(source, 0, simple_callbackA, &ctx);
ok(ret == 1, "Expected SetupIterateCabinetA to return 1, got %d\n", ret);
ok(ctx.count == sizeof(expected_files)/sizeof(char *),
"Unexpectedly enumerated %d files\n", ctx.count);
ok(ctx.count == ARRAY_SIZE(expected_files), "Unexpectedly enumerated %d files\n", ctx.count);
DeleteFileA(source);
+ DeleteFileA(target);
}
static const WCHAR tristramW[] = {'t','r','i','s','t','r','a','m',0};
@@ -383,6 +407,7 @@ struct contextW
@@ -382,6 +406,7 @@ struct contextW
{
int count;
const WCHAR *cabinet;
@@ -91,7 +90,7 @@ index 095107f225..010c9d559d 100644
};
static UINT CALLBACK simple_callbackW(PVOID Context, UINT Notification,
@@ -420,8 +445,9 @@ todo_wine
@@ -419,8 +444,9 @@ todo_wine
ok(!lstrcmpW(ctx->cabinet, cabinet_file),
"[%d] Expected cabinet %s, got %s\n",
index, wine_dbgstr_w(ctx->cabinet), wine_dbgstr_w(cabinet_file));
@@ -103,7 +102,7 @@ index 095107f225..010c9d559d 100644
}
else
{
@@ -429,6 +455,24 @@ todo_wine
@@ -428,6 +454,24 @@ todo_wine
return FILEOP_ABORT;
}
}
@@ -128,7 +127,7 @@ index 095107f225..010c9d559d 100644
default:
return NO_ERROR;
}
@@ -438,6 +482,7 @@ static void test_simple_enumerationW(void)
@@ -437,6 +481,7 @@ static void test_simple_enumerationW(void)
{
BOOL ret;
WCHAR source[MAX_PATH], temp[MAX_PATH];
@@ -136,9 +135,9 @@ index 095107f225..010c9d559d 100644
struct contextW ctx;
ret = SetupIterateCabinetW(NULL, 0, NULL, NULL);
@@ -449,17 +494,20 @@ static void test_simple_enumerationW(void)
@@ -448,16 +493,19 @@ static void test_simple_enumerationW(void)
GetTempPathW(sizeof(temp)/sizeof(WCHAR), temp);
GetTempPathW(ARRAY_SIZE(temp), temp);
GetTempFileNameW(temp, docW, 0, source);
+ GetTempFileNameW(temp, docW, 0, target);
@@ -149,8 +148,7 @@ index 095107f225..010c9d559d 100644
+ ctx.target = target;
ret = SetupIterateCabinetW(source, 0, simple_callbackW, &ctx);
ok(ret == 1, "Expected SetupIterateCabinetW to return 1, got %d\n", ret);
ok(ctx.count == sizeof(expected_files)/sizeof(WCHAR *),
"Unexpectedly enumerated %d files\n", ctx.count);
ok(ctx.count == ARRAY_SIZE(expected_files), "Unexpectedly enumerated %d files\n", ctx.count);
DeleteFileW(source);
+ DeleteFileW(target);
@@ -158,5 +156,5 @@ index 095107f225..010c9d559d 100644
START_TEST(setupcab)
--
2.12.2
2.17.1

View File

@@ -1,7 +1,8 @@
From ed71bc3e8c01828f7b58597d5ea0827e2540f4f0 Mon Sep 17 00:00:00 2001
From 256b83d92adbffe2d928e74b95466fefd7cff60b Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Thu, 20 Apr 2017 17:08:11 +0800
Subject: setupapi: Fix parameters of SPFILENOTIFY_FILEINCABINET handler.
Subject: [PATCH] setupapi: Fix parameters of SPFILENOTIFY_FILEINCABINET
handler.
Bug 42827 references the setup application that depends on this.
---
@@ -10,7 +11,7 @@ Bug 42827 references the setup application that depends on this.
2 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/dlls/setupapi/setupcab.c b/dlls/setupapi/setupcab.c
index 0146e575d4..6a02faa4cb 100644
index 0146e575d41..6a02faa4cb3 100644
--- a/dlls/setupapi/setupcab.c
+++ b/dlls/setupapi/setupcab.c
@@ -323,7 +323,7 @@ static INT_PTR CDECL sc_FNNOTIFY_A(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION p
@@ -67,7 +68,7 @@ index 0146e575d4..6a02faa4cb 100644
TRACE("path: %s, cabfile: %s\n",
debugstr_a(pszCabPath), debugstr_a(pszCabinet));
diff --git a/dlls/setupapi/tests/setupcab.c b/dlls/setupapi/tests/setupcab.c
index 010c9d559d..f2528865aa 100644
index 88516a67b0c..2e776e66879 100644
--- a/dlls/setupapi/tests/setupcab.c
+++ b/dlls/setupapi/tests/setupcab.c
@@ -336,7 +336,6 @@ static UINT CALLBACK simple_callbackA(PVOID Context, UINT Notification,
@@ -86,7 +87,7 @@ index 010c9d559d..f2528865aa 100644
ok(!strcmp(ctx->cabinet, info->Source),
"[%d] Expected cabinet \"%s\", got \"%s\"\n",
index, ctx->cabinet, info->Source);
@@ -441,7 +439,6 @@ static UINT CALLBACK simple_callbackW(PVOID Context, UINT Notification,
@@ -440,7 +438,6 @@ static UINT CALLBACK simple_callbackW(PVOID Context, UINT Notification,
ok(!lstrcmpW(expected_filesW[index], info->NameInCabinet),
"[%d] Expected file %s, got %s\n",
index, wine_dbgstr_w(expected_filesW[index]), wine_dbgstr_w(info->NameInCabinet));
@@ -94,7 +95,7 @@ index 010c9d559d..f2528865aa 100644
ok(!lstrcmpW(ctx->cabinet, cabinet_file),
"[%d] Expected cabinet %s, got %s\n",
index, wine_dbgstr_w(ctx->cabinet), wine_dbgstr_w(cabinet_file));
@@ -459,7 +456,6 @@ todo_wine
@@ -458,7 +455,6 @@ todo_wine
{
FILEPATHS_W *info = (FILEPATHS_W *)Param1;
@@ -103,5 +104,5 @@ index 010c9d559d..f2528865aa 100644
"[%d] Expected cabinet %s, got %s\n",
index, wine_dbgstr_w(ctx->cabinet), wine_dbgstr_w(info->Source));
--
2.12.2
2.17.1