Commit 989bb5b9 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

wininet: Moved WORKREQ_FTPSETCURRENTDIRECTORYW out of WORKREQUEST.

parent 47d0f5a1
......@@ -441,16 +441,20 @@ BOOL WINAPI FtpSetCurrentDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory)
return ret;
}
typedef struct {
task_header_t hdr;
WCHAR *directory;
} directory_task_t;
static void AsyncFtpSetCurrentDirectoryProc(WORKREQUEST *workRequest)
static void AsyncFtpSetCurrentDirectoryProc(task_header_t *hdr)
{
struct WORKREQ_FTPSETCURRENTDIRECTORYW const *req = &workRequest->u.FtpSetCurrentDirectoryW;
ftp_session_t *lpwfs = (ftp_session_t*) workRequest->hdr;
directory_task_t *task = (directory_task_t*)hdr;
ftp_session_t *session = (ftp_session_t*)task->hdr.hdr;
TRACE("%p\n", lpwfs);
TRACE("%p\n", session);
FTP_FtpSetCurrentDirectoryW(lpwfs, req->lpszDirectory);
heap_free(req->lpszDirectory);
FTP_FtpSetCurrentDirectoryW(session, task->directory);
heap_free(task->directory);
}
/***********************************************************************
......@@ -493,14 +497,12 @@ BOOL WINAPI FtpSetCurrentDirectoryW(HINTERNET hConnect, LPCWSTR lpszDirectory)
hIC = lpwfs->lpAppInfo;
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC)
{
WORKREQUEST *task;
struct WORKREQ_FTPSETCURRENTDIRECTORYW *req;
directory_task_t *task;
task = alloc_async_task(&lpwfs->hdr, AsyncFtpSetCurrentDirectoryProc, sizeof(*task));
req = &task->u.FtpSetCurrentDirectoryW;
req->lpszDirectory = heap_strdupW(lpszDirectory);
task->directory = heap_strdupW(lpszDirectory);
r = res_to_le(INTERNET_AsyncCall(task));
r = res_to_le(INTERNET_AsyncCall(&task->hdr));
}
else
{
......
......@@ -355,11 +355,6 @@ typedef struct
} http_request_t;
struct WORKREQ_FTPSETCURRENTDIRECTORYW
{
LPWSTR lpszDirectory;
};
struct WORKREQ_FTPCREATEDIRECTORYW
{
LPWSTR lpszDirectory;
......@@ -427,7 +422,6 @@ typedef struct WORKREQ
object_header_t *hdr;
union {
struct WORKREQ_FTPSETCURRENTDIRECTORYW FtpSetCurrentDirectoryW;
struct WORKREQ_FTPCREATEDIRECTORYW FtpCreateDirectoryW;
struct WORKREQ_FTPFINDFIRSTFILEW FtpFindFirstFileW;
struct WORKREQ_FTPGETCURRENTDIRECTORYW FtpGetCurrentDirectoryW;
......
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