wininet: Moved WORKREQ_FTPOPENFILEW out of WORKREQUEST.

This commit is contained in:
Jacek Caban 2013-01-30 11:38:49 +01:00 committed by Alexandre Julliard
parent f05b5b7e7e
commit 228d6a6064
2 changed files with 21 additions and 26 deletions

View File

@ -791,7 +791,7 @@ HINTERNET WINAPI FtpFindFirstFileW(HINTERNET hConnect,
hIC = lpwfs->lpAppInfo; hIC = lpwfs->lpAppInfo;
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC) if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC)
{ {
find_first_file_t *task; find_first_file_task_t *task;
task = alloc_async_task(&lpwfs->hdr, AsyncFtpFindFirstFileProc, sizeof(*task)); task = alloc_async_task(&lpwfs->hdr, AsyncFtpFindFirstFileProc, sizeof(*task));
task->search_file = heap_strdupW(lpszSearchFile); task->search_file = heap_strdupW(lpszSearchFile);
@ -1454,17 +1454,23 @@ HINTERNET WINAPI FtpOpenFileA(HINTERNET hFtpSession,
return ret; return ret;
} }
typedef struct {
task_header_t hdr;
WCHAR *file_name;
DWORD access;
DWORD flags;
DWORD_PTR context;
} open_file_task_t;
static void AsyncFtpOpenFileProc(WORKREQUEST *workRequest) static void AsyncFtpOpenFileProc(task_header_t *hdr)
{ {
struct WORKREQ_FTPOPENFILEW const *req = &workRequest->u.FtpOpenFileW; open_file_task_t *task = (open_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_FtpOpenFileW(lpwfs, req->lpszFilename, FTP_FtpOpenFileW(session, task->file_name, task->access, task->flags, task->context);
req->dwAccess, req->dwFlags, req->dwContext); heap_free(task->file_name);
heap_free(req->lpszFilename);
} }
/*********************************************************************** /***********************************************************************
@ -1518,18 +1524,16 @@ HINTERNET WINAPI FtpOpenFileW(HINTERNET hFtpSession,
hIC = lpwfs->lpAppInfo; hIC = lpwfs->lpAppInfo;
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC) if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC)
{ {
WORKREQUEST *task; open_file_task_t *task;
struct WORKREQ_FTPOPENFILEW *req;
task = alloc_async_task(&lpwfs->hdr, AsyncFtpOpenFileProc, sizeof(*task)); task = alloc_async_task(&lpwfs->hdr, AsyncFtpOpenFileProc, sizeof(*task));
req = &task->u.FtpOpenFileW; task->file_name = heap_strdupW(lpszFileName);
req->lpszFilename = heap_strdupW(lpszFileName); task->access = fdwAccess;
req->dwAccess = fdwAccess; task->flags = dwFlags;
req->dwFlags = dwFlags; task->context = dwContext;
req->dwContext = dwContext;
INTERNET_AsyncCall(task); INTERNET_AsyncCall(&task->hdr);
r = NULL; r = NULL;
} }
else else
{ {

View File

@ -355,14 +355,6 @@ typedef struct
} http_request_t; } http_request_t;
struct WORKREQ_FTPOPENFILEW
{
LPWSTR lpszFilename;
DWORD dwAccess;
DWORD dwFlags;
DWORD_PTR dwContext;
};
struct WORKREQ_FTPDELETEFILEW struct WORKREQ_FTPDELETEFILEW
{ {
LPWSTR lpszFilename; LPWSTR lpszFilename;
@ -388,7 +380,6 @@ typedef struct WORKREQ
object_header_t *hdr; object_header_t *hdr;
union { union {
struct WORKREQ_FTPOPENFILEW FtpOpenFileW;
struct WORKREQ_FTPDELETEFILEW FtpDeleteFileW; struct WORKREQ_FTPDELETEFILEW FtpDeleteFileW;
struct WORKREQ_FTPRENAMEFILEW FtpRenameFileW; struct WORKREQ_FTPRENAMEFILEW FtpRenameFileW;
struct WORKREQ_FTPFINDNEXTW FtpFindNextW; struct WORKREQ_FTPFINDNEXTW FtpFindNextW;