wininet: Moved WORKREQ_FTPGETFILEW out of WORKREQUEST.

This commit is contained in:
Jacek Caban 2013-01-30 11:38:12 +01:00 committed by Alexandre Julliard
parent 17ca7ee82f
commit b2deb67696
2 changed files with 25 additions and 30 deletions

View File

@ -1563,19 +1563,27 @@ BOOL WINAPI FtpGetFileA(HINTERNET hInternet, LPCSTR lpszRemoteFile, LPCSTR lpszN
return ret; return ret;
} }
typedef struct {
task_header_t hdr;
WCHAR *remote_file;
WCHAR *new_file;
BOOL fail_if_exists;
DWORD local_attr;
DWORD flags;
DWORD_PTR context;
} get_file_task_t;
static void AsyncFtpGetFileProc(WORKREQUEST *workRequest) static void AsyncFtpGetFileProc(task_header_t *hdr)
{ {
struct WORKREQ_FTPGETFILEW const *req = &workRequest->u.FtpGetFileW; get_file_task_t *task = (get_file_task_t*)hdr;
ftp_session_t *lpwfs = (ftp_session_t*) workRequest->hdr; ftp_session_t *session = (ftp_session_t*)task->hdr.hdr;
TRACE("%p\n", lpwfs); TRACE("%p\n", session);
FTP_FtpGetFileW(lpwfs, req->lpszRemoteFile, FTP_FtpGetFileW(session, task->remote_file, task->new_file, task->fail_if_exists,
req->lpszNewFile, req->fFailIfExists, task->local_attr, task->flags, task->context);
req->dwLocalFlagsAttribute, req->dwFlags, req->dwContext); heap_free(task->remote_file);
heap_free(req->lpszRemoteFile); heap_free(task->new_file);
heap_free(req->lpszNewFile);
} }
@ -1631,19 +1639,17 @@ BOOL WINAPI FtpGetFileW(HINTERNET hInternet, LPCWSTR lpszRemoteFile, LPCWSTR lps
hIC = lpwfs->lpAppInfo; hIC = lpwfs->lpAppInfo;
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC) if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC)
{ {
WORKREQUEST *task; get_file_task_t *task;
struct WORKREQ_FTPGETFILEW *req;
task = alloc_async_task(&lpwfs->hdr, AsyncFtpGetFileProc, sizeof(*task)); task = alloc_async_task(&lpwfs->hdr, AsyncFtpGetFileProc, sizeof(*task));
req = &task->u.FtpGetFileW; task->remote_file = heap_strdupW(lpszRemoteFile);
req->lpszRemoteFile = heap_strdupW(lpszRemoteFile); task->new_file = heap_strdupW(lpszNewFile);
req->lpszNewFile = heap_strdupW(lpszNewFile); task->local_attr = dwLocalFlagsAttribute;
req->dwLocalFlagsAttribute = dwLocalFlagsAttribute; task->fail_if_exists = fFailIfExists;
req->fFailIfExists = fFailIfExists; task->flags = dwInternetFlags;
req->dwFlags = dwInternetFlags; task->context = dwContext;
req->dwContext = dwContext;
r = res_to_le(INTERNET_AsyncCall(task)); r = res_to_le(INTERNET_AsyncCall(&task->hdr));
} }
else else
{ {

View File

@ -377,16 +377,6 @@ struct WORKREQ_FTPOPENFILEW
DWORD_PTR dwContext; DWORD_PTR dwContext;
}; };
struct WORKREQ_FTPGETFILEW
{
LPWSTR lpszRemoteFile;
LPWSTR lpszNewFile;
BOOL fFailIfExists;
DWORD dwLocalFlagsAttribute;
DWORD dwFlags;
DWORD_PTR dwContext;
};
struct WORKREQ_FTPDELETEFILEW struct WORKREQ_FTPDELETEFILEW
{ {
LPWSTR lpszFilename; LPWSTR lpszFilename;
@ -415,7 +405,6 @@ typedef struct WORKREQ
struct WORKREQ_FTPFINDFIRSTFILEW FtpFindFirstFileW; struct WORKREQ_FTPFINDFIRSTFILEW FtpFindFirstFileW;
struct WORKREQ_FTPGETCURRENTDIRECTORYW FtpGetCurrentDirectoryW; struct WORKREQ_FTPGETCURRENTDIRECTORYW FtpGetCurrentDirectoryW;
struct WORKREQ_FTPOPENFILEW FtpOpenFileW; struct WORKREQ_FTPOPENFILEW FtpOpenFileW;
struct WORKREQ_FTPGETFILEW FtpGetFileW;
struct WORKREQ_FTPDELETEFILEW FtpDeleteFileW; struct WORKREQ_FTPDELETEFILEW FtpDeleteFileW;
struct WORKREQ_FTPRENAMEFILEW FtpRenameFileW; struct WORKREQ_FTPRENAMEFILEW FtpRenameFileW;
struct WORKREQ_FTPFINDNEXTW FtpFindNextW; struct WORKREQ_FTPFINDNEXTW FtpFindNextW;