59#define RESPONSE_TIMEOUT 30
107#define DATA_PACKET_SIZE 0x2000
114#define FTP_CONDITION_MASK 0x0007
203 BOOL fFailIfExists,
DWORD dwLocalFlagsAttribute,
DWORD dwInternetFlags,
279 if (!lpszLocalFile || !lpszNewRemoteFile)
325 lpszNewRemoteFile,
dwFlags, dwContext);
718 lpFindFileDataW = lpFindFileData?&wfd:
NULL;
722 if (
ret && lpFindFileData)
842 if (
name != lpszSearchFile)
845 lpszSearchFile =
name;
856 if (nResCode == 125 || nResCode == 150)
863 hFindNext =
FTP_ReceiveFileList(lpwfs, nDataSocket, lpszSearchFile, lpFindFileData, dwContext);
866 if (nResCode != 226 && nResCode != 250)
923 if(lpdwCurrentDirectory) {
924 len = *lpdwCurrentDirectory;
925 if(lpszCurrentDirectory)
937 if (
ret && lpszCurrentDirectory)
940 if (lpdwCurrentDirectory) *lpdwCurrentDirectory =
len;
978 TRACE(
"%p %p %p\n", hFtpSession, lpszCurrentDirectory, lpdwCurrentDirectory);
993 if (!lpdwCurrentDirectory)
999 if (lpszCurrentDirectory ==
NULL)
1025 lpdwCurrentDirectory);
1064 if (nResCode == 257)
1069 for (firstpos = 0, lastpos = 0; lpszResponseBuffer[lastpos]; lastpos++)
1071 if (
'"' == lpszResponseBuffer[lastpos])
1079 len = lastpos - firstpos;
1080 if (*lpdwCurrentDirectory >=
len)
1082 memcpy(lpszCurrentDirectory, &lpszResponseBuffer[firstpos + 1],
len *
sizeof(
WCHAR));
1083 lpszCurrentDirectory[
len - 1] = 0;
1084 *lpdwCurrentDirectory =
len;
1137 if (nResCode > 0 && nResCode != 226)
WARN(
"server reports failed transfer\n");
1146 TRACE(
"INTERNET_OPTION_HANDLE_TYPE\n");
1159 TRACE(
"INTERNET_OPTION_DATAFILE_NAME\n");
1161 if (!
file->cache_file)
1169 if (*
size < required)
1179 if (required > *
size)
1197 if (
file->nDataSocket == -1)
1207 DWORD bytes_written;
1222 *written =
res>0 ?
res : 0;
1265 TRACE(
"%d bytes of queued, but unread data\n", unread);
1374 memset(&uc, 0,
sizeof(uc));
1493 TRACE(
"(%p,%s,0x%08x,0x%08x,0x%08lx)\n", hFtpSession,
1509 if ((!lpszFileName) ||
1530 task->
access = fdwAccess;
1560 BOOL fFailIfExists,
DWORD dwLocalFlagsAttribute,
DWORD dwInternetFlags,
1569 ret =
FtpGetFileW(hInternet, lpwzRemoteFile, lpwzNewFile, fFailIfExists,
1570 dwLocalFlagsAttribute, dwInternetFlags, dwContext);
1611 BOOL fFailIfExists,
DWORD dwLocalFlagsAttribute,
DWORD dwInternetFlags,
1618 if (!lpszRemoteFile || !lpszNewFile)
1659 task->
flags = dwInternetFlags;
1667 fFailIfExists, dwLocalFlagsAttribute, dwInternetFlags, dwContext);
1688 BOOL fFailIfExists,
DWORD dwLocalFlagsAttribute,
DWORD dwInternetFlags,
1723 if (nResCode == 226)
1759 FIXME(
"(%p, %p)\n",
hFile, lpdwFileSizeHigh);
1761 if (lpdwFileSizeHigh)
1762 *lpdwFileSizeHigh = 0;
1882 TRACE(
"%p\n", lpwfs);
1893 if (nResCode == 250)
2035 if (nResCode == 250)
2187 if (nResCode == 350)
2195 if (nResCode == 250)
2224 TRACE(
"%p %d 0x%08x %s 0x%08lx %p\n", hConnect, fExpectResponse,
dwFlags,
2225 debugstr_a(lpszCommand), dwContext, phFtpCommand);
2227 if (fExpectResponse)
2229 FIXME(
"data connection not supported\n");
2233 if (!lpszCommand || !lpszCommand[0])
2261 INT nResCode, nRC = 0;
2263 TRACE(
"%p %d 0x%08x %s 0x%08lx %p\n", hConnect, fExpectResponse,
dwFlags,
2264 debugstr_w(lpszCommand), dwContext, phFtpCommand);
2266 if (!lpszCommand || !lpszCommand[0])
2272 if (fExpectResponse)
2274 FIXME(
"data connection not supported\n");
2310 while ((nBytesSent <
len) && (nRC != -1))
2316 TRACE(
"Sent %d bytes\n", nRC);
2323 if (nResCode > 0 && nResCode < 400)
2383 TRACE(
"INTERNET_OPTION_HANDLE_TYPE\n");
2431 DWORD dwInternalFlags)
2440 TRACE(
"%p Server(%s) Port(%d) User(%s) Paswd(%s)\n",
2479 FIXME(
"Several proxies not implemented.\n");
2481 FIXME(
"Proxy bypass is ignored.\n");
2483 if (!lpszUserName || !lpszUserName[0]) {
2500 TRACE(
"Password used for anonymous ftp : (%s)\n",
debugstr_w(szPassword));
2525 sock_namelen =
sizeof(socketAddr);
2540 szaddr,
strlen(szaddr)+1);
2551 szaddr,
strlen(szaddr)+1);
2553 if (
connect(nsocket, (
struct sockaddr *)&socketAddr, sock_namelen) < 0)
2561 TRACE(
"Connected to server\n");
2564 szaddr,
strlen(szaddr)+1);
2571 TRACE(
"Successfully logged into server\n");
2612 if (nResCode == 230)
2615 else if (nResCode == 331)
2618 else if (nResCode == 332)
2656 if (
sock_recv(nSocket, &lpszBuffer[nRecv], 1, 0) <= 0)
2662 if (lpszBuffer[nRecv] ==
'\n')
2664 lpszBuffer[nRecv] =
'\0';
2666 TRACE(
":%d %s\n", nRecv, lpszBuffer);
2669 if (lpszBuffer[nRecv] !=
'\r')
2697 DWORD nBytesSent = 0;
2708 dwParamLen = lpszParam?
strlen(lpszParam)+1:0;
2716 dwParamLen ? lpszParam :
"",
szCRLF);
2719 while((nBytesSent <
len) && (nRC != -1))
2729 &nBytesSent,
sizeof(
DWORD));
2732 TRACE(
"Sent %d bytes\n", nBytesSent);
2771 char firstprefix[5];
2787 if(lpszResponse[3] !=
'-')
2792 memcpy(firstprefix, lpszResponse, 3);
2793 firstprefix[3] =
' ';
2794 firstprefix[4] =
'\0';
2799 if(!
memcmp(firstprefix, lpszResponse, 4))
2807 rc =
atoi(lpszResponse);
2810 &nRecv,
sizeof(
DWORD));
2814 TRACE(
"return %d\n", rc);
2841 TRACE(
"Received reply code %d\n", nResCode);
2843 if (nResCode == 230)
2847 else if (nResCode == 332)
2919 if (nResCode == 150 || nResCode == 125)
2957 TRACE(
"Unable to create listening socket\n");
2969 TRACE(
"Unable to bind socket\n");
2975 TRACE(
"listen failed\n");
3057 if (nResCode == 213) {
3062 for (
i = 0; (lpszResponseBuffer[
i] !=
' ') && (lpszResponseBuffer[
i] !=
'\0');
i++) ;
3063 if (lpszResponseBuffer[
i] ==
'\0')
return FALSE;
3091 WCHAR szIPAddress[64];
3109 if (nResCode == 200)
3143 if (nResCode == 227)
3149 char *
pAddr, *pPort;
3153 p = lpszResponseBuffer+4;
3154 while (*
p !=
'\0' && (*
p <
'0' || *
p >
'9'))
p++;
3158 ERR(
"no address found in response, aborting\n");
3162 if (
sscanf(
p,
"%d,%d,%d,%d,%d,%d", &
f[0], &
f[1], &
f[2], &
f[3],
3165 ERR(
"unknown response address format '%s', aborting\n",
p);
3168 for (
i=0;
i < 6;
i++)
3173 pPort = (
char *)&(dataSocketAddress.
sin_port);
3185 if (
connect(nsocket, (
struct sockaddr *)&dataSocketAddress,
sizeof(dataSocketAddress)))
3187 ERR(
"can't connect passive FTP data port.\n");
3249 return *nDataSocket != -1;
3266 DWORD nBytesRead = 0;
3267 DWORD nBytesSent = 0;
3268 DWORD nTotalSent = 0;
3269 DWORD nBytesToSend, nLen;
3271 time_t s_long_time, e_long_time;
3284 nBytesToSend = nBytesRead - nBytesSent;
3286 if (nBytesToSend <= 0)
3291 ERR(
"Failed reading from file\n");
3294 nBytesToSend = nBytesRead;
3301 nRC =
sock_send(nDataSocket, lpszBuffer, nLen, 0);
3311 nSeconds = e_long_time - s_long_time;
3312 if( nSeconds / 60 > 0 )
3314 TRACE(
"%d bytes of %d bytes (%d%%) in %d min %d sec estimated remaining time %d sec\n",
3316 nSeconds % 60, (fi.
nFileSizeLow - nTotalSent) * nSeconds / nTotalSent );
3320 TRACE(
"%d bytes of %d bytes (%d%%) in %d sec estimated remaining time %d sec\n",
3322 (fi.
nFileSizeLow - nTotalSent) * nSeconds / nTotalSent);
3324 }
while (nRC != -1);
3326 TRACE(
"file transfer complete!\n");
3362 if ((nResCode != 125) && (nResCode != 150)) {
3391 DWORD nBytesWritten;
3398 if (
NULL == lpszBuffer)
3416 TRACE(
"Data transfer complete\n");
3437 for (
i = 0;
i < lpwfn->
size;
i++)
3493 TRACE(
"INTERNET_OPTION_HANDLE_TYPE\n");
3552 TRACE(
"(%p,%d,%s,%p,%08lx)\n", lpwfs, nSocket,
debugstr_w(lpszSearchFile), lpFindFileData, dwContext);
3566 lpwfn->
lpafp = lpafp;
3628 static const char szSpace[] =
" \t";
3641 pszToken =
strtok(pszLine, szSpace);
3651 for(
i=0;
i<=3;
i++) {
3655 if(!pszToken)
continue;
3657 TRACE(
"Is directory\n");
3661 TRACE(
"Size: %s\n", pszToken);
3674 if(!pszToken)
continue;
3675 if(
strlen(pszToken) >= 3) {
3682 if(!pszToken)
continue;
3686 if(!pszToken)
continue;
3687 if((pszTmp =
strchr(pszToken,
':'))) {
3700 TRACE(
"Mod time: %02d:%02d:%02d %04d/%02d/%02d\n",
3705 if(!pszToken)
continue;
3715 int mon, mday, year, hour,
min;
3718 sscanf(pszToken,
"%d-%d-%d", &mon, &mday, &year);
3727 if(!pszToken)
continue;
3731 if((pszToken[5] ==
'P') && (pszToken[6] ==
'M')) {
3736 TRACE(
"Mod time: %02d:%02d:%02d %04d/%02d/%02d\n",
3741 if(!pszToken)
continue;
3742 if(!
stricmp(pszToken,
"<DIR>")) {
3745 TRACE(
"Is directory\n");
3754 if(!pszToken)
continue;
3759 else if(pszToken[0] ==
'+') {
3760 FIXME(
"EPLF Format not implemented\n");
3764 if((lpszSearchFile ==
NULL) ||
3791 INT sizeFilePropArray = 500;
3792 INT indexFilePropArray = -1;
3797 *lpafp = heap_alloc_zero(
sizeof(
FILEPROPERTIESW)*(sizeFilePropArray));
3802 if (indexFilePropArray+1 >= sizeFilePropArray)
3806 sizeFilePropArray *= 2;
3807 tmpafp = heap_realloc_zero(*lpafp,
sizeof(
FILEPROPERTIESW)*sizeFilePropArray);
3816 indexFilePropArray++;
3817 }
while (
FTP_ParseNextFile(nSocket, lpszSearchFile, &(*lpafp)[indexFilePropArray]));
3819 if (
bSuccess && indexFilePropArray)
3821 if (indexFilePropArray < sizeFilePropArray - 1)
3829 *dwfp = indexFilePropArray;
3855 unsigned short nPermission = 0;
3860 if ((*lpszPermission !=
'd') && (*lpszPermission !=
'-') && (*lpszPermission !=
'l'))
3872 nPermission |= (*(lpszPermission+1) ==
'r' ? 1 : 0) << 8;
3875 nPermission |= (*(lpszPermission+2) ==
'w' ? 1 : 0) << 7;
3878 nPermission |= (*(lpszPermission+3) ==
'x' ? 1 : 0) << 6;
3881 nPermission |= (*(lpszPermission+4) ==
'r' ? 1 : 0) << 5;
3884 nPermission |= (*(lpszPermission+5) ==
'w' ? 1 : 0) << 4;
3887 nPermission |= (*(lpszPermission+6) ==
'x' ? 1 : 0) << 3;
3890 nPermission |= (*(lpszPermission+7) ==
'r' ? 1 : 0) << 2;
3893 nPermission |= (*(lpszPermission+8) ==
'w' ? 1 : 0) << 1;
3896 nPermission |= (*(lpszPermission+9) ==
'x' ? 1 : 0);
3900 }
while (nPos <= nLast);
char * strcat(char *DstString, const char *SrcString)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
char * strtok(char *String, const char *Delimiters)
char * strchr(const char *String, int ch)
static char * heap_strdupWtoA(const WCHAR *str)
static WCHAR * heap_strdupAtoW(const char *str)
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
static void * heap_realloc(void *mem, size_t len)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static void list_add_head(struct list_entry *head, struct list_entry *entry)
#define RegCloseKey(hKey)
#define ERROR_INSUFFICIENT_BUFFER
static int find_data(const struct Vector *v, const BYTE *pData, int size)
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
BOOL WINAPI GetUserNameW(LPWSTR lpszName, LPDWORD lpSize)
static WCHAR * heap_strdupW(const WCHAR *str)
LPSTR WINAPI StrStrIA(LPCSTR lpszStr, LPCSTR lpszSearch)
static WCHAR available[MAX_STRING_RESOURCE_LEN]
#define ERROR_INVALID_PARAMETER
#define ReadFile(a, b, c, d, e)
#define INVALID_HANDLE_VALUE
#define stricmp(_String1, _String2)
#define ERROR_NOT_SUPPORTED
#define ERROR_INVALID_HANDLE
#define FILE_ATTRIBUTE_NORMAL
#define WideCharToMultiByte
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI GetFileInformationByHandle(HANDLE hFile, LPBY_HANDLE_FILE_INFORMATION lpFileInformation)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
BOOL WINAPI SystemTimeToFileTime(IN CONST SYSTEMTIME *lpSystemTime, OUT LPFILETIME lpFileTime)
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
BOOL WINAPI PathMatchSpecW(LPCWSTR lpszPath, LPCWSTR lpszMask)
static int sock_send(int fd, const void *msg, size_t len, int flags)
static int sock_recv(int fd, void *msg, size_t len, int flags)
static BOOL FTP_FtpGetCurrentDirectoryW(ftp_session_t *, LPWSTR lpszCurrentDirectory, LPDWORD lpdwCurrentDirectory)
static BOOL FTP_GetDataSocket(ftp_session_t *, LPINT nDataSocket)
static const object_vtbl_t FTPSESSIONVtbl
BOOL WINAPI FtpRenameFileA(HINTERNET hFtpSession, LPCSTR lpszSrc, LPCSTR lpszDest)
BOOL WINAPI FtpRemoveDirectoryW(HINTERNET hFtpSession, LPCWSTR lpszDirectory)
static DWORD FTPFINDNEXT_FindNextFileProc(WININETFTPFINDNEXTW *find, LPVOID data)
static void AsyncFtpRemoveDirectoryProc(task_header_t *hdr)
DWORD WINAPI FtpGetFileSize(HINTERNET hFile, LPDWORD lpdwFileSizeHigh)
BOOL WINAPI FtpRenameFileW(HINTERNET hFtpSession, LPCWSTR lpszSrc, LPCWSTR lpszDest)
static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERTIESW fileprop)
static const CHAR *const szFtpCommands[]
static const CHAR szMonths[]
BOOL WINAPI FtpCommandW(HINTERNET hConnect, BOOL fExpectResponse, DWORD dwFlags, LPCWSTR lpszCommand, DWORD_PTR dwContext, HINTERNET *phFtpCommand)
static void AsyncFtpPutFileProc(task_header_t *hdr)
BOOL WINAPI FtpCreateDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory)
BOOL WINAPI FtpGetFileW(HINTERNET hInternet, LPCWSTR lpszRemoteFile, LPCWSTR lpszNewFile, BOOL fFailIfExists, DWORD dwLocalFlagsAttribute, DWORD dwInternetFlags, DWORD_PTR dwContext)
HINTERNET WINAPI FtpFindFirstFileA(HINTERNET hConnect, LPCSTR lpszSearchFile, LPWIN32_FIND_DATAA lpFindFileData, DWORD dwFlags, DWORD_PTR dwContext)
static BOOL FTP_SendPassword(ftp_session_t *)
static DWORD FTP_SetResponseError(DWORD dwResponse)
static BOOL FTP_DoPassive(ftp_session_t *)
static void AsyncFtpGetFileProc(task_header_t *hdr)
BOOL WINAPI FtpSetCurrentDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory)
HINTERNET WINAPI FtpOpenFileW(HINTERNET hFtpSession, LPCWSTR lpszFileName, DWORD fdwAccess, DWORD dwFlags, DWORD_PTR dwContext)
static BOOL FTP_SendType(ftp_session_t *, DWORD dwType)
HINTERNET WINAPI FtpOpenFileA(HINTERNET hFtpSession, LPCSTR lpszFileName, DWORD fdwAccess, DWORD dwFlags, DWORD_PTR dwContext)
static BOOL FTP_ParsePermission(LPCSTR lpszPermission, LPFILEPROPERTIESW lpfp)
static BOOL FTP_SendPort(ftp_session_t *)
BOOL WINAPI FtpPutFileA(HINTERNET hConnect, LPCSTR lpszLocalFile, LPCSTR lpszNewRemoteFile, DWORD dwFlags, DWORD_PTR dwContext)
static DWORD FTPFILE_QueryOption(object_header_t *hdr, DWORD option, void *buffer, DWORD *size, BOOL unicode)
BOOL WINAPI FtpCreateDirectoryW(HINTERNET hConnect, LPCWSTR lpszDirectory)
static LPSTR FTP_GetNextLine(INT nSocket, LPDWORD dwLen)
static const object_vtbl_t FTPFINDNEXTVtbl
static BOOL FTP_InitListenSocket(ftp_session_t *)
static void AsyncFtpCreateDirectoryProc(task_header_t *hdr)
BOOL WINAPI FtpDeleteFileW(HINTERNET hFtpSession, LPCWSTR lpszFileName)
static BOOL res_to_le(DWORD res)
BOOL WINAPI FtpSetCurrentDirectoryW(HINTERNET hConnect, LPCWSTR lpszDirectory)
static BOOL FTP_SendAccount(ftp_session_t *)
static void FTP_ReceiveRequestData(ftp_file_t *file, BOOL first_notif)
static DWORD FTPFINDNEXT_QueryOption(object_header_t *hdr, DWORD option, void *buffer, DWORD *size, BOOL unicode)
static void AsyncFtpDeleteFileProc(task_header_t *hdr)
static void AsyncFtpSetCurrentDirectoryProc(task_header_t *hdr)
static BOOL FTP_SendData(ftp_session_t *, INT nDataSocket, HANDLE hFile)
static DWORD FTPFINDNEXT_FindNextFileW(object_header_t *hdr, void *data)
static BOOL FTP_ParseDirectory(ftp_session_t *, INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERTIESW *lpafp, LPDWORD dwfp)
static HINTERNET FTP_FtpFindFirstFileW(ftp_session_t *, LPCWSTR lpszSearchFile, LPWIN32_FIND_DATAW lpFindFileData, DWORD dwFlags, DWORD_PTR dwContext)
static void AsyncFtpOpenFileProc(task_header_t *hdr)
static DWORD FTPFILE_QueryDataAvailable(object_header_t *hdr, DWORD *available, DWORD flags, DWORD_PTR ctx)
static DWORD FTPFILE_ReadFile(object_header_t *hdr, void *buffer, DWORD size, DWORD *read, DWORD flags, DWORD_PTR context)
HINTERNET WINAPI FtpFindFirstFileW(HINTERNET hConnect, LPCWSTR lpszSearchFile, LPWIN32_FIND_DATAW lpFindFileData, DWORD dwFlags, DWORD_PTR dwContext)
static BOOL FTP_SendCommand(INT nSocket, FTP_COMMAND ftpCmd, LPCWSTR lpszParam, INTERNET_STATUS_CALLBACK lpfnStatusCB, object_header_t *hdr, DWORD_PTR dwContext)
static BOOL FTP_FtpDeleteFileW(ftp_session_t *, LPCWSTR lpszFileName)
static void AsyncFtpRenameFileProc(task_header_t *hdr)
static HINTERNET FTP_ReceiveFileList(ftp_session_t *, INT nSocket, LPCWSTR lpszSearchFile, LPWIN32_FIND_DATAW lpFindFileData, DWORD_PTR dwContext)
static HINTERNET FTP_FtpOpenFileW(ftp_session_t *lpwfs, LPCWSTR lpszFileName, DWORD fdwAccess, DWORD dwFlags, DWORD_PTR dwContext)
static BOOL FTP_SendPortOrPasv(ftp_session_t *)
BOOL WINAPI FtpRemoveDirectoryA(HINTERNET hFtpSession, LPCSTR lpszDirectory)
static const object_vtbl_t FTPFILEVtbl
HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName, INTERNET_PORT nServerPort, LPCWSTR lpszUserName, LPCWSTR lpszPassword, DWORD dwFlags, DWORD_PTR dwContext, DWORD dwInternalFlags)
BOOL WINAPI FtpDeleteFileA(HINTERNET hFtpSession, LPCSTR lpszFileName)
struct WININETFTPFINDNEXTW * LPWININETFTPFINDNEXTW
static BOOL FTP_FtpRenameFileW(ftp_session_t *, LPCWSTR lpszSrc, LPCWSTR lpszDest)
static void FTPSESSION_Destroy(object_header_t *hdr)
BOOL WINAPI FtpPutFileW(HINTERNET hConnect, LPCWSTR lpszLocalFile, LPCWSTR lpszNewRemoteFile, DWORD dwFlags, DWORD_PTR dwContext)
BOOL WINAPI FtpGetCurrentDirectoryW(HINTERNET hFtpSession, LPWSTR lpszCurrentDirectory, LPDWORD lpdwCurrentDirectory)
static BOOL FTP_FtpSetCurrentDirectoryW(ftp_session_t *, LPCWSTR lpszDirectory)
static BOOL FTP_FtpRemoveDirectoryW(ftp_session_t *, LPCWSTR lpszDirectory)
static void FTPFILE_AsyncQueryDataAvailableProc(task_header_t *task)
static BOOL FTP_SendCommandA(INT nSocket, FTP_COMMAND ftpCmd, LPCSTR lpszParam, INTERNET_STATUS_CALLBACK lpfnStatusCB, object_header_t *hdr, DWORD_PTR dwContext)
static DWORD FTPFILE_LockRequestFile(object_header_t *hdr, req_file_t **ret)
#define FTP_CONDITION_MASK
static DWORD FTPFILE_WriteFile(object_header_t *hdr, const void *buffer, DWORD size, DWORD *written)
static DWORD FTPSESSION_QueryOption(object_header_t *hdr, DWORD option, void *buffer, DWORD *size, BOOL unicode)
BOOL WINAPI FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrentDirectory, LPDWORD lpdwCurrentDirectory)
static void AsyncFtpFindFirstFileProc(task_header_t *hdr)
static BOOL FTP_FtpPutFileW(ftp_session_t *, LPCWSTR lpszLocalFile, LPCWSTR lpszNewRemoteFile, DWORD dwFlags, DWORD_PTR dwContext)
BOOL WINAPI FtpCommandA(HINTERNET hConnect, BOOL fExpectResponse, DWORD dwFlags, LPCSTR lpszCommand, DWORD_PTR dwContext, HINTERNET *phFtpCommand)
static BOOL FTP_FtpGetFileW(ftp_session_t *, LPCWSTR lpszRemoteFile, LPCWSTR lpszNewFile, BOOL fFailIfExists, DWORD dwLocalFlagsAttribute, DWORD dwInternetFlags, DWORD_PTR dwContext)
static INT FTP_ReceiveResponse(ftp_session_t *, DWORD_PTR dwContext)
static void FTPFILE_Destroy(object_header_t *hdr)
static void FTPFINDNEXT_Destroy(object_header_t *hdr)
static BOOL FTP_SendStore(ftp_session_t *, LPCWSTR lpszRemoteFile, DWORD dwType)
static BOOL FTP_ConvertFileProp(LPFILEPROPERTIESW lpafp, LPWIN32_FIND_DATAW lpFindFileData)
static BOOL FTP_SendRetrieve(ftp_session_t *, LPCWSTR lpszRemoteFile, DWORD dwType)
static void FTPFINDNEXT_AsyncFindNextFileProc(task_header_t *hdr)
static BOOL FTP_RetrieveFileData(ftp_session_t *, INT nDataSocket, HANDLE hFile)
static void AsyncFtpGetCurrentDirectoryProc(task_header_t *hdr)
BOOL WINAPI FtpGetFileA(HINTERNET hInternet, LPCSTR lpszRemoteFile, LPCSTR lpszNewFile, BOOL fFailIfExists, DWORD dwLocalFlagsAttribute, DWORD dwInternetFlags, DWORD_PTR dwContext)
static BOOL FTP_ConnectToHost(ftp_session_t *)
static void FTPSESSION_CloseConnection(object_header_t *hdr)
struct FILEPROPERTIESW * LPFILEPROPERTIESW
static BOOL FTP_FtpCreateDirectoryW(ftp_session_t *, LPCWSTR lpszDirectory)
BOOL WININET_Release(object_header_t *info)
DWORD INTERNET_AsyncCall(task_header_t *task)
object_header_t * WININET_AddRef(object_header_t *info)
DWORD INTERNET_GetLastError(void)
LPSTR INTERNET_GetResponseBuffer(void)
void INTERNET_SetLastError(DWORD dwError)
BOOL WINAPI InternetCreateUrlW(LPURL_COMPONENTSW lpUrlComponents, DWORD dwFlags, LPWSTR lpszUrl, LPDWORD lpdwUrlLength)
DWORD INET_SetOption(object_header_t *hdr, DWORD option, void *buf, DWORD size)
void * alloc_async_task(object_header_t *hdr, async_task_proc_t proc, size_t size)
object_header_t * get_handle_object(HINTERNET hinternet)
DWORD INET_QueryOption(object_header_t *hdr, DWORD option, void *buffer, DWORD *size, BOOL unicode)
void * alloc_object(object_header_t *parent, const object_vtbl_t *vtbl, size_t size)
BOOL WINAPI CreateUrlCacheEntryW(LPCWSTR lpszUrlName, DWORD dwExpectedFileSize, LPCWSTR lpszFileExtension, LPWSTR lpszFileName, DWORD dwReserved)
INT WSAAPI select(IN INT s, IN OUT LPFD_SET readfds, IN OUT LPFD_SET writefds, IN OUT LPFD_SET exceptfds, IN CONST struct timeval *timeout)
PWDF_CHILD_ADDRESS_DESCRIPTION_HEADER pAddr
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble r
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
_Check_return_ long __cdecl atol(_In_z_ const char *_Str)
static void WININET_find_data_WtoA(LPWIN32_FIND_DATAW dataW, LPWIN32_FIND_DATAA dataA)
void init_winsock(void) DECLSPEC_HIDDEN
BOOL GetAddress(const WCHAR *, INTERNET_PORT, SOCKADDR *, int *, char *) DECLSPEC_HIDDEN
VOID INTERNET_SendCallback(object_header_t *hdr, DWORD_PTR dwContext, DWORD dwInternetStatus, LPVOID lpvStatusInfo, DWORD dwStatusInfoLength) DECLSPEC_HIDDEN
#define memcpy(s1, s2, n)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
#define sprintf(buf, format,...)
#define FILE_ATTRIBUTE_DIRECTORY
INT WSAAPI getsockname(IN SOCKET s, OUT LPSOCKADDR name, IN OUT INT FAR *namelen)
INT WSAAPI listen(IN SOCKET s, IN INT backlog)
INT WSAAPI bind(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
SOCKET WSAAPI accept(IN SOCKET s, OUT LPSOCKADDR addr, OUT INT FAR *addrlen)
SOCKET WSAAPI socket(IN INT af, IN INT type, IN INT protocol)
SYSTEMTIME tmLastModified
unsigned short permissions
ftp_session_t * lpFtpSession
WCHAR cFileName[MAX_PATH]
FILETIME ftLastAccessTime
ftp_file_t * download_in_progress
struct sockaddr_in lstnSocketAddress
struct sockaddr_in socketAddress
WIN32_FIND_DATAW * find_file_data
WIN32_FIND_DATAW * find_data
ftp_session_t * lpFtpSession
DWORD WINAPI GetLastError(void)
_In_opt_ LPSTR _In_opt_ LPSTR lpszPassword
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
#define ERROR_NO_MORE_FILES
#define INTERNET_SCHEME_FTP
#define INTERNET_DEFAULT_FTP_PORT
#define INTERNET_STATUS_RECEIVING_RESPONSE
#define ERROR_INTERNET_EXTENDED_ERROR
#define INTERNET_STATUS_CONNECTION_CLOSED
#define INTERNET_ERROR_BASE
#define INTERNET_FLAG_TRANSFER_ASCII
#define INTERNET_FLAG_ASYNC
#define INTERNET_STATUS_REQUEST_SENT
VOID(CALLBACK * INTERNET_STATUS_CALLBACK)(_In_ HINTERNET, _In_opt_ DWORD_PTR, _In_ DWORD, _In_opt_ LPVOID, _In_ DWORD)
#define ERROR_INTERNET_ITEM_NOT_FOUND
#define INTERNET_FLAG_PASSIVE
#define FTP_TRANSFER_TYPE_BINARY
#define ERROR_INTERNET_TIMEOUT
#define INTERNET_STATUS_SENDING_REQUEST
#define INTERNET_OPTION_DATAFILE_NAME
#define ERROR_INTERNET_DISCONNECTED
#define ERROR_INTERNET_CONNECTION_ABORTED
#define INTERNET_HANDLE_TYPE_FTP_FIND
#define INTERNET_STATUS_RESOLVING_NAME
#define ERROR_INTERNET_LOGIN_FAILURE
#define INTERNET_STATUS_RESPONSE_RECEIVED
#define INTERNET_STATUS_REQUEST_COMPLETE
#define INTERNET_STATUS_CONNECTING_TO_SERVER
#define ERROR_FTP_TRANSFER_IN_PROGRESS
#define INTERNET_OPEN_TYPE_PROXY
#define INTERNET_INVALID_PORT_NUMBER
#define INTERNET_STATUS_HANDLE_CREATED
#define ERROR_INTERNET_CANNOT_CONNECT
#define INTERNET_HANDLE_TYPE_CONNECT_FTP
#define ERROR_INTERNET_NAME_NOT_RESOLVED
#define INTERNET_STATUS_CONNECTED_TO_SERVER
#define INTERNET_STATUS_NAME_RESOLVED
#define INTERNET_OPTION_HANDLE_TYPE
#define INTERNET_HANDLE_TYPE_FTP_FILE
#define ERROR_INTERNET_INCORRECT_HANDLE_TYPE
#define INTERNET_STATUS_CLOSING_CONNECTION
#define HKEY_CURRENT_USER
int PASCAL FAR WSAGetLastError(void)