wininet: Moved WORKREQ_FTPPUTFILEW out of WORKREQUEST.

oldstable
Jacek Caban 2013-01-29 12:04:40 +01:00 committed by Alexandre Julliard
parent 195ea90f3b
commit 47d0f5a167
2 changed files with 22 additions and 25 deletions

View File

@ -251,18 +251,26 @@ BOOL WINAPI FtpPutFileA(HINTERNET hConnect, LPCSTR lpszLocalFile,
return ret;
}
static void AsyncFtpPutFileProc(WORKREQUEST *workRequest)
typedef struct {
task_header_t hdr;
WCHAR *local_file;
WCHAR *remote_file;
DWORD flags;
DWORD_PTR context;
} put_file_task_t;
static void AsyncFtpPutFileProc(task_header_t *hdr)
{
struct WORKREQ_FTPPUTFILEW const *req = &workRequest->u.FtpPutFileW;
ftp_session_t *lpwfs = (ftp_session_t*) workRequest->hdr;
put_file_task_t *task = (put_file_task_t*)hdr;
ftp_session_t *session = (ftp_session_t*)task->hdr.hdr;
TRACE("%p\n", lpwfs);
TRACE("%p\n", session);
FTP_FtpPutFileW(lpwfs, req->lpszLocalFile,
req->lpszNewRemoteFile, req->dwFlags, req->dwContext);
FTP_FtpPutFileW(session, task->local_file, task->remote_file,
task->flags, task->context);
heap_free(req->lpszLocalFile);
heap_free(req->lpszNewRemoteFile);
heap_free(task->local_file);
heap_free(task->remote_file);
}
/***********************************************************************
@ -316,15 +324,14 @@ BOOL WINAPI FtpPutFileW(HINTERNET hConnect, LPCWSTR lpszLocalFile,
hIC = lpwfs->lpAppInfo;
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC)
{
WORKREQUEST *task = alloc_async_task(&lpwfs->hdr, AsyncFtpPutFileProc, sizeof(*task));
struct WORKREQ_FTPPUTFILEW *req = &task->u.FtpPutFileW;
put_file_task_t *task = alloc_async_task(&lpwfs->hdr, AsyncFtpPutFileProc, sizeof(*task));
req->lpszLocalFile = heap_strdupW(lpszLocalFile);
req->lpszNewRemoteFile = heap_strdupW(lpszNewRemoteFile);
req->dwFlags = dwFlags;
req->dwContext = dwContext;
task->local_file = heap_strdupW(lpszLocalFile);
task->remote_file = heap_strdupW(lpszNewRemoteFile);
task->flags = dwFlags;
task->context = dwContext;
r = res_to_le(INTERNET_AsyncCall(task));
r = res_to_le(INTERNET_AsyncCall(&task->hdr));
}
else
{

View File

@ -355,15 +355,6 @@ typedef struct
} http_request_t;
struct WORKREQ_FTPPUTFILEW
{
LPWSTR lpszLocalFile;
LPWSTR lpszNewRemoteFile;
DWORD dwFlags;
DWORD_PTR dwContext;
};
struct WORKREQ_FTPSETCURRENTDIRECTORYW
{
LPWSTR lpszDirectory;
@ -436,7 +427,6 @@ typedef struct WORKREQ
object_header_t *hdr;
union {
struct WORKREQ_FTPPUTFILEW FtpPutFileW;
struct WORKREQ_FTPSETCURRENTDIRECTORYW FtpSetCurrentDirectoryW;
struct WORKREQ_FTPCREATEDIRECTORYW FtpCreateDirectoryW;
struct WORKREQ_FTPFINDFIRSTFILEW FtpFindFirstFileW;