From: David Carrasco Flores <dcf1007@gmail.com> This reverts commit 4d032016f02525230d6ba8f4be7363a0141ddc93 --- programs/wusa/main.c | 51 ++++---------------------------------------- 1 file changed, 4 insertions(+), 47 deletions(-) diff --git a/programs/wusa/main.c b/programs/wusa/main.c index 31d44882011..26e83e4fc20 100644 --- a/programs/wusa/main.c +++ b/programs/wusa/main.c @@ -246,61 +246,18 @@ static INT_PTR CDECL cabinet_notify(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION static BOOL extract_cabinet(const WCHAR *filename, const WCHAR *destination) { char *filenameA = NULL; - CHAR pszCabinet[MAX_PATH], pszCabPath[MAX_PATH], *filepart = NULL; - DWORD fpnsize; BOOL ret = FALSE; HFDI hfdi; ERF erf; - if (!(filenameA = strdupWtoA(filename))) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - if (strlen(filenameA) >= MAX_PATH) - { - SetLastError(ERROR_BAD_PATHNAME); - free(filenameA); - return FALSE; - } - - fpnsize = GetFullPathNameA(filenameA, MAX_PATH, pszCabPath, &filepart); - - if (!fpnsize || fpnsize > MAX_PATH) - { - SetLastError(ERROR_BAD_PATHNAME); - free(filenameA); - return FALSE; - } - - if (filepart) - { - strcpy(pszCabinet, filepart); - *filepart = '\0'; - } - else - { - strcpy(pszCabinet, filenameA); - pszCabPath[0] = '\0'; - } - - free(filenameA); - - TRACE("path: %s, cabfile: %s\n", debugstr_a(pszCabPath), debugstr_a(pszCabinet)); - hfdi = FDICreate(cabinet_alloc, cabinet_free, cabinet_open, cabinet_read, cabinet_write, cabinet_close, cabinet_seek, 0, &erf); - if (!hfdi) - { - ERR("FDICreate failed\n"); - return FALSE; - } + if (!hfdi) return FALSE; - ret = FDICopy(hfdi, pszCabinet, pszCabPath, 0, cabinet_notify, NULL, (void *)destination); - if (!ret) + if ((filenameA = strdupWtoA(filename))) { - ERR("FDICopy failed\n"); + ret = FDICopy(hfdi, filenameA, NULL, 0, cabinet_notify, NULL, (void *)destination); + free(filenameA); } FDIDestroy(hfdi); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10748