Commit 302fd67e authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

wininet: Moved WORKREQ_FTPDELETEFILEW out of WORKREQUEST.

parent a489677f
......@@ -1786,15 +1786,20 @@ BOOL WINAPI FtpDeleteFileA(HINTERNET hFtpSession, LPCSTR lpszFileName)
return ret;
}
static void AsyncFtpDeleteFileProc(WORKREQUEST *workRequest)
typedef struct {
task_header_t hdr;
WCHAR *file_name;
} delete_file_task_t;
static void AsyncFtpDeleteFileProc(task_header_t *hdr)
{
struct WORKREQ_FTPDELETEFILEW const *req = &workRequest->u.FtpDeleteFileW;
ftp_session_t *lpwfs = (ftp_session_t*) workRequest->hdr;
delete_file_task_t *task = (delete_file_task_t*)hdr;
ftp_session_t *session = (ftp_session_t*)task->hdr.hdr;
TRACE("%p\n", lpwfs);
TRACE("%p\n", session);
FTP_FtpDeleteFileW(lpwfs, req->lpszFilename);
heap_free(req->lpszFilename);
FTP_FtpDeleteFileW(session, task->file_name);
heap_free(task->file_name);
}
/***********************************************************************
......@@ -1841,14 +1846,12 @@ BOOL WINAPI FtpDeleteFileW(HINTERNET hFtpSession, LPCWSTR lpszFileName)
hIC = lpwfs->lpAppInfo;
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC)
{
WORKREQUEST *task;
struct WORKREQ_FTPDELETEFILEW *req;
delete_file_task_t *task;
task = alloc_async_task(&lpwfs->hdr, AsyncFtpDeleteFileProc, sizeof(*task));
req = &task->u.FtpDeleteFileW;
req->lpszFilename = heap_strdupW(lpszFileName);
task->file_name = heap_strdupW(lpszFileName);
r = res_to_le(INTERNET_AsyncCall(task));
r = res_to_le(INTERNET_AsyncCall(&task->hdr));
}
else
{
......
......@@ -354,12 +354,6 @@ typedef struct
netconn_stream_t netconn_stream;
} http_request_t;
struct WORKREQ_FTPDELETEFILEW
{
LPWSTR lpszFilename;
};
typedef struct WORKREQ task_header_t;
typedef void (*async_task_proc_t)(task_header_t*);
......@@ -367,10 +361,6 @@ typedef struct WORKREQ
{
async_task_proc_t proc;
object_header_t *hdr;
union {
struct WORKREQ_FTPDELETEFILEW FtpDeleteFileW;
} u;
} WORKREQUEST, *LPWORKREQUEST;
void *alloc_async_task(object_header_t*,async_task_proc_t,size_t) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment