From d5c0b17ae7d952440d9c7cec3e4b4320e75c9fa1 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 30 Jan 2013 11:38:59 +0100 Subject: [PATCH] wininet: Moved WORKREQ_FTPRENAMEFILEW out of WORKREQUEST. --- dlls/wininet/ftp.c | 30 +++++++++++++++++------------- dlls/wininet/internet.h | 7 ------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/dlls/wininet/ftp.c b/dlls/wininet/ftp.c index ba7d5c38920..d7c439bd67c 100644 --- a/dlls/wininet/ftp.c +++ b/dlls/wininet/ftp.c @@ -2076,16 +2076,22 @@ BOOL WINAPI FtpRenameFileA(HINTERNET hFtpSession, LPCSTR lpszSrc, LPCSTR lpszDes return ret; } -static void AsyncFtpRenameFileProc(WORKREQUEST *workRequest) +typedef struct { + task_header_t hdr; + WCHAR *src_file; + WCHAR *dst_file; +} rename_file_task_t; + +static void AsyncFtpRenameFileProc(task_header_t *hdr) { - struct WORKREQ_FTPRENAMEFILEW const *req = &workRequest->u.FtpRenameFileW; - ftp_session_t *lpwfs = (ftp_session_t*) workRequest->hdr; + rename_file_task_t *task = (rename_file_task_t*)hdr; + ftp_session_t *session = (ftp_session_t*)task->hdr.hdr; - TRACE("%p\n", lpwfs); + TRACE("%p\n", session); - FTP_FtpRenameFileW(lpwfs, req->lpszSrcFile, req->lpszDestFile); - heap_free(req->lpszSrcFile); - heap_free(req->lpszDestFile); + FTP_FtpRenameFileW(session, task->src_file, task->dst_file); + heap_free(task->src_file); + heap_free(task->dst_file); } /*********************************************************************** @@ -2132,15 +2138,13 @@ BOOL WINAPI FtpRenameFileW(HINTERNET hFtpSession, LPCWSTR lpszSrc, LPCWSTR lpszD hIC = lpwfs->lpAppInfo; if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC) { - WORKREQUEST *task; - struct WORKREQ_FTPRENAMEFILEW *req; + rename_file_t *task; task = alloc_async_task(&lpwfs->hdr, AsyncFtpRenameFileProc, sizeof(*task)); - req = &task->u.FtpRenameFileW; - req->lpszSrcFile = heap_strdupW(lpszSrc); - req->lpszDestFile = heap_strdupW(lpszDest); + task->src_file = heap_strdupW(lpszSrc); + task->dst_file = heap_strdupW(lpszDest); - r = res_to_le(INTERNET_AsyncCall(task)); + r = res_to_le(INTERNET_AsyncCall(&task->hdr)); } else { diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h index efb6ef5573d..26dc2867544 100644 --- a/dlls/wininet/internet.h +++ b/dlls/wininet/internet.h @@ -360,12 +360,6 @@ struct WORKREQ_FTPDELETEFILEW LPWSTR lpszFilename; }; -struct WORKREQ_FTPRENAMEFILEW -{ - LPWSTR lpszSrcFile; - LPWSTR lpszDestFile; -}; - struct WORKREQ_FTPFINDNEXTW { LPWIN32_FIND_DATAW lpFindFileData; @@ -381,7 +375,6 @@ typedef struct WORKREQ union { struct WORKREQ_FTPDELETEFILEW FtpDeleteFileW; - struct WORKREQ_FTPRENAMEFILEW FtpRenameFileW; struct WORKREQ_FTPFINDNEXTW FtpFindNextW; } u; } WORKREQUEST, *LPWORKREQUEST;