Partially based on a patch by Sebastian Lackner.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/setupapi/tests/setupcab.c | 231 ++++++++++++++++++++++++--------- 1 file changed, 169 insertions(+), 62 deletions(-)
diff --git a/dlls/setupapi/tests/setupcab.c b/dlls/setupapi/tests/setupcab.c index bb9add035db..6ead90206f8 100644 --- a/dlls/setupapi/tests/setupcab.c +++ b/dlls/setupapi/tests/setupcab.c @@ -297,108 +297,206 @@ static void test_invalid_callbackW(void) DeleteFileW(source); }
-static const char *expected_files[] = {"tristram", "wine", "shandy"}; +static const struct +{ + const char *nameA; + const WCHAR *nameW; + DWORD size; +} +expected_files[] = +{ + {"tristram", L"tristram", 10}, + {"wine", L"wine", 14}, + {"shandy", L"shandy", 8}, +};
-static UINT CALLBACK simple_callbackA(PVOID Context, UINT Notification, - UINT_PTR Param1, UINT_PTR Param2) +static UINT CALLBACK simple_callbackA(void *context, UINT message, UINT_PTR param1, UINT_PTR param2) { static int index; - int *file_count = Context; + int *file_count = context;
- switch (Notification) + switch (message) { case SPFILENOTIFY_CABINETINFO: - index = 0; - return NO_ERROR; + { + const CABINET_INFO_A *info = (const CABINET_INFO_A *)param1; + char temp[MAX_PATH]; + + GetTempPathA(ARRAY_SIZE(temp), temp); + ok(!strcmp(info->CabinetPath, temp), "Got path %s.\n", debugstr_a(info->CabinetPath)); + todo_wine ok(!info->CabinetFile[0], "Got file %s.\n", debugstr_a(info->CabinetFile)); + ok(!info->DiskName[0], "Got disk name %s.\n", debugstr_a(info->DiskName)); + ok(!info->SetId, "Got set ID %#x.\n", info->SetId); + ok(!info->CabinetNumber, "Got cabinet number %u.\n", info->CabinetNumber); + ok(!param2, "Got param2 %#Ix.\n", param2); + return ERROR_SUCCESS; + } + case SPFILENOTIFY_FILEINCABINET: { - FILE_IN_CABINET_INFO_A *info = (FILE_IN_CABINET_INFO_A *)Param1; + FILE_IN_CABINET_INFO_A *info = (FILE_IN_CABINET_INFO_A *)param1; + char temp[MAX_PATH], path[MAX_PATH];
(*file_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); - index++; - return FILEOP_SKIP; - } - else - { - ok(0, "Unexpectedly enumerated more than number of files in cabinet, index = %d\n", index); - return FILEOP_ABORT; - } + ok(index < ARRAY_SIZE(expected_files), "%u: Got unexpected file.\n", index); + ok(!strcmp(info->NameInCabinet, expected_files[index].nameA), + "%u: Got file name %s.\n", index, debugstr_a(info->NameInCabinet)); + ok(info->FileSize == expected_files[index].size, "%u: Got file size %u.\n", index, info->FileSize); + ok(!info->Win32Error, "%u: Got error %u.\n", index, info->Win32Error); + ok(info->DosDate == 14545, "%u: Got date %u.\n", index, info->DosDate); + ok(info->DosTime == 18672, "%u: Got time %u.\n", index, info->DosTime); + ok(info->DosAttribs == FILE_ATTRIBUTE_ARCHIVE, "%u: Got attributes %#x.\n", index, info->DosAttribs); + + GetTempPathA(ARRAY_SIZE(temp), temp); + snprintf(path, ARRAY_SIZE(path), "%s/./testcab.cab", temp); + todo_wine ok(!strcmp((const char *)param2, path), "%u: Got file name %s.\n", + index, debugstr_a((const char *)param2)); + + snprintf(info->FullTargetName, ARRAY_SIZE(info->FullTargetName), + "%s\%s", temp, expected_files[index].nameA); + + return FILEOP_DOIT; + } + + case SPFILENOTIFY_FILEEXTRACTED: + { + const FILEPATHS_A *info = (const FILEPATHS_A *)param1; + char temp[MAX_PATH], path[MAX_PATH]; + + GetTempPathA(ARRAY_SIZE(temp), temp); + ok(index < ARRAY_SIZE(expected_files), "%u: Got unexpected file.\n", index); + snprintf(path, ARRAY_SIZE(path), "%s/./testcab.cab", temp); + todo_wine ok(!strcmp(info->Source, path), "%u: Got source %s.\n", index, debugstr_a(info->Source)); + snprintf(path, ARRAY_SIZE(path), "%s\%s", temp, expected_files[index].nameA); + ok(!strcmp(info->Target, path), "%u: Got target %s.\n", index, debugstr_a(info->Target)); + ok(!info->Win32Error, "%u: Got error %u.\n", index, info->Win32Error); + /* info->Flags seems to contain garbage. */ + + ok(!param2, "Got param2 %#Ix.\n", param2); + ++index; + return ERROR_SUCCESS; } + default: - return NO_ERROR; + ok(0, "Unexpected message %#x.\n", message); + return ERROR_CALL_NOT_IMPLEMENTED; } }
static void test_simple_enumerationA(void) { BOOL ret; - char source[MAX_PATH], temp[MAX_PATH]; - int enum_count = 0; + char temp[MAX_PATH], path[MAX_PATH]; + unsigned int enum_count = 0, i;
- GetTempPathA(sizeof(temp), temp); - GetTempFileNameA(temp, "doc", 0, source); + ret = SetupIterateCabinetA(NULL, 0, NULL, NULL); + if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) + { + win_skip("SetupIterateCabinetW is not available\n"); + return; + }
- create_source_fileA(source, comp_cab_zip_multi, sizeof(comp_cab_zip_multi)); + GetTempPathA(ARRAY_SIZE(temp), temp); + snprintf(path, ARRAY_SIZE(path), "%s/./testcab.cab", temp); + + create_source_fileA(path, comp_cab_zip_multi, sizeof(comp_cab_zip_multi));
- ret = SetupIterateCabinetA(source, 0, simple_callbackA, &enum_count); - ok(ret == 1, "Expected SetupIterateCabinetA to return 1, got %d\n", ret); + ret = SetupIterateCabinetA(path, 0, simple_callbackA, &enum_count); + 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);
- DeleteFileA(source); -} + for (i = 0; i < ARRAY_SIZE(expected_files); ++i) + { + snprintf(path, ARRAY_SIZE(path), "%s\%s", temp, expected_files[i].nameA); + ret = DeleteFileA(path); + ok(ret, "Failed to delete %s, error %u.\n", debugstr_a(path), GetLastError()); + }
-static const WCHAR tristramW[] = {'t','r','i','s','t','r','a','m',0}; -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}; + snprintf(path, ARRAY_SIZE(path), "%s\testcab.cab", temp); + ret = DeleteFileA(path); + ok(ret, "Failed to delete %s, error %u.\n", debugstr_a(path), GetLastError()); +}
-static UINT CALLBACK simple_callbackW(PVOID Context, UINT Notification, - UINT_PTR Param1, UINT_PTR Param2) +static UINT CALLBACK simple_callbackW(void *context, UINT message, UINT_PTR param1, UINT_PTR param2) { static int index; - int *file_count = Context; + int *file_count = context;
- switch (Notification) + switch (message) { case SPFILENOTIFY_CABINETINFO: - index = 0; - return NO_ERROR; + { + const CABINET_INFO_W *info = (const CABINET_INFO_W *)param1; + WCHAR temp[MAX_PATH]; + + GetTempPathW(ARRAY_SIZE(temp), temp); + ok(!wcscmp(info->CabinetPath, temp), "Got path %s.\n", debugstr_w(info->CabinetPath)); + todo_wine ok(!info->CabinetFile[0], "Got file %s.\n", debugstr_w(info->CabinetFile)); + ok(!info->DiskName[0], "Got disk name %s.\n", debugstr_w(info->DiskName)); + ok(!info->SetId, "Got set ID %#x.\n", info->SetId); + ok(!info->CabinetNumber, "Got cabinet number %u.\n", info->CabinetNumber); + ok(!param2, "Got param2 %#Ix.\n", param2); + return ERROR_SUCCESS; + } + case SPFILENOTIFY_FILEINCABINET: { - FILE_IN_CABINET_INFO_W *info = (FILE_IN_CABINET_INFO_W *)Param1; + FILE_IN_CABINET_INFO_W *info = (FILE_IN_CABINET_INFO_W *)param1; + WCHAR temp[MAX_PATH], path[MAX_PATH];
(*file_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)); - index++; - return FILEOP_SKIP; - } - else - { - ok(0, "Unexpectedly enumerated more than number of files in cabinet, index = %d\n", index); - return FILEOP_ABORT; - } + ok(index < ARRAY_SIZE(expected_files), "%u: Got unexpected file.\n", index); + ok(!wcscmp(info->NameInCabinet, expected_files[index].nameW), + "%u: Got file name %s.\n", index, debugstr_w(info->NameInCabinet)); + ok(info->FileSize == expected_files[index].size, "%u: Got file size %u.\n", index, info->FileSize); + ok(!info->Win32Error, "%u: Got error %u.\n", index, info->Win32Error); + ok(info->DosDate == 14545, "%u: Got date %u.\n", index, info->DosDate); + ok(info->DosTime == 18672, "%u: Got time %u.\n", index, info->DosTime); + ok(info->DosAttribs == FILE_ATTRIBUTE_ARCHIVE, "%u: Got attributes %#x.\n", index, info->DosAttribs); + + GetTempPathW(ARRAY_SIZE(temp), temp); + swprintf(path, ARRAY_SIZE(path), L"%s/./testcab.cab", temp); + todo_wine ok(!wcscmp((const WCHAR *)param2, path), "%u: Got file name %s.\n", + index, debugstr_w((const WCHAR *)param2)); + + swprintf(info->FullTargetName, ARRAY_SIZE(info->FullTargetName), + L"%s\%s", temp, expected_files[index].nameW); + + return FILEOP_DOIT; } + + case SPFILENOTIFY_FILEEXTRACTED: + { + const FILEPATHS_W *info = (const FILEPATHS_W *)param1; + WCHAR temp[MAX_PATH], path[MAX_PATH]; + + GetTempPathW(ARRAY_SIZE(temp), temp); + ok(index < ARRAY_SIZE(expected_files), "%u: Got unexpected file.\n", index); + swprintf(path, ARRAY_SIZE(path), L"%s/./testcab.cab", temp); + todo_wine ok(!wcscmp(info->Source, path), "%u: Got source %s.\n", index, debugstr_w(info->Source)); + swprintf(path, ARRAY_SIZE(path), L"%s\%s", temp, expected_files[index].nameW); + ok(!wcscmp(info->Target, path), "%u: Got target %s.\n", index, debugstr_w(info->Target)); + ok(!info->Win32Error, "%u: Got error %u.\n", index, info->Win32Error); + /* info->Flags seems to contain garbage. */ + + ok(!param2, "Got param2 %#Ix.\n", param2); + ++index; + return ERROR_SUCCESS; + } + default: - return NO_ERROR; + ok(0, "Unexpected message %#x.\n", message); + return ERROR_CALL_NOT_IMPLEMENTED; } }
static void test_simple_enumerationW(void) { BOOL ret; - WCHAR source[MAX_PATH], temp[MAX_PATH]; - int enum_count = 0; + WCHAR temp[MAX_PATH], path[MAX_PATH]; + unsigned int enum_count = 0, i;
ret = SetupIterateCabinetW(NULL, 0, NULL, NULL); if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) @@ -408,15 +506,24 @@ static void test_simple_enumerationW(void) }
GetTempPathW(ARRAY_SIZE(temp), temp); - GetTempFileNameW(temp, docW, 0, source); + swprintf(path, ARRAY_SIZE(path), L"%s/./testcab.cab", temp);
- create_source_fileW(source, comp_cab_zip_multi, sizeof(comp_cab_zip_multi)); + create_source_fileW(path, comp_cab_zip_multi, sizeof(comp_cab_zip_multi));
- ret = SetupIterateCabinetW(source, 0, simple_callbackW, &enum_count); + ret = SetupIterateCabinetW(path, 0, simple_callbackW, &enum_count); 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);
- DeleteFileW(source); + for (i = 0; i < ARRAY_SIZE(expected_files); ++i) + { + swprintf(path, ARRAY_SIZE(path), L"%s\%s", temp, expected_files[i].nameW); + ret = DeleteFileW(path); + ok(ret, "Failed to delete %s, error %u.\n", debugstr_w(path), GetLastError()); + } + + swprintf(path, ARRAY_SIZE(path), L"%s\testcab.cab", temp); + ret = DeleteFileW(path); + ok(ret, "Failed to delete %s, error %u.\n", debugstr_w(path), GetLastError()); }
START_TEST(setupcab)
Verified through manual testing.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/setupapi/setupcab.c | 6 +++--- dlls/setupapi/tests/setupcab.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/setupapi/setupcab.c b/dlls/setupapi/setupcab.c index 4824170d587..daf23ad31ad 100644 --- a/dlls/setupapi/setupcab.c +++ b/dlls/setupapi/setupcab.c @@ -166,9 +166,9 @@ static INT_PTR CDECL sc_FNNOTIFY_A(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION p
switch (fdint) { case fdintCABINET_INFO: - TRACE("New cabinet, path %s, set %u, number %u, next disk %s.\n", - debugstr_a(pfdin->psz3), pfdin->setID, pfdin->iCabinet, debugstr_a(pfdin->psz2)); - ci.CabinetFile = phsc->most_recent_cabinet_name; + TRACE("New cabinet, path %s, set %u, number %u, next disk %s, next cabinet %s.\n", + debugstr_a(pfdin->psz3), pfdin->setID, pfdin->iCabinet, debugstr_a(pfdin->psz2), debugstr_a(pfdin->psz1)); + ci.CabinetFile = pfdin->psz1; ci.CabinetPath = pfdin->psz3; ci.DiskName = pfdin->psz2; ci.SetId = pfdin->setID; diff --git a/dlls/setupapi/tests/setupcab.c b/dlls/setupapi/tests/setupcab.c index 6ead90206f8..c76ca465fca 100644 --- a/dlls/setupapi/tests/setupcab.c +++ b/dlls/setupapi/tests/setupcab.c @@ -324,7 +324,7 @@ static UINT CALLBACK simple_callbackA(void *context, UINT message, UINT_PTR para
GetTempPathA(ARRAY_SIZE(temp), temp); ok(!strcmp(info->CabinetPath, temp), "Got path %s.\n", debugstr_a(info->CabinetPath)); - todo_wine ok(!info->CabinetFile[0], "Got file %s.\n", debugstr_a(info->CabinetFile)); + ok(!info->CabinetFile[0], "Got file %s.\n", debugstr_a(info->CabinetFile)); ok(!info->DiskName[0], "Got disk name %s.\n", debugstr_a(info->DiskName)); ok(!info->SetId, "Got set ID %#x.\n", info->SetId); ok(!info->CabinetNumber, "Got cabinet number %u.\n", info->CabinetNumber); @@ -432,7 +432,7 @@ static UINT CALLBACK simple_callbackW(void *context, UINT message, UINT_PTR para
GetTempPathW(ARRAY_SIZE(temp), temp); ok(!wcscmp(info->CabinetPath, temp), "Got path %s.\n", debugstr_w(info->CabinetPath)); - todo_wine ok(!info->CabinetFile[0], "Got file %s.\n", debugstr_w(info->CabinetFile)); + ok(!info->CabinetFile[0], "Got file %s.\n", debugstr_w(info->CabinetFile)); ok(!info->DiskName[0], "Got disk name %s.\n", debugstr_w(info->DiskName)); ok(!info->SetId, "Got set ID %#x.\n", info->SetId); ok(!info->CabinetNumber, "Got cabinet number %u.\n", info->CabinetNumber);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/setupapi/setupcab.c | 115 +++++++++++++++++++-------------- dlls/setupapi/tests/setupcab.c | 4 +- 2 files changed, 67 insertions(+), 52 deletions(-)
diff --git a/dlls/setupapi/setupcab.c b/dlls/setupapi/setupcab.c index daf23ad31ad..b63f5fbaf28 100644 --- a/dlls/setupapi/setupcab.c +++ b/dlls/setupapi/setupcab.c @@ -39,11 +39,13 @@ OSVERSIONINFOW OsVersionInfo;
HINSTANCE SETUPAPI_hInstance = 0;
-typedef struct { - PSP_FILE_CALLBACK_A msghandler; - PVOID context; - CHAR most_recent_cabinet_name[MAX_PATH]; - CHAR most_recent_target[MAX_PATH]; +typedef struct +{ + PSP_FILE_CALLBACK_A msghandler; + void *context; + char cab_path[MAX_PATH]; + char last_cab[MAX_PATH]; + char most_recent_target[MAX_PATH]; } SC_HSC_A, *PSC_HSC_A;
WINE_DEFAULT_DEBUG_CHANNEL(setupapi); @@ -204,7 +206,7 @@ static INT_PTR CDECL sc_FNNOTIFY_A(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION p } case fdintCLOSE_FILE_INFO: TRACE("File extracted.\n"); - fp.Source = phsc->most_recent_cabinet_name; + fp.Source = phsc->last_cab; fp.Target = phsc->most_recent_target; fp.Win32Error = 0; fp.Flags = 0; @@ -225,7 +227,7 @@ static INT_PTR CDECL sc_FNNOTIFY_A(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION p ci.DiskName = pfdin->psz2; ci.SetId = pfdin->setID; ci.CabinetNumber = pfdin->iCabinet; - strcpy(phsc->most_recent_cabinet_name, pfdin->psz1); + sprintf(phsc->last_cab, "%s%s", phsc->cab_path, ci.CabinetFile); err = phsc->msghandler(phsc->context, SPFILENOTIFY_NEEDNEWCABINET, (UINT_PTR)&ci, (UINT_PTR)mysterio); if (err) { SetLastError(err); @@ -246,62 +248,75 @@ static INT_PTR CDECL sc_FNNOTIFY_A(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION p /*********************************************************************** * SetupIterateCabinetA (SETUPAPI.@) */ -BOOL WINAPI SetupIterateCabinetA(PCSTR CabinetFile, DWORD Reserved, - PSP_FILE_CALLBACK_A MsgHandler, PVOID Context) +BOOL WINAPI SetupIterateCabinetA(const char *file, DWORD reserved, + PSP_FILE_CALLBACK_A callback, void *context) {
- SC_HSC_A my_hsc; - ERF erf; - CHAR pszCabinet[MAX_PATH], pszCabPath[MAX_PATH], *p = NULL; - DWORD fpnsize; - HFDI hfdi; - BOOL ret; + SC_HSC_A my_hsc; + ERF erf; + CHAR pszCabinet[MAX_PATH], pszCabPath[MAX_PATH], *filepart = NULL; + size_t path_size = 0; + const char *p; + DWORD fpnsize; + HFDI hfdi; + BOOL ret;
- TRACE("(CabinetFile == %s, Reserved == %u, MsgHandler == ^%p, Context == ^%p)\n", - debugstr_a(CabinetFile), Reserved, MsgHandler, Context); + TRACE("file %s, reserved %#x, callback %p, context %p.\n", + debugstr_a(file), reserved, callback, context);
- if (!CabinetFile) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } + if (!file) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + }
- fpnsize = strlen(CabinetFile); - if (fpnsize >= MAX_PATH) { - SetLastError(ERROR_BAD_PATHNAME); - return FALSE; - } + if (strlen(file) >= MAX_PATH) + { + SetLastError(ERROR_BAD_PATHNAME); + return FALSE; + }
- fpnsize = GetFullPathNameA(CabinetFile, MAX_PATH, pszCabPath, &p); - if (fpnsize > MAX_PATH) { - SetLastError(ERROR_BAD_PATHNAME); - return FALSE; - } + fpnsize = GetFullPathNameA(file, MAX_PATH, pszCabPath, &filepart); + if (fpnsize > MAX_PATH) + { + SetLastError(ERROR_BAD_PATHNAME); + return FALSE; + }
- if (p) { - strcpy(pszCabinet, p); - *p = '\0'; - } else { - strcpy(pszCabinet, CabinetFile); - pszCabPath[0] = '\0'; - } + if (filepart) + { + strcpy(pszCabinet, filepart); + *filepart = '\0'; + } + else + { + strcpy(pszCabinet, file); + pszCabPath[0] = '\0'; + } + + for (p = file; *p; ++p) + { + if (*p == '/' || *p == '\') + path_size = p - file; + } + memcpy(my_hsc.cab_path, file, path_size); + my_hsc.cab_path[path_size] = 0;
- TRACE("path: %s, cabfile: %s\n", debugstr_a(pszCabPath), debugstr_a(pszCabinet)); + TRACE("path: %s, cabfile: %s\n", debugstr_a(pszCabPath), debugstr_a(pszCabinet));
- /* remember the cabinet name */ - strcpy(my_hsc.most_recent_cabinet_name, pszCabinet); + strcpy(my_hsc.last_cab, file);
- my_hsc.msghandler = MsgHandler; - my_hsc.context = Context; - hfdi = FDICreate(sc_cb_alloc, sc_cb_free, sc_cb_open, sc_cb_read, - sc_cb_write, sc_cb_close, sc_cb_lseek, cpuUNKNOWN, &erf); + my_hsc.msghandler = callback; + my_hsc.context = context; + hfdi = FDICreate(sc_cb_alloc, sc_cb_free, sc_cb_open, sc_cb_read, + sc_cb_write, sc_cb_close, sc_cb_lseek, cpuUNKNOWN, &erf);
- if (!hfdi) return FALSE; + if (!hfdi) return FALSE;
- ret = FDICopy(hfdi, pszCabinet, pszCabPath, 0, sc_FNNOTIFY_A, NULL, &my_hsc); + ret = FDICopy(hfdi, pszCabinet, pszCabPath, 0, sc_FNNOTIFY_A, NULL, &my_hsc);
- FDIDestroy(hfdi); - return ret; + FDIDestroy(hfdi); + return ret; }
struct iterate_wtoa_ctx diff --git a/dlls/setupapi/tests/setupcab.c b/dlls/setupapi/tests/setupcab.c index c76ca465fca..458708939da 100644 --- a/dlls/setupapi/tests/setupcab.c +++ b/dlls/setupapi/tests/setupcab.c @@ -367,7 +367,7 @@ static UINT CALLBACK simple_callbackA(void *context, UINT message, UINT_PTR para GetTempPathA(ARRAY_SIZE(temp), temp); ok(index < ARRAY_SIZE(expected_files), "%u: Got unexpected file.\n", index); snprintf(path, ARRAY_SIZE(path), "%s/./testcab.cab", temp); - todo_wine ok(!strcmp(info->Source, path), "%u: Got source %s.\n", index, debugstr_a(info->Source)); + ok(!strcmp(info->Source, path), "%u: Got source %s.\n", index, debugstr_a(info->Source)); snprintf(path, ARRAY_SIZE(path), "%s\%s", temp, expected_files[index].nameA); ok(!strcmp(info->Target, path), "%u: Got target %s.\n", index, debugstr_a(info->Target)); ok(!info->Win32Error, "%u: Got error %u.\n", index, info->Win32Error); @@ -475,7 +475,7 @@ static UINT CALLBACK simple_callbackW(void *context, UINT message, UINT_PTR para GetTempPathW(ARRAY_SIZE(temp), temp); ok(index < ARRAY_SIZE(expected_files), "%u: Got unexpected file.\n", index); swprintf(path, ARRAY_SIZE(path), L"%s/./testcab.cab", temp); - todo_wine ok(!wcscmp(info->Source, path), "%u: Got source %s.\n", index, debugstr_w(info->Source)); + ok(!wcscmp(info->Source, path), "%u: Got source %s.\n", index, debugstr_w(info->Source)); swprintf(path, ARRAY_SIZE(path), L"%s\%s", temp, expected_files[index].nameW); ok(!wcscmp(info->Target, path), "%u: Got target %s.\n", index, debugstr_w(info->Target)); ok(!info->Win32Error, "%u: Got error %u.\n", index, info->Win32Error);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/setupapi/setupcab.c | 2 +- dlls/setupapi/tests/setupcab.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/setupapi/setupcab.c b/dlls/setupapi/setupcab.c index b63f5fbaf28..d4d475c98cb 100644 --- a/dlls/setupapi/setupcab.c +++ b/dlls/setupapi/setupcab.c @@ -190,7 +190,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->last_cab); if (err == FILEOP_DOIT) { TRACE("Callback specified filename: %s\n", debugstr_a(fici.FullTargetName)); if (!fici.FullTargetName[0]) { diff --git a/dlls/setupapi/tests/setupcab.c b/dlls/setupapi/tests/setupcab.c index 458708939da..0bfab8142c2 100644 --- a/dlls/setupapi/tests/setupcab.c +++ b/dlls/setupapi/tests/setupcab.c @@ -350,7 +350,7 @@ static UINT CALLBACK simple_callbackA(void *context, UINT message, UINT_PTR para
GetTempPathA(ARRAY_SIZE(temp), temp); snprintf(path, ARRAY_SIZE(path), "%s/./testcab.cab", temp); - todo_wine ok(!strcmp((const char *)param2, path), "%u: Got file name %s.\n", + ok(!strcmp((const char *)param2, path), "%u: Got file name %s.\n", index, debugstr_a((const char *)param2));
snprintf(info->FullTargetName, ARRAY_SIZE(info->FullTargetName), @@ -458,7 +458,7 @@ static UINT CALLBACK simple_callbackW(void *context, UINT message, UINT_PTR para
GetTempPathW(ARRAY_SIZE(temp), temp); swprintf(path, ARRAY_SIZE(path), L"%s/./testcab.cab", temp); - todo_wine ok(!wcscmp((const WCHAR *)param2, path), "%u: Got file name %s.\n", + ok(!wcscmp((const WCHAR *)param2, path), "%u: Got file name %s.\n", index, debugstr_w((const WCHAR *)param2));
swprintf(info->FullTargetName, ARRAY_SIZE(info->FullTargetName),