setupapi-SPFILENOTIFY_FILEINCABINET: Remove patch set.

This is fixed upstream now.
This commit is contained in:
Zebediah Figura 2021-03-09 17:07:04 -06:00
parent e7c08665ab
commit 3790a70510
5 changed files with 0 additions and 500 deletions

View File

@ -1,142 +0,0 @@
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: [PATCH] setupapi/tests: Add more tests for SPFILENOTIFY_FILEINCABINET
handler.
---
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 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)
static const char *expected_files[] = {"tristram", "wine", "shandy"};
+struct contextA
+{
+ int count;
+ const char *cabinet;
+};
+
static UINT CALLBACK simple_callbackA(PVOID Context, UINT Notification,
UINT_PTR Param1, UINT_PTR Param2)
{
static int index;
- int *file_count = Context;
+ struct contextA *ctx = Context;
switch (Notification)
{
@@ -313,14 +319,19 @@ static UINT CALLBACK simple_callbackA(PVOID Context, UINT Notification,
case SPFILENOTIFY_FILEINCABINET:
{
FILE_IN_CABINET_INFO_A *info = (FILE_IN_CABINET_INFO_A *)Param1;
+ const char *cabinet_file = (const char *)Param2;
- (*file_count)++;
+ ctx->count++;
if (index < ARRAY_SIZE(expected_files))
{
ok(!strcmp(expected_files[index], info->NameInCabinet),
"[%d] Expected file \"%s\", got \"%s\"\n",
index, expected_files[index], info->NameInCabinet);
+todo_wine
+ ok(!strcmp(ctx->cabinet, cabinet_file),
+ "[%d] Expected cabinet \"%s\", got \"%s\"\n",
+ index, ctx->cabinet, cabinet_file);
index++;
return FILEOP_SKIP;
}
@@ -339,16 +350,18 @@ static void test_simple_enumerationA(void)
{
BOOL ret;
char source[MAX_PATH], temp[MAX_PATH];
- int enum_count = 0;
+ struct contextA ctx;
GetTempPathA(sizeof(temp), temp);
GetTempFileNameA(temp, "doc", 0, source);
create_source_fileA(source, comp_cab_zip_multi, sizeof(comp_cab_zip_multi));
- ret = SetupIterateCabinetA(source, 0, simple_callbackA, &enum_count);
+ ctx.count = 0;
+ 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 == 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);
}
@@ -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};
+struct contextW
+{
+ int count;
+ const WCHAR *cabinet;
+};
+
static UINT CALLBACK simple_callbackW(PVOID Context, UINT Notification,
UINT_PTR Param1, UINT_PTR Param2)
{
static int index;
- int *file_count = Context;
+ struct contextW *ctx = Context;
switch (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;
+ const WCHAR *cabinet_file = (const WCHAR *)Param2;
- (*file_count)++;
+ ctx->count++;
if (index < ARRAY_SIZE(expected_filesW))
{
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));
+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));
index++;
return FILEOP_SKIP;
}
@@ -398,7 +422,7 @@ static void test_simple_enumerationW(void)
{
BOOL ret;
WCHAR source[MAX_PATH], temp[MAX_PATH];
- int enum_count = 0;
+ struct contextW ctx;
ret = SetupIterateCabinetW(NULL, 0, NULL, NULL);
if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
@@ -412,9 +436,11 @@ static void test_simple_enumerationW(void)
create_source_fileW(source, comp_cab_zip_multi, sizeof(comp_cab_zip_multi));
- ret = SetupIterateCabinetW(source, 0, simple_callbackW, &enum_count);
+ ctx.count = 0;
+ 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 == 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.17.1

View File

@ -1,87 +0,0 @@
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: [PATCH] setupapi: Fix CabinetName passed to SPFILENOTIFY_CABINETINFO
handler.
---
dlls/setupapi/setupcab.c | 5 +++--
dlls/setupapi/tests/setupcab.c | 15 +++++++++++++++
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/dlls/setupapi/setupcab.c b/dlls/setupapi/setupcab.c
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
TRACE(" Cabinet Set#: %d\n", pfdin->setID);
TRACE(" Cabinet Cab#: %d\n", pfdin->iCabinet); */
WARN("SPFILENOTIFY_CABINETINFO undocumented: guess implementation.\n");
- ci.CabinetFile = phsc->most_recent_cabinet_name;
+ ci.CabinetFile = "";
ci.CabinetPath = pfdin->psz3;
ci.DiskName = pfdin->psz2;
ci.SetId = pfdin->setID;
@@ -389,6 +389,7 @@ static INT_PTR CDECL sc_FNNOTIFY_A(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION p
static INT_PTR CDECL sc_FNNOTIFY_W(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
{
+ static const WCHAR emptyW[] = {0};
FILE_IN_CABINET_INFO_W fici;
PSC_HSC_W phsc;
CABINET_INFO_W ci;
@@ -423,7 +424,7 @@ static INT_PTR CDECL sc_FNNOTIFY_W(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION p
TRACE(" Cabinet Set#: %d\n", pfdin->setID);
TRACE(" Cabinet Cab#: %d\n", pfdin->iCabinet); */
WARN("SPFILENOTIFY_CABINETINFO undocumented: guess implementation.\n");
- ci.CabinetFile = phsc->most_recent_cabinet_name;
+ ci.CabinetFile = emptyW;
len = 1 + MultiByteToWideChar(CP_ACP, 0, pfdin->psz3, -1, buf, MAX_PATH);
if ((len > MAX_PATH) || (len <= 1))
buf[0] = '\0';
diff --git a/dlls/setupapi/tests/setupcab.c b/dlls/setupapi/tests/setupcab.c
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,
switch (Notification)
{
case SPFILENOTIFY_CABINETINFO:
+ {
+ CABINET_INFO_A *info = (CABINET_INFO_A *)Param1;
+
+ ok(!strcmp(info->CabinetFile, ""),
+ "Expected empty CabinetFile, got \"%s\"\n", info->CabinetFile);
+
index = 0;
return NO_ERROR;
+ }
case SPFILENOTIFY_FILEINCABINET:
{
FILE_IN_CABINET_INFO_A *info = (FILE_IN_CABINET_INFO_A *)Param1;
@@ -380,14 +387,22 @@ struct contextW
static UINT CALLBACK simple_callbackW(PVOID Context, UINT Notification,
UINT_PTR Param1, UINT_PTR Param2)
{
+ static const WCHAR emptyW[] = {0};
static int index;
struct contextW *ctx = Context;
switch (Notification)
{
case SPFILENOTIFY_CABINETINFO:
+ {
+ CABINET_INFO_W *info = (CABINET_INFO_W *)Param1;
+
+ ok(!lstrcmpW(info->CabinetFile, emptyW),
+ "Expected empty CabinetFile, got %s\n", wine_dbgstr_w(info->CabinetFile));
+
index = 0;
return NO_ERROR;
+ }
case SPFILENOTIFY_FILEINCABINET:
{
FILE_IN_CABINET_INFO_W *info = (FILE_IN_CABINET_INFO_W *)Param1;
--
2.17.1

View File

@ -1,160 +0,0 @@
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: [PATCH] setupapi/tests: Add tests for cabinet name passed to
SPFILENOTIFY_FILEEXTRACTED.
---
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 e58d35fd8f0..88516a67b0c 100644
--- a/dlls/setupapi/tests/setupcab.c
+++ b/dlls/setupapi/tests/setupcab.c
@@ -303,6 +303,7 @@ struct contextA
{
int count;
const char *cabinet;
+ const char *target;
};
static UINT CALLBACK simple_callbackA(PVOID Context, UINT Notification,
@@ -339,8 +340,9 @@ todo_wine
ok(!strcmp(ctx->cabinet, cabinet_file),
"[%d] Expected cabinet \"%s\", got \"%s\"\n",
index, ctx->cabinet, cabinet_file);
- index++;
- return FILEOP_SKIP;
+
+ strcpy(info->FullTargetName, ctx->target);
+ return FILEOP_DOIT;
}
else
{
@@ -348,6 +350,24 @@ todo_wine
return FILEOP_ABORT;
}
}
+ case SPFILENOTIFY_FILEEXTRACTED:
+ {
+ FILEPATHS_A *info = (FILEPATHS_A *)Param1;
+
+todo_wine
+ ok(!strcmp(ctx->cabinet, info->Source),
+ "[%d] Expected cabinet \"%s\", got \"%s\"\n",
+ index, ctx->cabinet, info->Source);
+ ok(!strcmp(ctx->target, info->Target),
+ "[%d] Expected target \"%s\", got \"%s\"\n",
+ index, ctx->target, info->Target);
+ ok(info->Win32Error == 0,
+ "[%d] Expected Win32Error 0, got %u\n",
+ index, info->Win32Error);
+
+ index++;
+ return NO_ERROR;
+ }
default:
return NO_ERROR;
}
@@ -357,20 +377,24 @@ static void test_simple_enumerationA(void)
{
BOOL ret;
char source[MAX_PATH], temp[MAX_PATH];
+ char target[MAX_PATH];
struct contextA ctx;
GetTempPathA(sizeof(temp), temp);
GetTempFileNameA(temp, "doc", 0, source);
+ GetTempFileNameA(temp, "doc", 0, target);
create_source_fileA(source, comp_cab_zip_multi, sizeof(comp_cab_zip_multi));
ctx.count = 0;
ctx.cabinet = source;
+ 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 == 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};
@@ -382,6 +406,7 @@ struct contextW
{
int count;
const WCHAR *cabinet;
+ const WCHAR *target;
};
static UINT CALLBACK simple_callbackW(PVOID Context, UINT Notification,
@@ -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));
- index++;
- return FILEOP_SKIP;
+
+ lstrcpyW(info->FullTargetName, ctx->target);
+ return FILEOP_DOIT;
}
else
{
@@ -428,6 +454,24 @@ todo_wine
return FILEOP_ABORT;
}
}
+ case SPFILENOTIFY_FILEEXTRACTED:
+ {
+ FILEPATHS_W *info = (FILEPATHS_W *)Param1;
+
+todo_wine
+ ok(!lstrcmpW(ctx->cabinet, info->Source),
+ "[%d] Expected cabinet %s, got %s\n",
+ index, wine_dbgstr_w(ctx->cabinet), wine_dbgstr_w(info->Source));
+ ok(!lstrcmpW(ctx->target, info->Target),
+ "[%d] Expected target %s, got %s\n",
+ index, wine_dbgstr_w(ctx->target), wine_dbgstr_w(info->Target));
+ ok(info->Win32Error == 0,
+ "[%d] Expected Win32Error 0, got %u\n",
+ index, info->Win32Error);
+
+ index++;
+ return NO_ERROR;
+ }
default:
return NO_ERROR;
}
@@ -437,6 +481,7 @@ static void test_simple_enumerationW(void)
{
BOOL ret;
WCHAR source[MAX_PATH], temp[MAX_PATH];
+ WCHAR target[MAX_PATH];
struct contextW ctx;
ret = SetupIterateCabinetW(NULL, 0, NULL, NULL);
@@ -448,16 +493,19 @@ static void test_simple_enumerationW(void)
GetTempPathW(ARRAY_SIZE(temp), temp);
GetTempFileNameW(temp, docW, 0, source);
+ GetTempFileNameW(temp, docW, 0, target);
create_source_fileW(source, comp_cab_zip_multi, sizeof(comp_cab_zip_multi));
ctx.count = 0;
ctx.cabinet = source;
+ 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 == ARRAY_SIZE(expected_files), "Unexpectedly enumerated %d files\n", ctx.count);
DeleteFileW(source);
+ DeleteFileW(target);
}
START_TEST(setupcab)
--
2.17.1

View File

@ -1,108 +0,0 @@
From 5be18984e1d53bb3ca5871a535a5999ec9a1b3b4 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Thu, 20 Apr 2017 17:08:11 +0800
Subject: [PATCH] setupapi: Fix parameters of SPFILENOTIFY_FILEINCABINET
handler.
Bug 42827 references the setup application that depends on this.
---
dlls/setupapi/setupcab.c | 17 ++++++++---------
dlls/setupapi/tests/setupcab.c | 4 ----
2 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/dlls/setupapi/setupcab.c b/dlls/setupapi/setupcab.c
index 0581d5f6828..e6b4a36a4ab 100644
--- a/dlls/setupapi/setupcab.c
+++ b/dlls/setupapi/setupcab.c
@@ -322,7 +322,7 @@ static INT_PTR CDECL sc_FNNOTIFY_A(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION p
fici.DosAttribs = pfdin->attribs;
memset(fici.FullTargetName, 0, MAX_PATH);
err = phsc->msghandler(phsc->context, SPFILENOTIFY_FILEINCABINET,
- (UINT_PTR)&fici, (UINT_PTR)pfdin->psz1);
+ (UINT_PTR)&fici, (UINT_PTR)phsc->most_recent_cabinet_name);
if (err == FILEOP_DOIT) {
TRACE(" Callback specified filename: %s\n", debugstr_a(fici.FullTargetName));
if (!fici.FullTargetName[0]) {
@@ -458,7 +458,7 @@ static INT_PTR CDECL sc_FNNOTIFY_W(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION p
fici.DosAttribs = pfdin->attribs;
memset(fici.FullTargetName, 0, MAX_PATH * sizeof(WCHAR));
err = phsc->msghandler(phsc->context, SPFILENOTIFY_FILEINCABINET,
- (UINT_PTR)&fici, (UINT_PTR)pfdin->psz1);
+ (UINT_PTR)&fici, (UINT_PTR)phsc->most_recent_cabinet_name);
if (err == FILEOP_DOIT) {
TRACE(" Callback specified filename: %s\n", debugstr_w(fici.FullTargetName));
if (fici.FullTargetName[0]) {
@@ -586,8 +586,8 @@ BOOL WINAPI SetupIterateCabinetA(PCSTR CabinetFile, DWORD Reserved,
TRACE("path: %s, cabfile: %s\n", debugstr_a(pszCabPath), debugstr_a(pszCabinet));
- /* remember the cabinet name */
- strcpy(my_hsc.most_recent_cabinet_name, pszCabinet);
+ /* remember original cabinet name */
+ strcpy(my_hsc.most_recent_cabinet_name, CabinetFile);
my_hsc.magic = SC_HSC_A_MAGIC;
my_hsc.msghandler = MsgHandler;
@@ -637,19 +637,18 @@ BOOL WINAPI SetupIterateCabinetW(PCWSTR CabinetFile, DWORD Reserved,
}
if (p) {
- lstrcpyW(my_hsc.most_recent_cabinet_name, p);
+ WideCharToMultiByte(CP_ACP, 0, p, -1, pszCabinet, MAX_PATH, 0, 0);
*p = 0;
len = WideCharToMultiByte(CP_ACP, 0, pszCabPathW, -1, pszCabPath,
MAX_PATH, 0, 0);
if (!len) return FALSE;
} else {
- lstrcpyW(my_hsc.most_recent_cabinet_name, CabinetFile);
+ WideCharToMultiByte(CP_ACP, 0, CabinetFile, -1, pszCabinet, MAX_PATH, 0, 0);
pszCabPath[0] = '\0';
}
- len = WideCharToMultiByte(CP_ACP, 0, my_hsc.most_recent_cabinet_name, -1,
- pszCabinet, MAX_PATH, 0, 0);
- if (!len) return FALSE;
+ /* remember original cabinet name */
+ lstrcpyW(my_hsc.most_recent_cabinet_name, CabinetFile);
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 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,
ok(!strcmp(expected_files[index], info->NameInCabinet),
"[%d] Expected file \"%s\", got \"%s\"\n",
index, expected_files[index], info->NameInCabinet);
-todo_wine
ok(!strcmp(ctx->cabinet, cabinet_file),
"[%d] Expected cabinet \"%s\", got \"%s\"\n",
index, ctx->cabinet, cabinet_file);
@@ -354,7 +353,6 @@ todo_wine
{
FILEPATHS_A *info = (FILEPATHS_A *)Param1;
-todo_wine
ok(!strcmp(ctx->cabinet, info->Source),
"[%d] Expected cabinet \"%s\", got \"%s\"\n",
index, ctx->cabinet, info->Source);
@@ -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));
-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));
@@ -458,7 +455,6 @@ todo_wine
{
FILEPATHS_W *info = (FILEPATHS_W *)Param1;
-todo_wine
ok(!lstrcmpW(ctx->cabinet, info->Source),
"[%d] Expected cabinet %s, got %s\n",
index, wine_dbgstr_w(ctx->cabinet), wine_dbgstr_w(info->Source));
--
2.20.1

View File

@ -1,3 +0,0 @@
Fixes: [42827] Fix Param2 in SPFILENOTIFY_FILEINCABINET handler
# I have patches locally to upstream/replace this.
Disabled: true