wininet: Moved WORKREQ_FTPFINDFIRSTFILEW out of WORKREQUEST.

This commit is contained in:
Jacek Caban 2013-01-30 11:38:39 +01:00 committed by Alexandre Julliard
parent 059c77956f
commit f05b5b7e7e
2 changed files with 20 additions and 25 deletions

View File

@ -739,17 +739,23 @@ HINTERNET WINAPI FtpFindFirstFileA(HINTERNET hConnect,
return ret; return ret;
} }
typedef struct {
task_header_t hdr;
WCHAR *search_file;
WIN32_FIND_DATAW *find_file_data;
DWORD flags;
DWORD_PTR context;
} find_first_file_task_t;
static void AsyncFtpFindFirstFileProc(WORKREQUEST *workRequest) static void AsyncFtpFindFirstFileProc(task_header_t *hdr)
{ {
struct WORKREQ_FTPFINDFIRSTFILEW const *req = &workRequest->u.FtpFindFirstFileW; find_first_file_task_t *task = (find_first_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_FtpFindFirstFileW(lpwfs, req->lpszSearchFile, FTP_FtpFindFirstFileW(session, task->search_file, task->find_file_data, task->flags, task->context);
req->lpFindFileData, req->dwFlags, req->dwContext); heap_free(task->search_file);
heap_free(req->lpszSearchFile);
} }
/*********************************************************************** /***********************************************************************
@ -785,18 +791,16 @@ 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)
{ {
WORKREQUEST *task; find_first_file_t *task;
struct WORKREQ_FTPFINDFIRSTFILEW *req;
task = alloc_async_task(&lpwfs->hdr, AsyncFtpFindFirstFileProc, sizeof(*task)); task = alloc_async_task(&lpwfs->hdr, AsyncFtpFindFirstFileProc, sizeof(*task));
req = &task->u.FtpFindFirstFileW; task->search_file = heap_strdupW(lpszSearchFile);
req->lpszSearchFile = (lpszSearchFile == NULL) ? NULL : heap_strdupW(lpszSearchFile); task->find_file_data = lpFindFileData;
req->lpFindFileData = lpFindFileData; 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_FTPFINDFIRSTFILEW
{
LPWSTR lpszSearchFile;
LPWIN32_FIND_DATAW lpFindFileData;
DWORD dwFlags;
DWORD_PTR dwContext;
};
struct WORKREQ_FTPOPENFILEW struct WORKREQ_FTPOPENFILEW
{ {
LPWSTR lpszFilename; LPWSTR lpszFilename;
@ -396,7 +388,6 @@ typedef struct WORKREQ
object_header_t *hdr; object_header_t *hdr;
union { union {
struct WORKREQ_FTPFINDFIRSTFILEW FtpFindFirstFileW;
struct WORKREQ_FTPOPENFILEW FtpOpenFileW; struct WORKREQ_FTPOPENFILEW FtpOpenFileW;
struct WORKREQ_FTPDELETEFILEW FtpDeleteFileW; struct WORKREQ_FTPDELETEFILEW FtpDeleteFileW;
struct WORKREQ_FTPRENAMEFILEW FtpRenameFileW; struct WORKREQ_FTPRENAMEFILEW FtpRenameFileW;