Sync wininet with Wine. This fixes the Download! issue.

As we implement some more functions in the network stack now, I could remove some hacks from the "wininet_ros.diff" file.
Anyways, the following things still needed to be changed:
- Pass a variable to WriteFile for receiving the number of bytes written. This parameter is not checked for NULL in ReactOS and Windows, when lpOverlapped is also NULL.
  I'll submit a patch about this to Wine as well.
- Replace Unix poll() calls by equivalent select() calls
- Bypass sock_get_error(), directly call WSAGetLastError() as we don't have to translate Unix socket errors.

See issue #3197 for more details.

svn path=/trunk/; revision=33788
This commit is contained in:
Colin Finck
2008-05-31 13:02:59 +00:00
parent c446f5ff58
commit bdec9df44c
16 changed files with 2478 additions and 1789 deletions

View File

@@ -544,10 +544,12 @@ BOOL WINAPI InternetSetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName,
DWORD WINAPI InternetSetCookieExA( LPCSTR lpszURL, LPCSTR lpszCookieName, LPCSTR lpszCookieData,
DWORD dwFlags, DWORD_PTR dwReserved)
{
FIXME("(%s, %s, %s, 0x%08x, 0x%08lx) stub\n",
TRACE("(%s, %s, %s, 0x%08x, 0x%08lx)\n",
debugstr_a(lpszURL), debugstr_a(lpszCookieName), debugstr_a(lpszCookieData),
dwFlags, dwReserved);
return TRUE;
if (dwFlags) FIXME("flags 0x%08x not supported\n", dwFlags);
return InternetSetCookieA(lpszURL, lpszCookieName, lpszCookieData);
}
/***********************************************************************
@@ -563,10 +565,12 @@ DWORD WINAPI InternetSetCookieExA( LPCSTR lpszURL, LPCSTR lpszCookieName, LPCSTR
DWORD WINAPI InternetSetCookieExW( LPCWSTR lpszURL, LPCWSTR lpszCookieName, LPCWSTR lpszCookieData,
DWORD dwFlags, DWORD_PTR dwReserved)
{
FIXME("(%s, %s, %s, 0x%08x, 0x%08lx) stub\n",
TRACE("(%s, %s, %s, 0x%08x, 0x%08lx)\n",
debugstr_w(lpszURL), debugstr_w(lpszCookieName), debugstr_w(lpszCookieData),
dwFlags, dwReserved);
return TRUE;
if (dwFlags) FIXME("flags 0x%08x not supported\n", dwFlags);
return InternetSetCookieW(lpszURL, lpszCookieName, lpszCookieData);
}
/***********************************************************************
@@ -577,10 +581,12 @@ DWORD WINAPI InternetSetCookieExW( LPCWSTR lpszURL, LPCWSTR lpszCookieName, LPCW
BOOL WINAPI InternetGetCookieExA( LPCSTR pchURL, LPCSTR pchCookieName, LPSTR pchCookieData,
LPDWORD pcchCookieData, DWORD dwFlags, LPVOID lpReserved)
{
FIXME("(%s, %s, %s, %p, 0x%08x, %p) stub\n",
TRACE("(%s, %s, %s, %p, 0x%08x, %p)\n",
debugstr_a(pchURL), debugstr_a(pchCookieName), debugstr_a(pchCookieData),
pcchCookieData, dwFlags, lpReserved);
return FALSE;
if (dwFlags) FIXME("flags 0x%08x not supported\n", dwFlags);
return InternetGetCookieA(pchURL, pchCookieName, pchCookieData, pcchCookieData);
}
/***********************************************************************
@@ -596,10 +602,12 @@ BOOL WINAPI InternetGetCookieExA( LPCSTR pchURL, LPCSTR pchCookieName, LPSTR pch
BOOL WINAPI InternetGetCookieExW( LPCWSTR pchURL, LPCWSTR pchCookieName, LPWSTR pchCookieData,
LPDWORD pcchCookieData, DWORD dwFlags, LPVOID lpReserved)
{
FIXME("(%s, %s, %s, %p, 0x%08x, %p) stub\n",
TRACE("(%s, %s, %s, %p, 0x%08x, %p)\n",
debugstr_w(pchURL), debugstr_w(pchCookieName), debugstr_w(pchCookieData),
pcchCookieData, dwFlags, lpReserved);
return FALSE;
if (dwFlags) FIXME("flags 0x%08x not supported\n", dwFlags);
return InternetGetCookieW(pchURL, pchCookieName, pchCookieData, pcchCookieData);
}
/***********************************************************************

View File

@@ -58,10 +58,51 @@
#include "wine/debug.h"
#include "internet.h"
typedef size_t socklen_t;
WINE_DEFAULT_DEBUG_CHANNEL(wininet);
typedef struct _WININETFTPSESSIONW WININETFTPSESSIONW;
typedef struct
{
WININETHANDLEHEADER hdr;
WININETFTPSESSIONW *lpFtpSession;
BOOL session_deleted;
int nDataSocket;
} WININETFTPFILE, *LPWININETFTPFILE;
typedef struct _WININETFTPSESSIONW
{
WININETHANDLEHEADER hdr;
WININETAPPINFOW *lpAppInfo;
int sndSocket;
int lstnSocket;
int pasvSocket; /* data socket connected by us in case of passive FTP */
LPWININETFTPFILE download_in_progress;
struct sockaddr_in socketAddress;
struct sockaddr_in lstnSocketAddress;
LPWSTR lpszPassword;
LPWSTR lpszUserName;
} *LPWININETFTPSESSIONW;
typedef struct
{
BOOL bIsDirectory;
LPWSTR lpszName;
DWORD nSize;
struct tm tmLastModified;
unsigned short permissions;
} FILEPROPERTIESW, *LPFILEPROPERTIESW;
typedef struct
{
WININETHANDLEHEADER hdr;
WININETFTPSESSIONW *lpFtpSession;
DWORD index;
DWORD size;
LPFILEPROPERTIESW lpafp;
} WININETFTPFINDNEXTW, *LPWININETFTPFINDNEXTW;
#define DATA_PACKET_SIZE 0x2000
#define szCRLF "\r\n"
#define MAX_BACKLOG 5
@@ -123,10 +164,6 @@ static const CHAR *const szFtpCommands[] = {
static const CHAR szMonths[] = "JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC";
static const WCHAR szNoAccount[] = {'n','o','a','c','c','o','u','n','t','\0'};
static void FTP_CloseFileTransferHandle(LPWININETHANDLEHEADER hdr);
static void FTP_CloseSessionHandle(LPWININETHANDLEHEADER hdr);
static void FTP_CloseConnection(LPWININETHANDLEHEADER hdr);
static void FTP_CloseFindNextHandle(LPWININETHANDLEHEADER hdr);
static BOOL FTP_SendCommand(INT nSocket, FTP_COMMAND ftpCmd, LPCWSTR lpszParam,
INTERNET_STATUS_CALLBACK lpfnStatusCB, LPWININETHANDLEHEADER hdr, DWORD_PTR dwContext);
static BOOL FTP_SendStore(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszRemoteFile, DWORD dwType);
@@ -146,10 +183,28 @@ static BOOL FTP_SendPortOrPasv(LPWININETFTPSESSIONW lpwfs);
static BOOL FTP_ParsePermission(LPCSTR lpszPermission, LPFILEPROPERTIESW lpfp);
static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERTIESW fileprop);
static BOOL FTP_ParseDirectory(LPWININETFTPSESSIONW lpwfs, INT nSocket, LPCWSTR lpszSearchFile,
LPFILEPROPERTIESW *lpafp, LPDWORD dwfp);
LPFILEPROPERTIESW *lpafp, LPDWORD dwfp);
static HINTERNET FTP_ReceiveFileList(LPWININETFTPSESSIONW lpwfs, INT nSocket, LPCWSTR lpszSearchFile,
LPWIN32_FIND_DATAW lpFindFileData, DWORD_PTR dwContext);
LPWIN32_FIND_DATAW lpFindFileData, DWORD_PTR dwContext);
static DWORD FTP_SetResponseError(DWORD dwResponse);
static BOOL FTP_ConvertFileProp(LPFILEPROPERTIESW lpafp, LPWIN32_FIND_DATAW lpFindFileData);
static BOOL FTP_FtpPutFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszLocalFile,
LPCWSTR lpszNewRemoteFile, DWORD dwFlags, DWORD_PTR dwContext);
static BOOL FTP_FtpSetCurrentDirectoryW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszDirectory);
static BOOL FTP_FtpCreateDirectoryW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszDirectory);
static HINTERNET FTP_FtpFindFirstFileW(LPWININETFTPSESSIONW lpwfs,
LPCWSTR lpszSearchFile, LPWIN32_FIND_DATAW lpFindFileData, DWORD dwFlags, DWORD_PTR dwContext);
static BOOL FTP_FtpGetCurrentDirectoryW(LPWININETFTPSESSIONW lpwfs, LPWSTR lpszCurrentDirectory,
LPDWORD lpdwCurrentDirectory);
static BOOL FTP_FtpRenameFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszSrc, LPCWSTR lpszDest);
static BOOL FTP_FtpRemoveDirectoryW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszDirectory);
static BOOL FTP_FtpDeleteFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszFileName);
static HINTERNET FTP_FtpOpenFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszFileName,
DWORD fdwAccess, DWORD dwFlags, DWORD_PTR dwContext);
static BOOL FTP_FtpGetFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszRemoteFile, LPCWSTR lpszNewFile,
BOOL fFailIfExists, DWORD dwLocalFlagsAttribute, DWORD dwInternetFlags,
DWORD_PTR dwContext);
/***********************************************************************
* FtpPutFileA (WININET.@)
@@ -276,7 +331,7 @@ lend:
* FALSE on failure
*
*/
BOOL WINAPI FTP_FtpPutFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszLocalFile,
static BOOL FTP_FtpPutFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszLocalFile,
LPCWSTR lpszNewRemoteFile, DWORD dwFlags, DWORD_PTR dwContext)
{
HANDLE hFile;
@@ -444,7 +499,7 @@ lend:
* FALSE on failure
*
*/
BOOL WINAPI FTP_FtpSetCurrentDirectoryW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszDirectory)
static BOOL FTP_FtpSetCurrentDirectoryW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszDirectory)
{
INT nResCode;
LPWININETAPPINFOW hIC = NULL;
@@ -475,7 +530,7 @@ lend:
{
INTERNET_ASYNC_RESULT iar;
iar.dwResult = (DWORD)bSuccess;
iar.dwResult = bSuccess;
iar.dwError = bSuccess ? ERROR_SUCCESS : ERROR_INTERNET_EXTENDED_ERROR;
SendAsyncCallback(&lpwfs->hdr, lpwfs->hdr.dwContext, INTERNET_STATUS_REQUEST_COMPLETE,
&iar, sizeof(INTERNET_ASYNC_RESULT));
@@ -592,7 +647,7 @@ lend:
* FALSE on failure
*
*/
BOOL WINAPI FTP_FtpCreateDirectoryW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszDirectory)
static BOOL FTP_FtpCreateDirectoryW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszDirectory)
{
INT nResCode;
BOOL bSuccess = FALSE;
@@ -742,7 +797,7 @@ lend:
* NULL on failure
*
*/
HINTERNET WINAPI FTP_FtpFindFirstFileW(LPWININETFTPSESSIONW lpwfs,
static HINTERNET FTP_FtpFindFirstFileW(LPWININETFTPSESSIONW lpwfs,
LPCWSTR lpszSearchFile, LPWIN32_FIND_DATAW lpFindFileData, DWORD dwFlags, DWORD_PTR dwContext)
{
INT nResCode;
@@ -882,7 +937,7 @@ BOOL WINAPI FtpGetCurrentDirectoryW(HINTERNET hFtpSession, LPWSTR lpszCurrentDir
LPWININETAPPINFOW hIC = NULL;
BOOL r = FALSE;
TRACE("len(%d)\n", *lpdwCurrentDirectory);
TRACE("%p %p %p\n", hFtpSession, lpszCurrentDirectory, lpdwCurrentDirectory);
lpwfs = (LPWININETFTPSESSIONW) WININET_GetObject( hFtpSession );
if (NULL == lpwfs)
@@ -953,15 +1008,13 @@ lend:
* FALSE on failure
*
*/
BOOL WINAPI FTP_FtpGetCurrentDirectoryW(LPWININETFTPSESSIONW lpwfs, LPWSTR lpszCurrentDirectory,
static BOOL FTP_FtpGetCurrentDirectoryW(LPWININETFTPSESSIONW lpwfs, LPWSTR lpszCurrentDirectory,
LPDWORD lpdwCurrentDirectory)
{
INT nResCode;
LPWININETAPPINFOW hIC = NULL;
DWORD bSuccess = FALSE;
TRACE("len(%d)\n", *lpdwCurrentDirectory);
/* Clear any error information */
INTERNET_SetLastError(0);
@@ -1009,13 +1062,13 @@ lend:
{
INTERNET_ASYNC_RESULT iar;
iar.dwResult = (DWORD)bSuccess;
iar.dwResult = bSuccess;
iar.dwError = bSuccess ? ERROR_SUCCESS : ERROR_INTERNET_EXTENDED_ERROR;
SendAsyncCallback(&lpwfs->hdr, lpwfs->hdr.dwContext, INTERNET_STATUS_REQUEST_COMPLETE,
&iar, sizeof(INTERNET_ASYNC_RESULT));
}
return (DWORD) bSuccess;
return bSuccess;
}
/***********************************************************************
@@ -1131,6 +1184,91 @@ lend:
}
/***********************************************************************
* FTPFILE_Destroy(internal)
*
* Closes the file transfer handle. This also 'cleans' the data queue of
* the 'transfer complete' message (this is a bit of a hack though :-/ )
*
*/
static void FTPFILE_Destroy(WININETHANDLEHEADER *hdr)
{
LPWININETFTPFILE lpwh = (LPWININETFTPFILE) hdr;
LPWININETFTPSESSIONW lpwfs = lpwh->lpFtpSession;
INT nResCode;
TRACE("\n");
WININET_Release(&lpwh->lpFtpSession->hdr);
if (!lpwh->session_deleted)
lpwfs->download_in_progress = NULL;
if (lpwh->nDataSocket != -1)
closesocket(lpwh->nDataSocket);
nResCode = FTP_ReceiveResponse(lpwfs, lpwfs->hdr.dwContext);
if (nResCode > 0 && nResCode != 226) WARN("server reports failed transfer\n");
HeapFree(GetProcessHeap(), 0, lpwh);
}
static DWORD FTPFILE_QueryOption(WININETHANDLEHEADER *hdr, DWORD option, void *buffer, DWORD *size, BOOL unicode)
{
switch(option) {
case INTERNET_OPTION_HANDLE_TYPE:
TRACE("INTERNET_OPTION_HANDLE_TYPE\n");
if (*size < sizeof(ULONG))
return ERROR_INSUFFICIENT_BUFFER;
*size = sizeof(DWORD);
*(DWORD*)buffer = INTERNET_HANDLE_TYPE_FTP_FILE;
return ERROR_SUCCESS;
}
FIXME("Not implemented option %d\n", option);
return ERROR_INTERNET_INVALID_OPTION;
}
static DWORD FTPFILE_ReadFile(WININETHANDLEHEADER *hdr, void *buffer, DWORD size, DWORD *read)
{
WININETFTPFILE *file = (WININETFTPFILE*)hdr;
int res;
if (file->nDataSocket == -1)
return ERROR_INTERNET_DISCONNECTED;
/* FIXME: FTP should use NETCON_ stuff */
res = recv(file->nDataSocket, buffer, size, MSG_WAITALL);
*read = res>0 ? res : 0;
return res>=0 ? ERROR_SUCCESS : INTERNET_ERROR_BASE; /* FIXME*/
}
static BOOL FTPFILE_WriteFile(WININETHANDLEHEADER *hdr, const void *buffer, DWORD size, DWORD *written)
{
LPWININETFTPFILE lpwh = (LPWININETFTPFILE) hdr;
int res;
res = send(lpwh->nDataSocket, buffer, size, 0);
*written = res>0 ? res : 0;
return res >= 0;
}
static const HANDLEHEADERVtbl FTPFILEVtbl = {
FTPFILE_Destroy,
NULL,
FTPFILE_QueryOption,
NULL,
FTPFILE_ReadFile,
NULL,
FTPFILE_WriteFile,
NULL,
NULL
};
/***********************************************************************
* FTP_FtpOpenFileW (Internal)
*
@@ -1172,11 +1310,10 @@ HINTERNET FTP_FtpOpenFileW(LPWININETFTPSESSIONW lpwfs,
{
lpwh = HeapAlloc(GetProcessHeap(), 0, sizeof(WININETFTPFILE));
lpwh->hdr.htype = WH_HFILE;
lpwh->hdr.vtbl = &FTPFILEVtbl;
lpwh->hdr.dwFlags = dwFlags;
lpwh->hdr.dwContext = dwContext;
lpwh->hdr.dwRefCount = 1;
lpwh->hdr.close_connection = NULL;
lpwh->hdr.destroy = FTP_CloseFileTransferHandle;
lpwh->hdr.refs = 1;
lpwh->hdr.lpfnStatusCB = lpwfs->hdr.lpfnStatusCB;
lpwh->nDataSocket = nDataSocket;
lpwh->session_deleted = FALSE;
@@ -1356,7 +1493,7 @@ lend:
* FALSE on failure
*
*/
BOOL WINAPI FTP_FtpGetFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszRemoteFile, LPCWSTR lpszNewFile,
static BOOL FTP_FtpGetFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszRemoteFile, LPCWSTR lpszNewFile,
BOOL fFailIfExists, DWORD dwLocalFlagsAttribute, DWORD dwInternetFlags,
DWORD_PTR dwContext)
{
@@ -1999,6 +2136,81 @@ lend:
return r;
}
/***********************************************************************
* FTPSESSION_Destroy (internal)
*
* Deallocate session handle
*/
static void FTPSESSION_Destroy(WININETHANDLEHEADER *hdr)
{
LPWININETFTPSESSIONW lpwfs = (LPWININETFTPSESSIONW) hdr;
TRACE("\n");
WININET_Release(&lpwfs->lpAppInfo->hdr);
HeapFree(GetProcessHeap(), 0, lpwfs->lpszPassword);
HeapFree(GetProcessHeap(), 0, lpwfs->lpszUserName);
HeapFree(GetProcessHeap(), 0, lpwfs);
}
static void FTPSESSION_CloseConnection(WININETHANDLEHEADER *hdr)
{
LPWININETFTPSESSIONW lpwfs = (LPWININETFTPSESSIONW) hdr;
TRACE("\n");
SendAsyncCallback(&lpwfs->hdr, lpwfs->hdr.dwContext,
INTERNET_STATUS_CLOSING_CONNECTION, 0, 0);
if (lpwfs->download_in_progress != NULL)
lpwfs->download_in_progress->session_deleted = TRUE;
if (lpwfs->sndSocket != -1)
closesocket(lpwfs->sndSocket);
if (lpwfs->lstnSocket != -1)
closesocket(lpwfs->lstnSocket);
if (lpwfs->pasvSocket != -1)
closesocket(lpwfs->pasvSocket);
SendAsyncCallback(&lpwfs->hdr, lpwfs->hdr.dwContext,
INTERNET_STATUS_CONNECTION_CLOSED, 0, 0);
}
static DWORD FTPSESSION_QueryOption(WININETHANDLEHEADER *hdr, DWORD option, void *buffer, DWORD *size, BOOL unicode)
{
switch(option) {
case INTERNET_OPTION_HANDLE_TYPE:
TRACE("INTERNET_OPTION_HANDLE_TYPE\n");
if (*size < sizeof(ULONG))
return ERROR_INSUFFICIENT_BUFFER;
*size = sizeof(DWORD);
*(DWORD*)buffer = INTERNET_HANDLE_TYPE_CONNECT_FTP;
return ERROR_SUCCESS;
}
FIXME("Not implemented option %d\n", option);
return ERROR_INTERNET_INVALID_OPTION;
}
static const HANDLEHEADERVtbl FTPSESSIONVtbl = {
FTPSESSION_Destroy,
FTPSESSION_CloseConnection,
FTPSESSION_QueryOption,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
};
/***********************************************************************
* FTP_Connect (internal)
*
@@ -2062,12 +2274,11 @@ HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName,
nServerPort = INTERNET_DEFAULT_FTP_PORT;
lpwfs->hdr.htype = WH_HFTPSESSION;
lpwfs->hdr.vtbl = &FTPSESSIONVtbl;
lpwfs->hdr.dwFlags = dwFlags;
lpwfs->hdr.dwContext = dwContext;
lpwfs->hdr.dwInternalFlags = dwInternalFlags;
lpwfs->hdr.dwRefCount = 1;
lpwfs->hdr.close_connection = FTP_CloseConnection;
lpwfs->hdr.destroy = FTP_CloseSessionHandle;
lpwfs->hdr.refs = 1;
lpwfs->hdr.lpfnStatusCB = hIC->hdr.lpfnStatusCB;
lpwfs->download_in_progress = NULL;
lpwfs->sndSocket = -1;
@@ -2336,11 +2547,9 @@ INT FTP_ReceiveResponse(LPWININETFTPSESSIONW lpwfs, DWORD_PTR dwContext)
INT rc = 0;
char firstprefix[5];
BOOL multiline = FALSE;
LPWININETAPPINFOW hIC = NULL;
TRACE("socket(%d)\n", lpwfs->sndSocket);
hIC = lpwfs->lpAppInfo;
SendAsyncCallback(&lpwfs->hdr, dwContext, INTERNET_STATUS_RECEIVING_RESPONSE, NULL, 0);
while(1)
@@ -2957,7 +3166,6 @@ lend:
static BOOL FTP_RetrieveFileData(LPWININETFTPSESSIONW lpwfs, INT nDataSocket, HANDLE hFile)
{
DWORD nBytesWritten;
DWORD nBytesReceived = 0;
INT nRC = 0;
CHAR *lpszBuffer;
@@ -2979,7 +3187,6 @@ static BOOL FTP_RetrieveFileData(LPWININETFTPSESSIONW lpwfs, INT nDataSocket, HA
if (nRC == 0)
goto recv_end;
WriteFile(hFile, lpszBuffer, nRC, &nBytesWritten, NULL);
nBytesReceived += nRC;
}
}
@@ -2992,122 +3199,11 @@ recv_end:
}
/***********************************************************************
* FTP_CloseConnection (internal)
*
* Close connections
*/
static void FTP_CloseConnection(LPWININETHANDLEHEADER hdr)
{
LPWININETFTPSESSIONW lpwfs = (LPWININETFTPSESSIONW) hdr;
TRACE("\n");
SendAsyncCallback(&lpwfs->hdr, lpwfs->hdr.dwContext,
INTERNET_STATUS_CLOSING_CONNECTION, 0, 0);
if (lpwfs->download_in_progress != NULL)
lpwfs->download_in_progress->session_deleted = TRUE;
if (lpwfs->sndSocket != -1)
closesocket(lpwfs->sndSocket);
if (lpwfs->lstnSocket != -1)
closesocket(lpwfs->lstnSocket);
if (lpwfs->pasvSocket != -1)
closesocket(lpwfs->pasvSocket);
SendAsyncCallback(&lpwfs->hdr, lpwfs->hdr.dwContext,
INTERNET_STATUS_CONNECTION_CLOSED, 0, 0);
}
/***********************************************************************
* FTP_CloseSessionHandle (internal)
* FTPFINDNEXT_Destroy (internal)
*
* Deallocate session handle
*/
static void FTP_CloseSessionHandle(LPWININETHANDLEHEADER hdr)
{
LPWININETFTPSESSIONW lpwfs = (LPWININETFTPSESSIONW) hdr;
TRACE("\n");
WININET_Release(&lpwfs->lpAppInfo->hdr);
HeapFree(GetProcessHeap(), 0, lpwfs->lpszPassword);
HeapFree(GetProcessHeap(), 0, lpwfs->lpszUserName);
HeapFree(GetProcessHeap(), 0, lpwfs);
}
/***********************************************************************
* FTP_FindNextFileW (Internal)
*
* Continues a file search from a previous call to FindFirstFile
*
* RETURNS
* TRUE on success
* FALSE on failure
*
*/
BOOL WINAPI FTP_FindNextFileW(LPWININETFTPFINDNEXTW lpwh, LPVOID lpvFindData)
{
BOOL bSuccess = TRUE;
LPWIN32_FIND_DATAW lpFindFileData;
TRACE("index(%d) size(%d)\n", lpwh->index, lpwh->size);
assert (lpwh->hdr.htype == WH_HFTPFINDNEXT);
/* Clear any error information */
INTERNET_SetLastError(0);
lpFindFileData = (LPWIN32_FIND_DATAW) lpvFindData;
ZeroMemory(lpFindFileData, sizeof(WIN32_FIND_DATAA));
if (lpwh->index >= lpwh->size)
{
INTERNET_SetLastError(ERROR_NO_MORE_FILES);
bSuccess = FALSE;
goto lend;
}
FTP_ConvertFileProp(&lpwh->lpafp[lpwh->index], lpFindFileData);
lpwh->index++;
TRACE("\nName: %s\nSize: %d\n", debugstr_w(lpFindFileData->cFileName), lpFindFileData->nFileSizeLow);
lend:
if (lpwh->hdr.dwFlags & INTERNET_FLAG_ASYNC)
{
INTERNET_ASYNC_RESULT iar;
iar.dwResult = (DWORD)bSuccess;
iar.dwError = iar.dwError = bSuccess ? ERROR_SUCCESS :
INTERNET_GetLastError();
INTERNET_SendCallback(&lpwh->hdr, lpwh->hdr.dwContext,
INTERNET_STATUS_REQUEST_COMPLETE, &iar,
sizeof(INTERNET_ASYNC_RESULT));
}
return bSuccess;
}
/***********************************************************************
* FTP_CloseFindNextHandle (internal)
*
* Deallocate session handle
*
* RETURNS
* TRUE on success
* FALSE on failure
*
*/
static void FTP_CloseFindNextHandle(LPWININETHANDLEHEADER hdr)
static void FTPFINDNEXT_Destroy(WININETHANDLEHEADER *hdr)
{
LPWININETFTPFINDNEXTW lpwfn = (LPWININETFTPFINDNEXTW) hdr;
DWORD i;
@@ -3125,35 +3221,98 @@ static void FTP_CloseFindNextHandle(LPWININETHANDLEHEADER hdr)
HeapFree(GetProcessHeap(), 0, lpwfn);
}
/***********************************************************************
* FTP_CloseFileTransferHandle (internal)
*
* Closes the file transfer handle. This also 'cleans' the data queue of
* the 'transfer complete' message (this is a bit of a hack though :-/ )
*
*/
static void FTP_CloseFileTransferHandle(LPWININETHANDLEHEADER hdr)
static DWORD WINAPI FTPFINDNEXT_FindNextFileProc(WININETFTPFINDNEXTW *find, LPVOID data)
{
LPWININETFTPFILE lpwh = (LPWININETFTPFILE) hdr;
LPWININETFTPSESSIONW lpwfs = lpwh->lpFtpSession;
INT nResCode;
WIN32_FIND_DATAW *find_data = data;
DWORD res = ERROR_SUCCESS;
TRACE("\n");
TRACE("index(%d) size(%d)\n", find->index, find->size);
WININET_Release(&lpwh->lpFtpSession->hdr);
ZeroMemory(find_data, sizeof(WIN32_FIND_DATAW));
if (!lpwh->session_deleted)
lpwfs->download_in_progress = NULL;
if (find->index < find->size) {
FTP_ConvertFileProp(&find->lpafp[find->index], find_data);
find->index++;
if (lpwh->nDataSocket != -1)
closesocket(lpwh->nDataSocket);
TRACE("Name: %s\nSize: %d\n", debugstr_w(find_data->cFileName), find_data->nFileSizeLow);
}else {
res = ERROR_NO_MORE_FILES;
}
nResCode = FTP_ReceiveResponse(lpwfs, lpwfs->hdr.dwContext);
if (nResCode > 0 && nResCode != 226) WARN("server reports failed transfer\n");
if (find->hdr.dwFlags & INTERNET_FLAG_ASYNC)
{
INTERNET_ASYNC_RESULT iar;
HeapFree(GetProcessHeap(), 0, lpwh);
iar.dwResult = (res == ERROR_SUCCESS);
iar.dwError = res;
INTERNET_SendCallback(&find->hdr, find->hdr.dwContext,
INTERNET_STATUS_REQUEST_COMPLETE, &iar,
sizeof(INTERNET_ASYNC_RESULT));
}
return res;
}
static void FTPFINDNEXT_AsyncFindNextFileProc(WORKREQUEST *workRequest)
{
struct WORKREQ_FTPFINDNEXTW *req = &workRequest->u.FtpFindNextW;
FTPFINDNEXT_FindNextFileProc((WININETFTPFINDNEXTW*)workRequest->hdr, req->lpFindFileData);
}
static DWORD FTPFINDNEXT_QueryOption(WININETHANDLEHEADER *hdr, DWORD option, void *buffer, DWORD *size, BOOL unicode)
{
switch(option) {
case INTERNET_OPTION_HANDLE_TYPE:
TRACE("INTERNET_OPTION_HANDLE_TYPE\n");
if (*size < sizeof(ULONG))
return ERROR_INSUFFICIENT_BUFFER;
*size = sizeof(DWORD);
*(DWORD*)buffer = INTERNET_HANDLE_TYPE_FTP_FIND;
return ERROR_SUCCESS;
}
FIXME("Not implemented option %d\n", option);
return ERROR_INTERNET_INVALID_OPTION;
}
static DWORD FTPFINDNEXT_FindNextFileW(WININETHANDLEHEADER *hdr, void *data)
{
WININETFTPFINDNEXTW *find = (WININETFTPFINDNEXTW*)hdr;
if (find->lpFtpSession->lpAppInfo->hdr.dwFlags & INTERNET_FLAG_ASYNC)
{
WORKREQUEST workRequest;
struct WORKREQ_FTPFINDNEXTW *req;
workRequest.asyncproc = FTPFINDNEXT_AsyncFindNextFileProc;
workRequest.hdr = WININET_AddRef( &find->hdr );
req = &workRequest.u.FtpFindNextW;
req->lpFindFileData = data;
INTERNET_AsyncCall(&workRequest);
return ERROR_SUCCESS;
}
return FTPFINDNEXT_FindNextFileProc(find, data);
}
static const HANDLEHEADERVtbl FTPFINDNEXTVtbl = {
FTPFINDNEXT_Destroy,
NULL,
FTPFINDNEXT_QueryOption,
NULL,
NULL,
NULL,
NULL,
NULL,
FTPFINDNEXT_FindNextFileW
};
/***********************************************************************
* FTP_ReceiveFileList (internal)
*
@@ -3183,10 +3342,9 @@ static HINTERNET FTP_ReceiveFileList(LPWININETFTPSESSIONW lpwfs, INT nSocket, LP
if (lpwfn)
{
lpwfn->hdr.htype = WH_HFTPFINDNEXT;
lpwfn->hdr.vtbl = &FTPFINDNEXTVtbl;
lpwfn->hdr.dwContext = dwContext;
lpwfn->hdr.dwRefCount = 1;
lpwfn->hdr.close_connection = NULL;
lpwfn->hdr.destroy = FTP_CloseFindNextHandle;
lpwfn->hdr.refs = 1;
lpwfn->hdr.lpfnStatusCB = lpwfs->hdr.lpfnStatusCB;
lpwfn->index = 1; /* Next index is 1 since we return index 0 */
lpwfn->size = dwSize;
@@ -3218,7 +3376,7 @@ static HINTERNET FTP_ReceiveFileList(LPWININETFTPSESSIONW lpwfs, INT nSocket, LP
* FALSE on failure
*
*/
BOOL FTP_ConvertFileProp(LPFILEPROPERTIESW lpafp, LPWIN32_FIND_DATAW lpFindFileData)
static BOOL FTP_ConvertFileProp(LPFILEPROPERTIESW lpafp, LPWIN32_FIND_DATAW lpFindFileData)
{
BOOL bSuccess = FALSE;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -23,6 +23,9 @@
#ifndef _WINE_INTERNET_H_
#define _WINE_INTERNET_H_
/* ReactOS-specific definitions */
#define CP_UNIXCP CP_THREAD_ACP
#ifndef __WINE_CONFIG_H
# error You must include config.h to use this header
#endif
@@ -55,12 +58,13 @@
#endif
#if defined(__MINGW32__) || defined (_MSC_VER)
#include "winsock2.h"
#include "ws2tcpip.h"
#ifndef MSG_WAITALL
#define MSG_WAITALL 0
#endif
#else
#define closesocket close
#define ioctlsocket ioctl
#endif /* __MINGW32__ */
/* used for netconnection.c stuff */
@@ -133,22 +137,30 @@ typedef enum
#define INET_OPENURL 0x0001
#define INET_CALLBACKW 0x0002
struct _WININETHANDLEHEADER;
typedef struct _WININETHANDLEHEADER WININETHANDLEHEADER, *LPWININETHANDLEHEADER;
typedef void (*WININET_object_function)( LPWININETHANDLEHEADER );
typedef struct {
void (*Destroy)(WININETHANDLEHEADER*);
void (*CloseConnection)(WININETHANDLEHEADER*);
DWORD (*QueryOption)(WININETHANDLEHEADER*,DWORD,void*,DWORD*,BOOL);
DWORD (*SetOption)(WININETHANDLEHEADER*,DWORD,void*,DWORD);
DWORD (*ReadFile)(WININETHANDLEHEADER*,void*,DWORD,DWORD*);
DWORD (*ReadFileExA)(WININETHANDLEHEADER*,INTERNET_BUFFERSA*,DWORD,DWORD_PTR);
BOOL (*WriteFile)(WININETHANDLEHEADER*,const void*,DWORD,DWORD*);
DWORD (*QueryDataAvailable)(WININETHANDLEHEADER*,DWORD*,DWORD,DWORD_PTR);
DWORD (*FindNextFileW)(WININETHANDLEHEADER*,void*);
} HANDLEHEADERVtbl;
struct _WININETHANDLEHEADER
{
WH_TYPE htype;
const HANDLEHEADERVtbl *vtbl;
HINTERNET hInternet;
DWORD dwFlags;
DWORD_PTR dwContext;
DWORD dwError;
DWORD dwInternalFlags;
DWORD dwRefCount;
WININET_object_function close_connection;
WININET_object_function destroy;
LONG refs;
INTERNET_STATUS_CALLBACK lpfnStatusCB;
struct list entry;
struct list children;
@@ -209,55 +221,13 @@ typedef struct
DWORD dwContentRead; /* bytes of the content read so far */
HTTPHEADERW *pCustHeaders;
DWORD nCustHeaders;
HANDLE hCacheFile;
LPWSTR lpszCacheFile;
struct HttpAuthInfo *pAuthInfo;
struct HttpAuthInfo *pProxyAuthInfo;
} WININETHTTPREQW, *LPWININETHTTPREQW;
struct _WININETFTPSESSIONW;
typedef struct
{
WININETHANDLEHEADER hdr;
struct _WININETFTPSESSIONW *lpFtpSession;
BOOL session_deleted;
int nDataSocket;
} WININETFTPFILE, *LPWININETFTPFILE;
typedef struct _WININETFTPSESSIONW
{
WININETHANDLEHEADER hdr;
WININETAPPINFOW *lpAppInfo;
int sndSocket;
int lstnSocket;
int pasvSocket; /* data socket connected by us in case of passive FTP */
LPWININETFTPFILE download_in_progress;
struct sockaddr_in socketAddress;
struct sockaddr_in lstnSocketAddress;
LPWSTR lpszPassword;
LPWSTR lpszUserName;
} WININETFTPSESSIONW, *LPWININETFTPSESSIONW;
typedef struct
{
BOOL bIsDirectory;
LPWSTR lpszName;
DWORD nSize;
struct tm tmLastModified;
unsigned short permissions;
} FILEPROPERTIESW, *LPFILEPROPERTIESW;
typedef struct
{
WININETHANDLEHEADER hdr;
WININETFTPSESSIONW *lpFtpSession;
DWORD index;
DWORD size;
LPFILEPROPERTIESW lpafp;
} WININETFTPFINDNEXTW, *LPWININETFTPFINDNEXTW;
struct WORKREQ_FTPPUTFILEW
{
@@ -414,28 +384,6 @@ DWORD INTERNET_GetLastError(void);
BOOL INTERNET_AsyncCall(LPWORKREQUEST lpWorkRequest);
LPSTR INTERNET_GetResponseBuffer(void);
LPSTR INTERNET_GetNextLine(INT nSocket, LPDWORD dwLen);
BOOL INTERNET_ReadFile(LPWININETHANDLEHEADER lpwh, LPVOID lpBuffer,
DWORD dwNumOfBytesToRead, LPDWORD pdwNumOfBytesRead,
BOOL bWait, BOOL bSendCompletionStatus);
BOOLAPI FTP_FtpPutFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszLocalFile,
LPCWSTR lpszNewRemoteFile, DWORD dwFlags, DWORD_PTR dwContext);
BOOLAPI FTP_FtpSetCurrentDirectoryW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszDirectory);
BOOLAPI FTP_FtpCreateDirectoryW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszDirectory);
INTERNETAPI HINTERNET WINAPI FTP_FtpFindFirstFileW(LPWININETFTPSESSIONW lpwfs,
LPCWSTR lpszSearchFile, LPWIN32_FIND_DATAW lpFindFileData, DWORD dwFlags, DWORD_PTR dwContext);
BOOL WINAPI FTP_FindNextFileW(LPWININETFTPFINDNEXTW lpwh, LPVOID lpvFindData);
BOOLAPI FTP_FtpGetCurrentDirectoryW(LPWININETFTPSESSIONW lpwfs, LPWSTR lpszCurrentDirectory,
LPDWORD lpdwCurrentDirectory);
BOOL FTP_ConvertFileProp(LPFILEPROPERTIESW lpafp, LPWIN32_FIND_DATAW lpFindFileData);
BOOL FTP_FtpRenameFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszSrc, LPCWSTR lpszDest);
BOOL FTP_FtpRemoveDirectoryW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszDirectory);
BOOL FTP_FtpDeleteFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszFileName);
HINTERNET FTP_FtpOpenFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszFileName,
DWORD fdwAccess, DWORD dwFlags, DWORD_PTR dwContext);
BOOLAPI FTP_FtpGetFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszRemoteFile, LPCWSTR lpszNewFile,
BOOL fFailIfExists, DWORD dwLocalFlagsAttribute, DWORD dwInternetFlags,
DWORD_PTR dwContext);
BOOLAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders,
DWORD dwHeaderLength, LPVOID lpOptional, DWORD dwOptionalLength,
@@ -471,7 +419,7 @@ BOOL NETCON_recv(WININET_NETCONNECTION *connection, void *buf, size_t len, int f
BOOL NETCON_query_data_available(WININET_NETCONNECTION *connection, DWORD *available);
BOOL NETCON_getNextLine(WININET_NETCONNECTION *connection, LPSTR lpszBuffer, LPDWORD dwBuffer);
LPCVOID NETCON_GetCert(WININET_NETCONNECTION *connection);
BOOL NETCON_set_timeout(WININET_NETCONNECTION *connection, BOOL send, int value);
DWORD NETCON_set_timeout(WININET_NETCONNECTION *connection, BOOL send, int value);
extern void URLCacheContainers_CreateDefaults(void);
extern void URLCacheContainers_DeleteAll(void);

View File

@@ -23,6 +23,12 @@
#include "config.h"
#include "wine/port.h"
#ifdef HAVE_POLL_H
#include <poll.h>
#endif
#ifdef HAVE_SYS_POLL_H
# include <sys/poll.h>
#endif
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
@@ -49,18 +55,16 @@
#include "winerror.h"
#include "wincrypt.h"
#include "wine/debug.h"
#include "internet.h"
/* To avoid conflicts with the Unix socket headers. we only need it for
* the error codes anyway. */
#define USE_WS_PREFIX
#include "winsock2.h"
#include "wine/debug.h"
#include "internet.h"
#define RESPONSE_TIMEOUT 30 /* FROM internet.c */
#define sock_get_error(x) WSAGetLastError()
#undef FIONREAD
WINE_DEFAULT_DEBUG_CHANNEL(wininet);
@@ -115,7 +119,7 @@ BOOL NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL)
connection->socketFD = -1;
if (useSSL)
{
#ifdef SONAME_LIBSSL
#if defined(SONAME_LIBSSL) && defined(SONAME_LIBCRYPTO)
TRACE("using SSL connection\n");
if (OpenSSL_ssl_handle) /* already initialized everything */
return TRUE;
@@ -202,10 +206,11 @@ BOOL NETCON_connected(WININET_NETCONNECTION *connection)
return TRUE;
}
#ifndef __REACTOS__
#if 0
/* translate a unix error code into a winsock one */
static int sock_get_error( int err )
{
#if !defined(__MINGW32__) && !defined (_MSC_VER)
switch (err)
{
case EINTR: return WSAEINTR;
@@ -265,6 +270,8 @@ static int sock_get_error( int err )
#endif
default: errno=err; perror("sock_set_error"); return WSAEFAULT;
}
#endif
return err;
}
#endif
@@ -588,7 +595,7 @@ BOOL NETCON_query_data_available(WININET_NETCONNECTION *connection, DWORD *avail
if (!connection->useSSL)
{
int unread;
int retval = ioctl(connection->socketFD, FIONREAD, &unread);
int retval = ioctlsocket(connection->socketFD, FIONREAD, &unread);
if (!retval)
{
TRACE("%d bytes of queued, but unread data\n", unread);
@@ -749,7 +756,7 @@ LPCVOID NETCON_GetCert(WININET_NETCONNECTION *connection)
#endif
}
BOOL NETCON_set_timeout(WININET_NETCONNECTION *connection, BOOL send, int value)
DWORD NETCON_set_timeout(WININET_NETCONNECTION *connection, BOOL send, int value)
{
int result;
struct timeval tv;
@@ -757,7 +764,7 @@ BOOL NETCON_set_timeout(WININET_NETCONNECTION *connection, BOOL send, int value)
/* FIXME: we should probably store the timeout in the connection to set
* when we do connect */
if (!NETCON_connected(connection))
return TRUE;
return ERROR_SUCCESS;
/* value is in milliseconds, convert to struct timeval */
tv.tv_sec = value / 1000;
@@ -770,9 +777,8 @@ BOOL NETCON_set_timeout(WININET_NETCONNECTION *connection, BOOL send, int value)
if (result == -1)
{
WARN("setsockopt failed (%s)\n", strerror(errno));
INTERNET_SetLastError(sock_get_error(errno));
return FALSE;
return sock_get_error(errno);
}
return TRUE;
return ERROR_SUCCESS;
}

View File

@@ -42,6 +42,7 @@
*/
#include "wininet_Bg.rc"
#include "wininet_Cs.rc"
#include "wininet_Da.rc"
#include "wininet_De.rc"
#include "wininet_En.rc"
#include "wininet_Eo.rc"
@@ -59,5 +60,5 @@
#include "wininet_Ru.rc"
#include "wininet_Si.rc"
#include "wininet_Sv.rc"
#include "wininet_Tr.rc"
#include "wininet_Uk.rc"
#include "wininet_Tr.rc"

View File

@@ -101,7 +101,7 @@ typedef struct _URL_CACHEFILE_ENTRY
DWORD CacheEntryType; /* see INTERNET_CACHE_ENTRY_INFO::CacheEntryType */
DWORD dwOffsetHeaderInfo; /* offset of start of header info from start of entry */
DWORD dwHeaderInfoSize;
DWORD dwUnknown6; /* usually zero */
DWORD dwOffsetFileExtension; /* offset of start of file extension from start of entry */
WORD wLastSyncDate; /* last sync date in dos format */
WORD wLastSyncTime; /* last sync time in dos format */
DWORD dwHitRate; /* see INTERNET_CACHE_ENTRY_INFO::dwHitRate */
@@ -375,8 +375,6 @@ static BOOL URLCacheContainer_OpenIndex(URLCACHECONTAINER * pContainer)
if (CreateDirectoryW(wszDirPath, 0))
{
int k;
/* The following is OK because we generated an
* 8 character directory name made from characters
* [A-Z0-9], which are equivalent for all code
@@ -543,7 +541,7 @@ void URLCacheContainers_CreateDefaults(void)
WCHAR wszMutexName[MAX_PATH];
int path_len, suffix_len;
if (FAILED(SHGetSpecialFolderPathW(NULL, wszCachePath, DefaultContainerData[i].nFolder, TRUE)))
if (!SHGetSpecialFolderPathW(NULL, wszCachePath, DefaultContainerData[i].nFolder, TRUE))
{
ERR("Couldn't get path for default container %u\n", i);
continue;
@@ -583,13 +581,12 @@ void URLCacheContainers_DeleteAll(void)
static BOOL URLCacheContainers_FindContainerW(LPCWSTR lpwszUrl, URLCACHECONTAINER ** ppContainer)
{
struct list * cursor;
URLCACHECONTAINER * pContainer;
TRACE("searching for prefix for URL: %s\n", debugstr_w(lpwszUrl));
LIST_FOR_EACH(cursor, &UrlContainers)
LIST_FOR_EACH_ENTRY(pContainer, &UrlContainers, URLCACHECONTAINER, entry)
{
URLCACHECONTAINER * pContainer = LIST_ENTRY(cursor, URLCACHECONTAINER, entry);
int prefix_len = strlenW(pContainer->cache_prefix);
if (!strncmpW(pContainer->cache_prefix, lpwszUrl, prefix_len))
{
@@ -618,6 +615,42 @@ static BOOL URLCacheContainers_FindContainerA(LPCSTR lpszUrl, URLCACHECONTAINER
return FALSE;
}
static BOOL URLCacheContainers_Enum(LPCWSTR lpwszSearchPattern, DWORD dwIndex, URLCACHECONTAINER ** ppContainer)
{
DWORD i = 0;
URLCACHECONTAINER * pContainer;
TRACE("searching for prefix: %s\n", debugstr_w(lpwszSearchPattern));
/* non-NULL search pattern only returns one container ever */
if (lpwszSearchPattern && dwIndex > 0)
return FALSE;
LIST_FOR_EACH_ENTRY(pContainer, &UrlContainers, URLCACHECONTAINER, entry)
{
if (lpwszSearchPattern)
{
if (!strcmpW(pContainer->cache_prefix, lpwszSearchPattern))
{
TRACE("found container with prefix %s\n", debugstr_w(pContainer->cache_prefix));
*ppContainer = pContainer;
return TRUE;
}
}
else
{
if (i == dwIndex)
{
TRACE("found container with prefix %s\n", debugstr_w(pContainer->cache_prefix));
*ppContainer = pContainer;
return TRUE;
}
}
i++;
}
return FALSE;
}
/***********************************************************************
* URLCacheContainer_LockIndex (Internal)
*
@@ -874,14 +907,14 @@ static BOOL URLCache_LocalFileNameToPathA(
return FALSE;
}
path_len = WideCharToMultiByte(CP_ACP, 0, pContainer->path, -1, NULL, 0, NULL, NULL);
file_name_len = strlen(szLocalFileName);
path_len = WideCharToMultiByte(CP_ACP, 0, pContainer->path, -1, NULL, 0, NULL, NULL) - 1;
file_name_len = strlen(szLocalFileName) + 1 /* for nul-terminator */;
dir_len = DIR_LENGTH;
nRequired = (path_len + dir_len + 1 + file_name_len) * sizeof(WCHAR);
nRequired = (path_len + dir_len + 1 + file_name_len) * sizeof(char);
if (nRequired < *lpBufferSize)
{
WideCharToMultiByte(CP_ACP, 0, pContainer->path, -1, szPath, -1, NULL, NULL);
WideCharToMultiByte(CP_ACP, 0, pContainer->path, -1, szPath, path_len, NULL, NULL);
memcpy(szPath+path_len, pHeader->directory_data[Directory].filename, dir_len);
szPath[path_len + dir_len] = '\\';
memcpy(szPath + path_len + dir_len + 1, szLocalFileName, file_name_len);
@@ -907,7 +940,7 @@ static BOOL URLCache_CopyEntry(
LPCURLCACHE_HEADER pHeader,
LPINTERNET_CACHE_ENTRY_INFOA lpCacheEntryInfo,
LPDWORD lpdwBufferSize,
URL_CACHEFILE_ENTRY * pUrlEntry,
const URL_CACHEFILE_ENTRY * pUrlEntry,
BOOL bUnicode)
{
int lenUrl;
@@ -987,6 +1020,30 @@ static BOOL URLCache_CopyEntry(
ZeroMemory((LPBYTE)lpCacheEntryInfo + dwRequiredSize, 4 - (dwRequiredSize % 4));
dwRequiredSize = DWORD_ALIGN(dwRequiredSize);
if (pUrlEntry->dwOffsetFileExtension)
{
int lenExtension;
if (bUnicode)
lenExtension = MultiByteToWideChar(CP_ACP, 0, (LPSTR)pUrlEntry + pUrlEntry->dwOffsetFileExtension, -1, NULL, 0);
else
lenExtension = strlen((LPSTR)pUrlEntry + pUrlEntry->dwOffsetFileExtension) + 1;
dwRequiredSize += lenExtension * (bUnicode ? sizeof(WCHAR) : sizeof(CHAR));
if (*lpdwBufferSize >= dwRequiredSize)
{
lpCacheEntryInfo->lpszFileExtension = (LPSTR)lpCacheEntryInfo + dwRequiredSize - lenExtension;
if (bUnicode)
MultiByteToWideChar(CP_ACP, 0, (LPSTR)pUrlEntry + pUrlEntry->dwOffsetFileExtension, -1, (LPWSTR)lpCacheEntryInfo->lpszSourceUrlName, lenExtension);
else
memcpy(lpCacheEntryInfo->lpszFileExtension, (LPSTR)pUrlEntry + pUrlEntry->dwOffsetFileExtension, lenExtension * sizeof(CHAR));
}
if ((dwRequiredSize % 4) && (dwRequiredSize < *lpdwBufferSize))
ZeroMemory((LPBYTE)lpCacheEntryInfo + dwRequiredSize, 4 - (dwRequiredSize % 4));
dwRequiredSize = DWORD_ALIGN(dwRequiredSize);
}
if (dwRequiredSize > *lpdwBufferSize)
{
*lpdwBufferSize = dwRequiredSize;
@@ -1082,12 +1139,6 @@ static DWORD URLCache_HashKey(LPCSTR lpszKey)
};
BYTE key[4];
DWORD i;
int subscript[sizeof(key) / sizeof(key[0])];
subscript[0] = *lpszKey;
subscript[1] = (char)(*lpszKey + 1);
subscript[2] = (char)(*lpszKey + 2);
subscript[3] = (char)(*lpszKey + 3);
for (i = 0; i < sizeof(key) / sizeof(key[0]); i++)
key[i] = lookupTable[i];
@@ -1106,6 +1157,13 @@ static inline HASH_CACHEFILE_ENTRY * URLCache_HashEntryFromOffset(LPCURLCACHE_HE
return (HASH_CACHEFILE_ENTRY *)((LPBYTE)pHeader + dwOffset);
}
static inline BOOL URLCache_IsHashEntryValid(LPCURLCACHE_HEADER pHeader, const HASH_CACHEFILE_ENTRY *pHashEntry)
{
/* check pHashEntry located within acceptable bounds in the URL cache mapping */
return ((DWORD)((LPBYTE)pHashEntry - (LPBYTE)pHeader) >= ENTRY_START_OFFSET) &&
((DWORD)((LPBYTE)pHashEntry - (LPBYTE)pHeader) < pHeader->dwFileSize);
}
static BOOL URLCache_FindHash(LPCURLCACHE_HEADER pHeader, LPCSTR lpszUrl, struct _HASH_ENTRY ** ppHashEntry)
{
/* structure of hash table:
@@ -1125,10 +1183,10 @@ static BOOL URLCache_FindHash(LPCURLCACHE_HEADER pHeader, LPCSTR lpszUrl, struct
HASH_CACHEFILE_ENTRY * pHashEntry;
DWORD dwHashTableNumber = 0;
key = (DWORD)(key / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES;
key = (key / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES;
for (pHashEntry = URLCache_HashEntryFromOffset(pHeader, pHeader->dwOffsetFirstHashTable);
((DWORD)((LPBYTE)pHashEntry - (LPBYTE)pHeader) >= ENTRY_START_OFFSET) && ((DWORD)((LPBYTE)pHashEntry - (LPBYTE)pHeader) < pHeader->dwFileSize);
URLCache_IsHashEntryValid(pHeader, pHashEntry);
pHashEntry = URLCache_HashEntryFromOffset(pHeader, pHashEntry->dwAddressNext))
{
int i;
@@ -1147,7 +1205,7 @@ static BOOL URLCache_FindHash(LPCURLCACHE_HEADER pHeader, LPCSTR lpszUrl, struct
for (i = 0; i < HASHTABLE_BLOCKSIZE; i++)
{
struct _HASH_ENTRY * pHashElement = &pHashEntry->HashTable[offset + i];
if (key == (DWORD)(pHashElement->dwHashKey / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES)
if (key == (pHashElement->dwHashKey / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES)
{
/* FIXME: we should make sure that this is the right element
* before returning and claiming that it is. We can do this
@@ -1195,7 +1253,7 @@ static BOOL URLCache_FindHashW(LPCURLCACHE_HEADER pHeader, LPCWSTR lpszUrl, stru
*/
static BOOL URLCache_HashEntrySetUse(struct _HASH_ENTRY * pHashEntry, DWORD dwUseCount)
{
pHashEntry->dwHashKey = dwUseCount | (DWORD)(pHashEntry->dwHashKey / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES;
pHashEntry->dwHashKey = dwUseCount | (pHashEntry->dwHashKey / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES;
return TRUE;
}
@@ -1238,10 +1296,10 @@ static BOOL URLCache_AddEntryToHash(LPURLCACHE_HEADER pHeader, LPCSTR lpszUrl, D
HASH_CACHEFILE_ENTRY * pHashEntry;
DWORD dwHashTableNumber = 0;
key = (DWORD)(key / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES;
key = (key / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES;
for (pHashEntry = URLCache_HashEntryFromOffset(pHeader, pHeader->dwOffsetFirstHashTable);
((DWORD)((LPBYTE)pHashEntry - (LPBYTE)pHeader) >= ENTRY_START_OFFSET) && ((DWORD)((LPBYTE)pHashEntry - (LPBYTE)pHeader) < pHeader->dwFileSize);
URLCache_IsHashEntryValid(pHeader, pHashEntry);
pHashEntry = URLCache_HashEntryFromOffset(pHeader, pHashEntry->dwAddressNext))
{
int i;
@@ -1277,6 +1335,17 @@ static BOOL URLCache_AddEntryToHash(LPURLCACHE_HEADER pHeader, LPCSTR lpszUrl, D
return TRUE;
}
/***********************************************************************
* URLCache_CreateHashTable (Internal)
*
* Creates a new hash table in free space and adds it to the chain of existing
* hash tables.
*
* RETURNS
* TRUE if the hash table was created
* FALSE if the hash table could not be created
*
*/
static HASH_CACHEFILE_ENTRY *URLCache_CreateHashTable(LPURLCACHE_HEADER pHeader, HASH_CACHEFILE_ENTRY *pPrevHash)
{
HASH_CACHEFILE_ENTRY *pHash;
@@ -1307,6 +1376,66 @@ static HASH_CACHEFILE_ENTRY *URLCache_CreateHashTable(LPURLCACHE_HEADER pHeader,
return pHash;
}
/***********************************************************************
* URLCache_EnumHashTables (Internal)
*
* Enumerates the hash tables in a container.
*
* RETURNS
* TRUE if an entry was found
* FALSE if there are no more tables to enumerate.
*
*/
static BOOL URLCache_EnumHashTables(LPCURLCACHE_HEADER pHeader, DWORD *pdwHashTableNumber, HASH_CACHEFILE_ENTRY ** ppHashEntry)
{
for (*ppHashEntry = URLCache_HashEntryFromOffset(pHeader, pHeader->dwOffsetFirstHashTable);
URLCache_IsHashEntryValid(pHeader, *ppHashEntry);
*ppHashEntry = URLCache_HashEntryFromOffset(pHeader, (*ppHashEntry)->dwAddressNext))
{
TRACE("looking at hash table number %d\n", (*ppHashEntry)->dwHashTableNumber);
if ((*ppHashEntry)->dwHashTableNumber != *pdwHashTableNumber)
continue;
/* make sure that it is in fact a hash entry */
if ((*ppHashEntry)->CacheFileEntry.dwSignature != HASH_SIGNATURE)
{
ERR("Error: not right signature (\"%.4s\") - expected \"HASH\"\n", (LPCSTR)&(*ppHashEntry)->CacheFileEntry.dwSignature);
(*pdwHashTableNumber)++;
continue;
}
TRACE("hash table number %d found\n", *pdwHashTableNumber);
return TRUE;
}
return FALSE;
}
/***********************************************************************
* URLCache_EnumHashTableEntries (Internal)
*
* Enumerates entries in a hash table and returns the next non-free entry.
*
* RETURNS
* TRUE if an entry was found
* FALSE if the hash table is empty or there are no more entries to
* enumerate.
*
*/
static BOOL URLCache_EnumHashTableEntries(LPCURLCACHE_HEADER pHeader, const HASH_CACHEFILE_ENTRY * pHashEntry,
DWORD * index, const struct _HASH_ENTRY ** ppHashEntry)
{
for (; *index < HASHTABLE_SIZE ; (*index)++)
{
if (pHashEntry->HashTable[*index].dwHashKey == HASHTABLE_FREE)
continue;
*ppHashEntry = &pHashEntry->HashTable[*index];
TRACE("entry found %d\n", *index);
return TRUE;
}
TRACE("no more entries (%d)\n", *index);
return FALSE;
}
/***********************************************************************
* GetUrlCacheEntryInfoExA (WININET.@)
*
@@ -1354,8 +1483,8 @@ BOOL WINAPI GetUrlCacheEntryInfoA(
{
LPURLCACHE_HEADER pHeader;
struct _HASH_ENTRY * pHashEntry;
CACHEFILE_ENTRY * pEntry;
URL_CACHEFILE_ENTRY * pUrlEntry;
const CACHEFILE_ENTRY * pEntry;
const URL_CACHEFILE_ENTRY * pUrlEntry;
URLCACHECONTAINER * pContainer;
TRACE("(%s, %p, %p)\n", debugstr_a(lpszUrlName), lpCacheEntryInfo, lpdwCacheEntryInfoBufferSize);
@@ -1377,7 +1506,7 @@ BOOL WINAPI GetUrlCacheEntryInfoA(
return FALSE;
}
pEntry = (CACHEFILE_ENTRY *)((LPBYTE)pHeader + pHashEntry->dwOffsetEntry);
pEntry = (const CACHEFILE_ENTRY *)((LPBYTE)pHeader + pHashEntry->dwOffsetEntry);
if (pEntry->dwSignature != URL_SIGNATURE)
{
URLCacheContainer_UnlockIndex(pContainer, pHeader);
@@ -1386,23 +1515,26 @@ BOOL WINAPI GetUrlCacheEntryInfoA(
return FALSE;
}
pUrlEntry = (URL_CACHEFILE_ENTRY *)pEntry;
pUrlEntry = (const URL_CACHEFILE_ENTRY *)pEntry;
TRACE("Found URL: %s\n", debugstr_a((LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl));
if (pUrlEntry->dwOffsetHeaderInfo)
TRACE("Header info: %s\n", debugstr_a((LPSTR)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo));
if (!URLCache_CopyEntry(
pContainer,
pHeader,
lpCacheEntryInfo,
lpdwCacheEntryInfoBufferSize,
pUrlEntry,
FALSE /* ANSI */))
if (lpdwCacheEntryInfoBufferSize)
{
URLCacheContainer_UnlockIndex(pContainer, pHeader);
return FALSE;
if (!URLCache_CopyEntry(
pContainer,
pHeader,
lpCacheEntryInfo,
lpdwCacheEntryInfoBufferSize,
pUrlEntry,
FALSE /* ANSI */))
{
URLCacheContainer_UnlockIndex(pContainer, pHeader);
return FALSE;
}
TRACE("Local File Name: %s\n", debugstr_a(lpCacheEntryInfo->lpszLocalFileName));
}
TRACE("Local File Name: %s\n", debugstr_a(lpCacheEntryInfo->lpszLocalFileName));
URLCacheContainer_UnlockIndex(pContainer, pHeader);
@@ -1419,8 +1551,8 @@ BOOL WINAPI GetUrlCacheEntryInfoW(LPCWSTR lpszUrl,
{
LPURLCACHE_HEADER pHeader;
struct _HASH_ENTRY * pHashEntry;
CACHEFILE_ENTRY * pEntry;
URL_CACHEFILE_ENTRY * pUrlEntry;
const CACHEFILE_ENTRY * pEntry;
const URL_CACHEFILE_ENTRY * pUrlEntry;
URLCACHECONTAINER * pContainer;
TRACE("(%s, %p, %p)\n", debugstr_w(lpszUrl), lpCacheEntryInfo, lpdwCacheEntryInfoBufferSize);
@@ -1442,7 +1574,7 @@ BOOL WINAPI GetUrlCacheEntryInfoW(LPCWSTR lpszUrl,
return FALSE;
}
pEntry = (CACHEFILE_ENTRY *)((LPBYTE)pHeader + pHashEntry->dwOffsetEntry);
pEntry = (const CACHEFILE_ENTRY *)((LPBYTE)pHeader + pHashEntry->dwOffsetEntry);
if (pEntry->dwSignature != URL_SIGNATURE)
{
URLCacheContainer_UnlockIndex(pContainer, pHeader);
@@ -1451,22 +1583,25 @@ BOOL WINAPI GetUrlCacheEntryInfoW(LPCWSTR lpszUrl,
return FALSE;
}
pUrlEntry = (URL_CACHEFILE_ENTRY *)pEntry;
pUrlEntry = (const URL_CACHEFILE_ENTRY *)pEntry;
TRACE("Found URL: %s\n", debugstr_a((LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl));
TRACE("Header info: %s\n", debugstr_a((LPSTR)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo));
if (!URLCache_CopyEntry(
pContainer,
pHeader,
(LPINTERNET_CACHE_ENTRY_INFOA)lpCacheEntryInfo,
lpdwCacheEntryInfoBufferSize,
pUrlEntry,
TRUE /* UNICODE */))
if (lpdwCacheEntryInfoBufferSize)
{
URLCacheContainer_UnlockIndex(pContainer, pHeader);
return FALSE;
if (!URLCache_CopyEntry(
pContainer,
pHeader,
(LPINTERNET_CACHE_ENTRY_INFOA)lpCacheEntryInfo,
lpdwCacheEntryInfoBufferSize,
pUrlEntry,
TRUE /* UNICODE */))
{
URLCacheContainer_UnlockIndex(pContainer, pHeader);
return FALSE;
}
TRACE("Local File Name: %s\n", debugstr_w(lpCacheEntryInfo->lpszLocalFileName));
}
TRACE("Local File Name: %s\n", debugstr_w(lpCacheEntryInfo->lpszLocalFileName));
URLCacheContainer_UnlockIndex(pContainer, pHeader);
@@ -1974,8 +2109,7 @@ BOOL WINAPI CreateUrlCacheEntryW(
return FALSE;
}
for (lpszUrlEnd = lpszUrlName; *lpszUrlEnd; lpszUrlEnd++)
;
lpszUrlEnd = lpszUrlName + strlenW(lpszUrlName);
if (((lpszUrlEnd - lpszUrlName) > 1) && (*(lpszUrlEnd - 1) == '/' || *(lpszUrlEnd - 1) == '\\'))
lpszUrlEnd--;
@@ -1990,6 +2124,10 @@ BOOL WINAPI CreateUrlCacheEntryW(
lpszUrlPart++;
break;
}
else if(*lpszUrlPart == '?' || *lpszUrlPart == '#')
{
lpszUrlEnd = lpszUrlPart;
}
}
if (!lstrcmpW(lpszUrlPart, szWWW))
{
@@ -2101,12 +2239,16 @@ static BOOL WINAPI CommitUrlCacheEntryInternal(
DWORD dwBytesNeeded = DWORD_ALIGN(sizeof(*pUrlEntry));
DWORD dwOffsetLocalFileName = 0;
DWORD dwOffsetHeader = 0;
DWORD dwOffsetFileExtension = 0;
DWORD dwFileSizeLow = 0;
DWORD dwFileSizeHigh = 0;
BYTE cDirectory = 0;
int len;
char achFile[MAX_PATH];
char achUrl[MAX_PATH];
LPSTR lpszUrlNameA = NULL;
LPSTR lpszFileExtensionA = NULL;
char *pchLocalFileName = 0;
DWORD error = ERROR_SUCCESS;
TRACE("(%s, %s, ..., ..., %x, %p, %d, %s, %s)\n",
debugstr_w(lpszUrlName),
@@ -2152,17 +2294,35 @@ static BOOL WINAPI CommitUrlCacheEntryInternal(
if (!(pHeader = URLCacheContainer_LockIndex(pContainer)))
return FALSE;
WideCharToMultiByte(CP_ACP, 0, lpszUrlName, -1, achUrl, -1, NULL, NULL);
if (URLCache_FindHash(pHeader, achUrl, &pHashEntry))
len = WideCharToMultiByte(CP_ACP, 0, lpszUrlName, -1, NULL, 0, NULL, NULL);
lpszUrlNameA = HeapAlloc(GetProcessHeap(), 0, len * sizeof(char));
if (!lpszUrlNameA)
{
error = GetLastError();
goto cleanup;
}
WideCharToMultiByte(CP_ACP, 0, lpszUrlName, -1, lpszUrlNameA, len, NULL, NULL);
if (lpszFileExtension)
{
len = WideCharToMultiByte(CP_ACP, 0, lpszFileExtension, -1, NULL, 0, NULL, NULL);
lpszFileExtensionA = HeapAlloc(GetProcessHeap(), 0, len * sizeof(char));
if (!lpszFileExtensionA)
{
error = GetLastError();
goto cleanup;
}
WideCharToMultiByte(CP_ACP, 0, lpszFileExtension, -1, lpszFileExtensionA, len, NULL, NULL);
}
if (URLCache_FindHash(pHeader, lpszUrlNameA, &pHashEntry))
{
URLCacheContainer_UnlockIndex(pContainer, pHeader);
FIXME("entry already in cache - don't know what to do!\n");
/*
* SetLastError(ERROR_FILE_NOT_FOUND);
* return FALSE;
*/
return TRUE;
goto cleanup;
}
if (lpszLocalFileName)
@@ -2171,10 +2331,9 @@ static BOOL WINAPI CommitUrlCacheEntryInternal(
if (strncmpW(lpszLocalFileName, pContainer->path, lstrlenW(pContainer->path)))
{
URLCacheContainer_UnlockIndex(pContainer, pHeader);
ERR("path %s must begin with cache content path %s\n", debugstr_w(lpszLocalFileName), debugstr_w(pContainer->path));
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
error = ERROR_INVALID_PARAMETER;
goto cleanup;
}
/* skip container path prefix */
@@ -2194,18 +2353,18 @@ static BOOL WINAPI CommitUrlCacheEntryInternal(
if (!bFound)
{
URLCacheContainer_UnlockIndex(pContainer, pHeader);
ERR("cache directory not found in path %s\n", debugstr_w(lpszLocalFileName));
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
error = ERROR_INVALID_PARAMETER;
goto cleanup;
}
lpszLocalFileName += (DIR_LENGTH + 1); /* "1234WXYZ\" */
}
dwBytesNeeded = DWORD_ALIGN(dwBytesNeeded + strlen(achUrl) + 1);
dwBytesNeeded = DWORD_ALIGN(dwBytesNeeded + strlen(lpszUrlNameA) + 1);
if (lpszLocalFileName)
{
len = WideCharToMultiByte(CP_ACP, 0, lpszUrlName, -1, NULL, 0, NULL, NULL);
dwOffsetLocalFileName = dwBytesNeeded;
dwBytesNeeded = DWORD_ALIGN(dwBytesNeeded + strlen(pchLocalFileName) + 1);
}
@@ -2214,6 +2373,11 @@ static BOOL WINAPI CommitUrlCacheEntryInternal(
dwOffsetHeader = dwBytesNeeded;
dwBytesNeeded = DWORD_ALIGN(dwBytesNeeded + dwHeaderSize);
}
if (lpszFileExtensionA)
{
dwOffsetFileExtension = dwBytesNeeded;
dwBytesNeeded = DWORD_ALIGN(dwBytesNeeded + strlen(lpszFileExtensionA) + 1);
}
/* round up to next block */
if (dwBytesNeeded % BLOCKSIZE)
@@ -2224,10 +2388,9 @@ static BOOL WINAPI CommitUrlCacheEntryInternal(
if (!URLCache_FindFirstFreeEntry(pHeader, dwBytesNeeded / BLOCKSIZE, &pEntry))
{
URLCacheContainer_UnlockIndex(pContainer, pHeader);
ERR("no free entries\n");
SetLastError(ERROR_DISK_FULL);
return FALSE;
error = ERROR_DISK_FULL;
goto cleanup;
}
/* FindFirstFreeEntry fills in blocks used */
@@ -2238,6 +2401,7 @@ static BOOL WINAPI CommitUrlCacheEntryInternal(
pUrlEntry->dwHeaderInfoSize = dwHeaderSize;
pUrlEntry->dwExemptDelta = 0;
pUrlEntry->dwHitRate = 0;
pUrlEntry->dwOffsetFileExtension = dwOffsetFileExtension;
pUrlEntry->dwOffsetHeaderInfo = dwOffsetHeader;
pUrlEntry->dwOffsetLocalName = dwOffsetLocalFileName;
pUrlEntry->dwOffsetUrl = DWORD_ALIGN(sizeof(*pUrlEntry));
@@ -2258,27 +2422,38 @@ static BOOL WINAPI CommitUrlCacheEntryInternal(
pUrlEntry->dwUnknown3 = 0x60;
pUrlEntry->Unknown4 = 0;
pUrlEntry->wUnknown5 = 0x1010;
pUrlEntry->dwUnknown6 = 0;
pUrlEntry->dwUnknown7 = 0;
pUrlEntry->dwUnknown8 = 0;
strcpy((LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl, achUrl);
strcpy((LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl, lpszUrlNameA);
if (dwOffsetLocalFileName)
strcpy((LPSTR)((LPBYTE)pUrlEntry + dwOffsetLocalFileName), pchLocalFileName + DIR_LENGTH + 1);
if (dwOffsetHeader)
memcpy((LPBYTE)pUrlEntry + dwOffsetHeader, lpHeaderInfo, dwHeaderSize);
memcpy((LPBYTE)pUrlEntry + dwOffsetHeader, lpHeaderInfo, dwHeaderSize);
if (dwOffsetFileExtension)
strcpy((LPSTR)((LPBYTE)pUrlEntry + dwOffsetFileExtension), lpszFileExtensionA);
if (!URLCache_AddEntryToHash(pHeader, achUrl, (DWORD)((LPBYTE)pUrlEntry - (LPBYTE)pHeader)))
if (!URLCache_AddEntryToHash(pHeader, lpszUrlNameA, (DWORD)((LPBYTE)pUrlEntry - (LPBYTE)pHeader)))
{
URLCache_DeleteEntry(pHeader, &pUrlEntry->CacheFileEntry);
URLCacheContainer_UnlockIndex(pContainer, pHeader);
HeapFree(GetProcessHeap(), 0, lpszUrlNameA);
return FALSE;
}
cleanup:
URLCacheContainer_UnlockIndex(pContainer, pHeader);
HeapFree(GetProcessHeap(), 0, lpszUrlNameA);
HeapFree(GetProcessHeap(), 0, lpszFileExtensionA);
return TRUE;
if (error == ERROR_SUCCESS)
return TRUE;
else
{
SetLastError(error);
return FALSE;
}
}
/***********************************************************************
@@ -2298,11 +2473,11 @@ BOOL WINAPI CommitUrlCacheEntryA(
)
{
DWORD len;
WCHAR *url_name;
WCHAR *local_file_name;
WCHAR *url_name = NULL;
WCHAR *local_file_name = NULL;
WCHAR *original_url = NULL;
WCHAR *file_extension = NULL;
BOOL bSuccess = FALSE;
DWORD dwError = 0;
TRACE("(%s, %s, ..., ..., %x, %p, %d, %s, %s)\n",
debugstr_a(lpszUrlName),
@@ -2313,51 +2488,47 @@ BOOL WINAPI CommitUrlCacheEntryA(
debugstr_a(lpszFileExtension),
debugstr_a(lpszOriginalUrl));
if (lpszFileExtension != 0)
len = MultiByteToWideChar(CP_ACP, 0, lpszUrlName, -1, NULL, 0);
url_name = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (!url_name)
goto cleanup;
MultiByteToWideChar(CP_ACP, 0, lpszUrlName, -1, url_name, len);
if (lpszLocalFileName)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
len = MultiByteToWideChar(CP_ACP, 0, lpszLocalFileName, -1, NULL, 0);
local_file_name = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (!local_file_name)
goto cleanup;
MultiByteToWideChar(CP_ACP, 0, lpszLocalFileName, -1, local_file_name, len);
}
if ((len = MultiByteToWideChar(CP_ACP, 0, lpszUrlName, -1, NULL, 0)) != 0 &&
(url_name = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR))) != 0)
if (lpszFileExtension)
{
MultiByteToWideChar(CP_ACP, 0, lpszUrlName, -1, url_name, len);
if ((len = MultiByteToWideChar(CP_ACP, 0, lpszLocalFileName, -1, NULL, 0)) != 0 &&
(local_file_name = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR))) != 0)
{
MultiByteToWideChar(CP_ACP, 0, lpszLocalFileName, -1, local_file_name, len);
if (!lpszOriginalUrl ||
((len = MultiByteToWideChar(CP_ACP, 0, lpszOriginalUrl, -1, NULL, 0)) != 0 &&
(original_url = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR))) != 0))
{
if (original_url)
MultiByteToWideChar(CP_ACP, 0, lpszOriginalUrl, -1, original_url, len);
if (CommitUrlCacheEntryInternal(url_name, local_file_name, ExpireTime, LastModifiedTime,
CacheEntryType, lpHeaderInfo, dwHeaderSize,
NULL, original_url))
{
bSuccess = TRUE;
}
else
{
dwError = GetLastError();
}
HeapFree(GetProcessHeap(), 0, original_url);
}
else
{
dwError = GetLastError();
}
HeapFree(GetProcessHeap(), 0, local_file_name);
}
else
{
dwError = GetLastError();
}
HeapFree(GetProcessHeap(), 0, url_name);
if (!bSuccess)
SetLastError(dwError);
len = MultiByteToWideChar(CP_ACP, 0, lpszFileExtension, -1, NULL, 0);
file_extension = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (!file_extension)
goto cleanup;
MultiByteToWideChar(CP_ACP, 0, lpszFileExtension, -1, file_extension, len);
}
if (lpszOriginalUrl)
{
len = MultiByteToWideChar(CP_ACP, 0, lpszOriginalUrl, -1, NULL, 0);
original_url = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (!original_url)
goto cleanup;
MultiByteToWideChar(CP_ACP, 0, lpszOriginalUrl, -1, original_url, len);
}
bSuccess = CommitUrlCacheEntryInternal(url_name, local_file_name, ExpireTime, LastModifiedTime,
CacheEntryType, lpHeaderInfo, dwHeaderSize,
file_extension, original_url);
cleanup:
HeapFree(GetProcessHeap(), 0, original_url);
HeapFree(GetProcessHeap(), 0, file_extension);
HeapFree(GetProcessHeap(), 0, local_file_name);
HeapFree(GetProcessHeap(), 0, url_name);
return bSuccess;
}
@@ -2693,15 +2864,6 @@ BOOL WINAPI CreateUrlCacheContainerW(DWORD d1, DWORD d2, DWORD d3, DWORD d4,
return TRUE;
}
/***********************************************************************
* FindCloseUrlCache (WININET.@)
*/
BOOL WINAPI FindCloseUrlCache(HANDLE hEnumHandle)
{
FIXME("(%p) stub\n", hEnumHandle);
return TRUE;
}
/***********************************************************************
* FindFirstUrlCacheContainerA (WININET.@)
*/
@@ -2776,6 +2938,17 @@ HANDLE WINAPI FindFirstUrlCacheEntryExW(
return NULL;
}
#define URLCACHE_FIND_ENTRY_HANDLE_MAGIC 0xF389ABCD
typedef struct URLCacheFindEntryHandle
{
DWORD dwMagic;
LPWSTR lpszUrlSearchPattern;
DWORD dwContainerIndex;
DWORD dwHashTableIndex;
DWORD dwHashEntryIndex;
} URLCacheFindEntryHandle;
/***********************************************************************
* FindFirstUrlCacheEntryA (WININET.@)
*
@@ -2783,9 +2956,38 @@ HANDLE WINAPI FindFirstUrlCacheEntryExW(
INTERNETAPI HANDLE WINAPI FindFirstUrlCacheEntryA(LPCSTR lpszUrlSearchPattern,
LPINTERNET_CACHE_ENTRY_INFOA lpFirstCacheEntryInfo, LPDWORD lpdwFirstCacheEntryInfoBufferSize)
{
FIXME("(%s, %p, %p): stub\n", debugstr_a(lpszUrlSearchPattern), lpFirstCacheEntryInfo, lpdwFirstCacheEntryInfoBufferSize);
SetLastError(ERROR_FILE_NOT_FOUND);
return 0;
URLCacheFindEntryHandle *pEntryHandle;
TRACE("(%s, %p, %p)\n", debugstr_a(lpszUrlSearchPattern), lpFirstCacheEntryInfo, lpdwFirstCacheEntryInfoBufferSize);
pEntryHandle = HeapAlloc(GetProcessHeap(), 0, sizeof(*pEntryHandle));
if (!pEntryHandle)
return NULL;
pEntryHandle->dwMagic = URLCACHE_FIND_ENTRY_HANDLE_MAGIC;
if (lpszUrlSearchPattern)
{
int len = MultiByteToWideChar(CP_ACP, 0, lpszUrlSearchPattern, -1, NULL, 0);
pEntryHandle->lpszUrlSearchPattern = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (!pEntryHandle->lpszUrlSearchPattern)
{
HeapFree(GetProcessHeap(), 0, pEntryHandle);
return NULL;
}
MultiByteToWideChar(CP_ACP, 0, lpszUrlSearchPattern, -1, pEntryHandle->lpszUrlSearchPattern, len);
}
else
pEntryHandle->lpszUrlSearchPattern = NULL;
pEntryHandle->dwContainerIndex = 0;
pEntryHandle->dwHashTableIndex = 0;
pEntryHandle->dwHashEntryIndex = 0;
if (!FindNextUrlCacheEntryA(pEntryHandle, lpFirstCacheEntryInfo, lpdwFirstCacheEntryInfoBufferSize))
{
HeapFree(GetProcessHeap(), 0, pEntryHandle);
return NULL;
}
return pEntryHandle;
}
/***********************************************************************
@@ -2795,26 +2997,113 @@ INTERNETAPI HANDLE WINAPI FindFirstUrlCacheEntryA(LPCSTR lpszUrlSearchPattern,
INTERNETAPI HANDLE WINAPI FindFirstUrlCacheEntryW(LPCWSTR lpszUrlSearchPattern,
LPINTERNET_CACHE_ENTRY_INFOW lpFirstCacheEntryInfo, LPDWORD lpdwFirstCacheEntryInfoBufferSize)
{
FIXME("(%s, %p, %p): stub\n", debugstr_w(lpszUrlSearchPattern), lpFirstCacheEntryInfo, lpdwFirstCacheEntryInfoBufferSize);
SetLastError(ERROR_FILE_NOT_FOUND);
return 0;
}
HANDLE WINAPI FindFirstUrlCacheGroup( DWORD dwFlags, DWORD dwFilter, LPVOID lpSearchCondition,
DWORD dwSearchCondition, GROUPID* lpGroupId, LPVOID lpReserved )
{
FIXME("(0x%08x, 0x%08x, %p, 0x%08x, %p, %p) stub\n", dwFlags, dwFilter, lpSearchCondition,
dwSearchCondition, lpGroupId, lpReserved);
return NULL;
URLCacheFindEntryHandle *pEntryHandle;
TRACE("(%s, %p, %p)\n", debugstr_w(lpszUrlSearchPattern), lpFirstCacheEntryInfo, lpdwFirstCacheEntryInfoBufferSize);
pEntryHandle = HeapAlloc(GetProcessHeap(), 0, sizeof(*pEntryHandle));
if (!pEntryHandle)
return NULL;
pEntryHandle->dwMagic = URLCACHE_FIND_ENTRY_HANDLE_MAGIC;
if (lpszUrlSearchPattern)
{
int len = strlenW(lpszUrlSearchPattern);
pEntryHandle->lpszUrlSearchPattern = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR));
if (!pEntryHandle->lpszUrlSearchPattern)
{
HeapFree(GetProcessHeap(), 0, pEntryHandle);
return NULL;
}
memcpy(pEntryHandle->lpszUrlSearchPattern, lpszUrlSearchPattern, (len + 1) * sizeof(WCHAR));
}
else
pEntryHandle->lpszUrlSearchPattern = NULL;
pEntryHandle->dwContainerIndex = 0;
pEntryHandle->dwHashTableIndex = 0;
pEntryHandle->dwHashEntryIndex = 0;
if (!FindNextUrlCacheEntryW(pEntryHandle, lpFirstCacheEntryInfo, lpdwFirstCacheEntryInfoBufferSize))
{
HeapFree(GetProcessHeap(), 0, pEntryHandle);
return NULL;
}
return pEntryHandle;
}
/***********************************************************************
* FindNextUrlCacheEntryA (WININET.@)
*/
BOOL WINAPI FindNextUrlCacheEntryA(
HANDLE hEnumHandle,
LPINTERNET_CACHE_ENTRY_INFOA lpNextCacheEntryInfo,
LPDWORD lpdwNextCacheEntryInfoBufferSize
)
LPDWORD lpdwNextCacheEntryInfoBufferSize)
{
FIXME("(%p, %p, %p) stub\n", hEnumHandle, lpNextCacheEntryInfo, lpdwNextCacheEntryInfoBufferSize);
URLCacheFindEntryHandle *pEntryHandle = (URLCacheFindEntryHandle *)hEnumHandle;
URLCACHECONTAINER * pContainer;
TRACE("(%p, %p, %p)\n", hEnumHandle, lpNextCacheEntryInfo, lpdwNextCacheEntryInfoBufferSize);
if (pEntryHandle->dwMagic != URLCACHE_FIND_ENTRY_HANDLE_MAGIC)
{
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
for (; URLCacheContainers_Enum(pEntryHandle->lpszUrlSearchPattern, pEntryHandle->dwContainerIndex, &pContainer);
pEntryHandle->dwContainerIndex++, pEntryHandle->dwHashTableIndex = 0)
{
LPURLCACHE_HEADER pHeader;
HASH_CACHEFILE_ENTRY *pHashTableEntry;
if (!URLCacheContainer_OpenIndex(pContainer))
return FALSE;
if (!(pHeader = URLCacheContainer_LockIndex(pContainer)))
return FALSE;
for (; URLCache_EnumHashTables(pHeader, &pEntryHandle->dwHashTableIndex, &pHashTableEntry);
pEntryHandle->dwHashTableIndex++, pEntryHandle->dwHashEntryIndex = 0)
{
const struct _HASH_ENTRY *pHashEntry = NULL;
for (; URLCache_EnumHashTableEntries(pHeader, pHashTableEntry, &pEntryHandle->dwHashEntryIndex, &pHashEntry);
pEntryHandle->dwHashEntryIndex++)
{
const URL_CACHEFILE_ENTRY *pUrlEntry;
const CACHEFILE_ENTRY *pEntry = (const CACHEFILE_ENTRY *)((LPBYTE)pHeader + pHashEntry->dwOffsetEntry);
if (pEntry->dwSignature != URL_SIGNATURE)
continue;
pUrlEntry = (URL_CACHEFILE_ENTRY *)pEntry;
TRACE("Found URL: %s\n", (LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl);
TRACE("Header info: %s\n", (LPBYTE)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo);
if (!URLCache_CopyEntry(
pContainer,
pHeader,
lpNextCacheEntryInfo,
lpdwNextCacheEntryInfoBufferSize,
pUrlEntry,
FALSE /* not UNICODE */))
{
URLCacheContainer_UnlockIndex(pContainer, pHeader);
return FALSE;
}
TRACE("Local File Name: %s\n", debugstr_a(lpNextCacheEntryInfo->lpszLocalFileName));
/* increment the current index so that next time the function
* is called the next entry is returned */
pEntryHandle->dwHashEntryIndex++;
URLCacheContainer_UnlockIndex(pContainer, pHeader);
return TRUE;
}
}
URLCacheContainer_UnlockIndex(pContainer, pHeader);
}
SetLastError(ERROR_NO_MORE_ITEMS);
return FALSE;
}
@@ -2825,9 +3114,40 @@ BOOL WINAPI FindNextUrlCacheEntryW(
)
{
FIXME("(%p, %p, %p) stub\n", hEnumHandle, lpNextCacheEntryInfo, lpdwNextCacheEntryInfoBufferSize);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/***********************************************************************
* FindCloseUrlCache (WININET.@)
*/
BOOL WINAPI FindCloseUrlCache(HANDLE hEnumHandle)
{
URLCacheFindEntryHandle *pEntryHandle = (URLCacheFindEntryHandle *)hEnumHandle;
TRACE("(%p)\n", hEnumHandle);
if (!pEntryHandle || pEntryHandle->dwMagic != URLCACHE_FIND_ENTRY_HANDLE_MAGIC)
{
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
pEntryHandle->dwMagic = 0;
HeapFree(GetProcessHeap(), 0, pEntryHandle->lpszUrlSearchPattern);
HeapFree(GetProcessHeap(), 0, pEntryHandle);
return TRUE;
}
HANDLE WINAPI FindFirstUrlCacheGroup( DWORD dwFlags, DWORD dwFilter, LPVOID lpSearchCondition,
DWORD dwSearchCondition, GROUPID* lpGroupId, LPVOID lpReserved )
{
FIXME("(0x%08x, 0x%08x, %p, 0x%08x, %p, %p) stub\n", dwFlags, dwFilter, lpSearchCondition,
dwSearchCondition, lpGroupId, lpReserved);
return NULL;
}
BOOL WINAPI FindNextUrlCacheEntryExA(
HANDLE hEnumHandle,
LPINTERNET_CACHE_ENTRY_INFOA lpFirstCacheEntryInfo,
@@ -3012,8 +3332,8 @@ BOOL WINAPI IsUrlCacheEntryExpiredA( LPCSTR url, DWORD dwFlags, FILETIME* pftLas
{
LPURLCACHE_HEADER pHeader;
struct _HASH_ENTRY * pHashEntry;
CACHEFILE_ENTRY * pEntry;
URL_CACHEFILE_ENTRY * pUrlEntry;
const CACHEFILE_ENTRY * pEntry;
const URL_CACHEFILE_ENTRY * pUrlEntry;
URLCACHECONTAINER * pContainer;
TRACE("(%s, %08x, %p)\n", debugstr_a(url), dwFlags, pftLastModified);
@@ -3035,7 +3355,7 @@ BOOL WINAPI IsUrlCacheEntryExpiredA( LPCSTR url, DWORD dwFlags, FILETIME* pftLas
return FALSE;
}
pEntry = (CACHEFILE_ENTRY *)((LPBYTE)pHeader + pHashEntry->dwOffsetEntry);
pEntry = (const CACHEFILE_ENTRY *)((LPBYTE)pHeader + pHashEntry->dwOffsetEntry);
if (pEntry->dwSignature != URL_SIGNATURE)
{
URLCacheContainer_UnlockIndex(pContainer, pHeader);
@@ -3044,7 +3364,7 @@ BOOL WINAPI IsUrlCacheEntryExpiredA( LPCSTR url, DWORD dwFlags, FILETIME* pftLas
return FALSE;
}
pUrlEntry = (URL_CACHEFILE_ENTRY *)pEntry;
pUrlEntry = (const URL_CACHEFILE_ENTRY *)pEntry;
DosDateTimeToFileTime(pUrlEntry->wExpiredDate, pUrlEntry->wExpiredTime, pftLastModified);
@@ -3065,8 +3385,8 @@ BOOL WINAPI IsUrlCacheEntryExpiredW( LPCWSTR url, DWORD dwFlags, FILETIME* pftLa
{
LPURLCACHE_HEADER pHeader;
struct _HASH_ENTRY * pHashEntry;
CACHEFILE_ENTRY * pEntry;
URL_CACHEFILE_ENTRY * pUrlEntry;
const CACHEFILE_ENTRY * pEntry;
const URL_CACHEFILE_ENTRY * pUrlEntry;
URLCACHECONTAINER * pContainer;
TRACE("(%s, %08x, %p)\n", debugstr_w(url), dwFlags, pftLastModified);
@@ -3088,7 +3408,7 @@ BOOL WINAPI IsUrlCacheEntryExpiredW( LPCWSTR url, DWORD dwFlags, FILETIME* pftLa
return FALSE;
}
pEntry = (CACHEFILE_ENTRY *)((LPBYTE)pHeader + pHashEntry->dwOffsetEntry);
pEntry = (const CACHEFILE_ENTRY *)((LPBYTE)pHeader + pHashEntry->dwOffsetEntry);
if (pEntry->dwSignature != URL_SIGNATURE)
{
URLCacheContainer_UnlockIndex(pContainer, pHeader);
@@ -3097,7 +3417,7 @@ BOOL WINAPI IsUrlCacheEntryExpiredW( LPCWSTR url, DWORD dwFlags, FILETIME* pftLa
return FALSE;
}
pUrlEntry = (URL_CACHEFILE_ENTRY *)pEntry;
pUrlEntry = (const URL_CACHEFILE_ENTRY *)pEntry;
DosDateTimeToFileTime(pUrlEntry->wExpiredDate, pUrlEntry->wExpiredTime, pftLastModified);

View File

@@ -37,7 +37,6 @@
#include "wine/debug.h"
#include "internet.h"
#define CP_UNIXCP CP_THREAD_ACP
WINE_DEFAULT_DEBUG_CHANNEL(wininet);
@@ -72,6 +71,7 @@ time_t ConvertTimeString(LPCWSTR asctime)
tmpChar[22]='\0';
tmpChar[25]='\0';
memset( &t, 0, sizeof(t) );
t.tm_year = atoiW(tmpChar+12) - 1900;
t.tm_mday = atoiW(tmpChar+5);
t.tm_hour = atoiW(tmpChar+17);
@@ -163,7 +163,7 @@ BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort,
memset(psa,0,sizeof(struct sockaddr_in));
memcpy((char *)&psa->sin_addr, phe->h_addr, phe->h_length);
psa->sin_family = phe->h_addrtype;
psa->sin_port = htons((u_short)nServerPort);
psa->sin_port = htons(nServerPort);
return TRUE;
}

View File

@@ -116,8 +116,8 @@
@ stdcall InternetAutodial(long ptr)
@ stub InternetAutodialCallback
@ stdcall InternetAutodialHangup(long)
@ stdcall InternetCanonicalizeUrlA(str str ptr long)
@ stdcall InternetCanonicalizeUrlW(wstr wstr ptr long)
@ stdcall InternetCanonicalizeUrlA(str ptr ptr long)
@ stdcall InternetCanonicalizeUrlW(wstr ptr ptr long)
@ stdcall InternetCheckConnectionA(ptr long long)
@ stdcall InternetCheckConnectionW(ptr long long)
@ stdcall InternetClearAllPerSiteCookieDecisions()

View File

@@ -0,0 +1,44 @@
/*
* Copyright 2008 Jens Albretsen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
LANGUAGE LANG_DANISH, SUBLANG_DEFAULT
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Skriv netværkskodeord"
FONT 8, "MS Shell Dlg"
{
LTEXT "Skriv dit brugernavn og kodeord:", -1, 40, 6, 150, 15
LTEXT "Proxy", -1, 40, 26, 50, 10
LTEXT "Realm", -1, 40, 46, 50, 10
LTEXT "Brugernavn", -1, 40, 66, 50, 10
LTEXT "Kodeord", -1, 40, 86, 50, 10
LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0
LTEXT "" IDC_REALM, 80, 46, 150, 14, 0
EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
CHECKBOX "&Gem dette kodeord (usikkert)", IDC_SAVEPASSWORD,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Annuller", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
{
IDS_LANCONNECTION "Lokal netværksforbindelse"
}

View File

@@ -27,7 +27,7 @@ FONT 8, "MS Shell Dlg"
{
LTEXT "Ââåäèòå èìÿ ïîëüçîâàòåëÿ è ïàðîëü:", -1, 40, 6, 150, 15
LTEXT "Ïðîêñè", -1, 40, 26, 50, 10
LTEXT "Realm", -1, 40, 46, 50, 10
LTEXT "Äîìåí", -1, 40, 46, 50, 10
LTEXT "Ïîëüçîâàòåëü", -1, 40, 66, 50, 10
LTEXT "Ïàðîëü", -1, 40, 86, 50, 10
LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0
@@ -39,3 +39,8 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Îòìåíà", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
{
IDS_LANCONNECTION "Ñåòåâîå ïîäêëþ÷åíèå"
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2003 Rok Mandeljc <rok.mandeljc@gimb.org>
* Copyright 2003, 2008 Rok Mandeljc
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -16,24 +16,33 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#pragma code_page(65001)
LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Vnos omrežnega gesla"
CAPTION "Vnos omrežnega gesla"
FONT 8, "MS Shell Dlg"
{
LTEXT "Vnesite uporabniško ime in geslo:", -1, 40, 6, 150, 15
LTEXT "Proxy", -1, 40, 26, 50, 10
LTEXT "Realm", -1, 40, 46, 50, 10
LTEXT "Uporabniško ime", -1, 40, 66, 50, 10
LTEXT "Vnesite uporabniško ime in geslo:", -1, 40, 6, 150, 15
LTEXT "Proksi", -1, 40, 26, 50, 10
LTEXT "Kraljestvo", -1, 40, 46, 50, 10
LTEXT "Uporabniško ime", -1, 40, 66, 50, 10
LTEXT "Geslo", -1, 40, 86, 50, 10
LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0
LTEXT "" IDC_REALM, 80, 46, 150, 14, 0
EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
CHECKBOX "&Shrani geslo (nezašèiteno)", IDC_SAVEPASSWORD,
CHECKBOX "&Shrani geslo (nezaščiteno)", IDC_SAVEPASSWORD,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "V redu", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Preklièi", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "Prekliči", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
{
IDS_LANCONNECTION "LAN povezava"
}
#pragma code_page(default)

View File

@@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT
LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU

View File

@@ -1,20 +1,6 @@
Index: ftp.c
===================================================================
--- ftp.c (revision 30893)
+++ ftp.c (working copy)
@@ -58,6 +58,7 @@
#include "wine/debug.h"
#include "internet.h"
+typedef size_t socklen_t;
WINE_DEFAULT_DEBUG_CHANNEL(wininet);
Index: http.c
===================================================================
--- http.c (revision 30893)
+++ http.c (working copy)
@@ -60,6 +60,8 @@
--- D:/Wine-CVS/wine/dlls/wininet/http.c Wed May 28 14:33:28 2008
+++ D:/ReactOS-Trunk/reactos/dll/win32/wininet/http.c Sat May 31 11:59:23 2008
@@ -61,6 +61,8 @@
#include "wine/debug.h"
#include "wine/unicode.h"
@@ -22,345 +8,115 @@ Index: http.c
+
WINE_DEFAULT_DEBUG_CHANNEL(wininet);
static const WCHAR g_szHttp1_0[] = {' ','H','T','T','P','/','1','.','0',0 };
@@ -3010,7 +3011,11 @@
/*
* HACK peek at the buffer
*/
+#if 0
+ /* This is Wine code, we don't support MSG_PEEK yet so we have to do it
+ a bit different */
NETCON_recv(&lpwhr->netConnection, buffer, buflen, MSG_PEEK, &rc);
+#endif
static const WCHAR g_szHttp1_0[] = {'H','T','T','P','/','1','.','0',0};
@@ -1617,8 +1619,9 @@
/*
* We should first receive 'HTTP/1.x nnn OK' where nnn is the status code.
@@ -3019,6 +3024,9 @@
memset(buffer, 0, MAX_REPLY_LEN);
if (!NETCON_getNextLine(&lpwhr->netConnection, bufferA, &buflen))
goto lend;
+#if 1
+ rc = buflen;
+#endif
MultiByteToWideChar( CP_ACP, 0, bufferA, buflen, buffer, MAX_REPLY_LEN );
if(req->lpszCacheFile) {
BOOL res;
+ DWORD dwBytesWritten;
/* regenerate raw headers */
Index: inet_ntop.c
===================================================================
--- inet_ntop.c (revision 30893)
+++ inet_ntop.c (working copy)
@@ -0,0 +1,189 @@
+/* from NetBSD: inet_ntop.c,v 1.9 2000/01/22 22:19:16 mycroft Exp */
+
+/* Copyright (c) 1996 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+#define ENOSPC 28
+#define EAFNOSUPPORT 52
+
+#ifndef IN6ADDRSZ
+#define IN6ADDRSZ 16
+#endif
+
+#ifndef INT16SZ
+#define INT16SZ 2
+#endif
+
+#ifdef SPRINTF_CHAR
+# define SPRINTF(x) strlen(sprintf/**/x)
+#else
+# define SPRINTF(x) ((size_t)sprintf x)
+#endif
+
+/*
+ * WARNING: Don't even consider trying to compile this on a system where
+ * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
+ */
+
+static const char *inet_ntop4(const u_char *src, char *dst, size_t size);
+static const char *inet_ntop6(const u_char *src, char *dst, size_t size);
+
+/* char *
+ * inet_ntop(af, src, dst, size)
+ * convert a network format address to presentation format.
+ * return:
+ * pointer to presentation format address (`dst'), or NULL (see errno).
+ * author:
+ * Paul Vixie, 1996.
+ */
+const char *
+inet_ntop(int af, const void *src, char *dst, size_t size)
+{
+
+ switch (af) {
+ case AF_INET:
+ return (inet_ntop4(src, dst, size));
+#ifdef INET6
+ case AF_INET6:
+ return (inet_ntop6(src, dst, size));
+#endif
+ default:
+ errno = EAFNOSUPPORT;
+ return (NULL);
+ }
+ /* NOTREACHED */
+}
+
+/* const char *
+ * inet_ntop4(src, dst, size)
+ * format an IPv4 address, more or less like inet_ntoa()
+ * return:
+ * `dst' (as a const)
+ * notes:
+ * (1) uses no statics
+ * (2) takes a u_char* not an in_addr as input
+ * author:
+ * Paul Vixie, 1996.
+ */
+static const char *
+inet_ntop4(const u_char *src, char *dst, size_t size)
+{
+ static const char fmt[] = "%u.%u.%u.%u";
+ char tmp[sizeof "255.255.255.255"];
+
+ if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) > size) {
+ errno = ENOSPC;
+ return (NULL);
+ }
+ strcpy(dst, tmp);
+ return (dst);
+}
+
+#ifdef INET6
+/* const char *
+ * inet_ntop6(src, dst, size)
+ * convert IPv6 binary address into presentation (printable) format
+ * author:
+ * Paul Vixie, 1996.
+ */
+static const char *
+inet_ntop6(const u_char *src, char *dst, size_t size)
+{
+ /*
+ * Note that int32_t and int16_t need only be "at least" large enough
+ * to contain a value of the specified size. On some systems, like
+ * Crays, there is no such thing as an integer variable with 16 bits.
+ * Keep this in mind if you think this function should have been coded
+ * to use pointer overlays. All the world's not a VAX.
+ */
+ char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
+ struct { int base, len; } best, cur;
+ u_int words[IN6ADDRSZ / INT16SZ];
+ int i;
+
+ /*
+ * Preprocess:
+ * Copy the input (bytewise) array into a wordwise array.
+ * Find the longest run of 0x00's in src[] for :: shorthanding.
+ */
+ memset(words, '\0', sizeof words);
+ for (i = 0; i < IN6ADDRSZ; i++)
+ words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
+ best.base = -1;
+ cur.base = -1;
+ for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) {
+ if (words[i] == 0) {
+ if (cur.base == -1)
+ cur.base = i, cur.len = 1;
+ else
+ cur.len++;
+ } else {
+ if (cur.base != -1) {
+ if (best.base == -1 || cur.len > best.len)
+ best = cur;
+ cur.base = -1;
+ }
+ }
+ }
+ if (cur.base != -1) {
+ if (best.base == -1 || cur.len > best.len)
+ best = cur;
+ }
+ if (best.base != -1 && best.len < 2)
+ best.base = -1;
+
+ /*
+ * Format the result.
+ */
+ tp = tmp;
+ for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) {
+ /* Are we inside the best run of 0x00's? */
+ if (best.base != -1 && i >= best.base &&
+ i < (best.base + best.len)) {
+ if (i == best.base)
+ *tp++ = ':';
+ continue;
+ }
+ /* Are we following an initial run of 0x00s or any real hex? */
+ if (i != 0)
+ *tp++ = ':';
+ /* Is this address an encapsulated IPv4? */
+ if (i == 6 && best.base == 0 &&
+ (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
+ if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp)))
+ return (NULL);
+ tp += strlen(tp);
+ break;
+ }
+ tp += SPRINTF((tp, "%x", words[i]));
+ }
+ /* Was it a trailing run of 0x00's? */
+ if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ))
+ *tp++ = ':';
+ *tp++ = '\0';
+
+ /*
+ * Check for overflow, copy, and we're done.
+ */
+ if ((size_t)(tp - tmp) > size) {
+ errno = ENOSPC;
+ return (NULL);
+ }
+ strcpy(dst, tmp);
+ return (dst);
+}
+#endif
+
Index: internet.c
===================================================================
--- internet.c (revision 30893)
+++ internet.c (working copy)
@@ -67,6 +67,7 @@
#include "resource.h"
- res = WriteFile(req->hCacheFile, buffer, bytes_read, NULL, NULL);
+ res = WriteFile(req->hCacheFile, buffer, bytes_read, &dwBytesWritten, NULL);
if(!res)
WARN("WriteFile failed: %u\n", GetLastError());
}
--- D:/Wine-CVS/wine/dlls/wininet/internet.c Wed May 28 14:33:28 2008
+++ D:/ReactOS-Trunk/reactos/dll/win32/wininet/internet.c Fri May 30 18:04:29 2008
@@ -3101,19 +3101,22 @@
#include "wine/unicode.h"
+#define CP_UNIXCP CP_THREAD_ACP
LPSTR INTERNET_GetNextLine(INT nSocket, LPDWORD dwLen)
{
- struct pollfd pfd;
+ struct timeval tv;
+ fd_set infd;
BOOL bSuccess = FALSE;
INT nRecv = 0;
LPSTR lpszBuffer = INTERNET_GetResponseBuffer();
WINE_DEFAULT_DEBUG_CHANNEL(wininet);
TRACE("\n");
Index: netconnection.c
===================================================================
--- netconnection.c (revision 30893)
+++ netconnection.c (working copy)
@@ -58,6 +58,8 @@
#include "internet.h"
- pfd.fd = nSocket;
- pfd.events = POLLIN;
+ FD_ZERO(&infd);
+ FD_SET(nSocket, &infd);
+ tv.tv_sec=RESPONSE_TIMEOUT;
+ tv.tv_usec=0;
while (nRecv < MAX_REPLY_LEN)
{
- if (poll(&pfd,1, RESPONSE_TIMEOUT * 1000) > 0)
+ if (select(nSocket+1,&infd,NULL,NULL,&tv) > 0)
{
if (recv(nSocket, &lpszBuffer[nRecv], 1, 0) <= 0)
{
--- D:/Wine-CVS/wine/dlls/wininet/internet.h Fri Mar 28 20:13:36 2008
+++ D:/ReactOS-Trunk/reactos/dll/win32/wininet/internet.h Thu May 29 19:01:31 2008
@@ -23,6 +23,9 @@
#ifndef _WINE_INTERNET_H_
#define _WINE_INTERNET_H_
+/* ReactOS-specific definitions */
+#define CP_UNIXCP CP_THREAD_ACP
+
#ifndef __WINE_CONFIG_H
# error You must include config.h to use this header
#endif
--- D:/Wine-CVS/wine/dlls/wininet/netconnection.c Sat May 17 12:09:49 2008
+++ D:/ReactOS-Trunk/reactos/dll/win32/wininet/netconnection.c Sat May 31 12:01:55 2008
@@ -64,7 +64,7 @@
#include "winsock2.h"
#define RESPONSE_TIMEOUT 30 /* FROM internet.c */
-
+#define sock_get_error(x) WSAGetLastError()
+#undef FIONREAD
WINE_DEFAULT_DEBUG_CHANNEL(wininet);
@@ -200,6 +202,7 @@
@@ -206,6 +206,7 @@
return TRUE;
}
+#ifndef __REACTOS__
+#if 0
/* translate a unix error code into a winsock one */
static int sock_get_error( int err )
{
@@ -263,6 +266,7 @@
default: errno=err; perror("sock_set_error"); return WSAEFAULT;
}
@@ -272,6 +273,7 @@
#endif
return err;
}
+#endif
/******************************************************************************
* NETCON_create
Index: rsrc.rc
===================================================================
--- rsrc.rc (revision 30893)
+++ rsrc.rc (working copy)
@@ -60,3 +60,4 @@
@@ -616,16 +618,19 @@
if (!connection->useSSL)
{
- struct pollfd pfd;
+ struct timeval tv;
+ fd_set infd;
BOOL bSuccess = FALSE;
DWORD nRecv = 0;
- pfd.fd = connection->socketFD;
- pfd.events = POLLIN;
+ FD_ZERO(&infd);
+ FD_SET(connection->socketFD, &infd);
+ tv.tv_sec=RESPONSE_TIMEOUT;
+ tv.tv_usec=0;
while (nRecv < *dwBuffer)
{
- if (poll(&pfd,1, RESPONSE_TIMEOUT * 1000) > 0)
+ if (select(connection->socketFD+1,&infd,NULL,NULL,&tv) > 0)
{
if (recv(connection->socketFD, &lpszBuffer[nRecv], 1, 0) <= 0)
{
--- D:/Wine-CVS/wine/dlls/wininet/rsrc.rc Thu May 08 21:26:20 2008
+++ D:/ReactOS-Trunk/reactos/dll/win32/wininet/rsrc.rc Thu May 29 18:57:29 2008
@@ -60,4 +60,5 @@
#include "wininet_Ru.rc"
#include "wininet_Si.rc"
#include "wininet_Sv.rc"
#include "wininet_Tr.rc"
+#include "wininet_Uk.rc"
Index: utility.c
===================================================================
--- utility.c (revision 30893)
+++ utility.c (working copy)
@@ -37,6 +37,7 @@
#include "wine/debug.h"
#include "internet.h"
+#define CP_UNIXCP CP_THREAD_ACP
WINE_DEFAULT_DEBUG_CHANNEL(wininet);
Index: wininet.rbuild
===================================================================
--- wininet.rbuild (revision 30893)
+++ wininet.rbuild (working copy)
@@ -19,6 +19,7 @@
<library>ntdll</library>
<library>secur32</library>
<library>crypt32</library>
+ <library>ws2_32</library>
<file>cookie.c</file>
<file>dialogs.c</file>
<file>ftp.c</file>
Index: wininet_Uk.rc
===================================================================
--- wininet_Uk.rc (revision 30893)
+++ wininet_Uk.rc (working copy)
@@ -0,0 +1,46 @@
+/*
+ * wininet.dll (Ukrainian resources)
+ *
+ * Copyright 2006 Artem Reznikov
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT
+
+IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Ââåä³òü Ìåðåæíèé Ïàðîëü"
+FONT 8, "MS Shell Dlg"
+{
+ LTEXT "Áóäü ëàñêà, ââåä³òü Âàø³ ³ì'ÿ òà ïàðîëü:", -1, 40, 6, 150, 15
+ LTEXT "Ïðîêñ³", -1, 40, 26, 50, 10
+ LTEXT "Îáëàñòü", -1, 40, 46, 50, 10
+ LTEXT "Êîðèñòóâà÷", -1, 40, 66, 50, 10
+ LTEXT "Ïàðîëü", -1, 40, 86, 50, 10
+ LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0
+ LTEXT "" IDC_REALM, 80, 46, 150, 14, 0
+ EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
+ EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
+ CHECKBOX "&Çáåðåãòè öåé ïàðîëü (íåáåçïå÷íî)", IDC_SAVEPASSWORD,
+ 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
+ PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
+ PUSHBUTTON "Ñêàñóâàòè", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
+}
+
+STRINGTABLE DISCARDABLE
+{
+ IDS_LANCONNECTION "ϳäêëþ÷åííÿ ïî ëîêàëüí³é ìåðåæ³"
+}
#include "wininet_Tr.rc"

View File

@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _WINE_WININET_H_
@@ -149,7 +149,7 @@ typedef enum {
} INTERNET_SCHEME,* LPINTERNET_SCHEME;
typedef struct {
DWORD dwResult;
DWORD_PTR dwResult;
DWORD dwError;
} INTERNET_ASYNC_RESULT,* LPINTERNET_ASYNC_RESULT;
@@ -307,6 +307,70 @@ typedef struct _INTERNET_CACHE_GROUP_INFOW {
DECL_WINELIB_TYPE_AW(INTERNET_CACHE_GROUP_INFO)
DECL_WINELIB_TYPE_AW(LPINTERNET_CACHE_GROUP_INFO)
typedef struct _INTERNET_PER_CONN_OPTIONA {
DWORD dwOption;
union {
DWORD dwValue;
LPSTR pszValue;
FILETIME ftValue;
} Value;
} INTERNET_PER_CONN_OPTIONA, *LPINTERNET_PER_CONN_OPTIONA;
typedef struct _INTERNET_PER_CONN_OPTIONW {
DWORD dwOption;
union {
DWORD dwValue;
LPWSTR pszValue;
FILETIME ftValue;
} Value;
} INTERNET_PER_CONN_OPTIONW, *LPINTERNET_PER_CONN_OPTIONW;
DECL_WINELIB_TYPE_AW(INTERNET_PER_CONN_OPTION)
DECL_WINELIB_TYPE_AW(LPINTERNET_PER_CONN_OPTION)
#define INTERNET_PER_CONN_FLAGS 1
#define INTERNET_PER_CONN_PROXY_SERVER 2
#define INTERNET_PER_CONN_PROXY_BYPASS 3
#define INTERNET_PER_CONN_AUTOCONFIG_URL 4
#define INTERNET_PER_CONN_AUTODISCOVERY_FLAGS 5
#define INTERNET_PER_CONN_AUTOCONFIG_SECONDARY_URL 6
#define INTERNET_PER_CONN_AUTOCONFIG_RELOAD_DELAY_MINS 7
#define INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_TIME 8
#define INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_URL 9
/* Values for INTERNET_PER_CONN_FLAGS */
#define PROXY_TYPE_DIRECT 0x00000001
#define PROXY_TYPE_PROXY 0x00000002
#define PROXY_TYPE_AUTO_PROXY_URL 0x00000004
#define PROXY_TYPE_AUTO_DETECT 0x00000008
/* Values for INTERNET_PER_CONN_AUTODISCOVERY_FLAGS */
#define AUTO_PROXY_FLAG_USER_SET 0x00000001
#define AUTO_PROXY_FLAG_ALWAYS_DETECT 0x00000002
#define AUTO_PROXY_FLAG_DETECTION_RUN 0x00000004
#define AUTO_PROXY_FLAG_MIGRATED 0x00000008
#define AUTO_PROXY_FLAG_DONT_CACHE_PROXY_RESULT 0x00000010
#define AUTO_PROXY_FLAG_CACHE_INIT_RUN 0x00000020
#define AUTO_PROXY_FLAG_DETECTION_SUSPECT 0x00000040
typedef struct _INTERNET_PER_CONN_OPTION_LISTA {
DWORD dwSize;
LPSTR pszConnection;
DWORD dwOptionCount;
DWORD dwOptionError;
LPINTERNET_PER_CONN_OPTIONA pOptions;
} INTERNET_PER_CONN_OPTION_LISTA, *LPINTERNET_PER_CONN_OPTION_LISTA;
typedef struct _INTERNET_PER_CONN_OPTION_LISTW {
DWORD dwSize;
LPWSTR pszConnection;
DWORD dwOptionCount;
DWORD dwOptionError;
LPINTERNET_PER_CONN_OPTIONW pOptions;
} INTERNET_PER_CONN_OPTION_LISTW, *LPINTERNET_PER_CONN_OPTION_LISTW;
DECL_WINELIB_TYPE_AW(INTERNET_PER_CONN_OPTION_LIST)
DECL_WINELIB_TYPE_AW(LPINTERNET_PER_CONN_OPTION_LIST)
BOOLAPI InternetTimeFromSystemTimeA(CONST SYSTEMTIME *,DWORD ,LPSTR ,DWORD);
BOOLAPI InternetTimeFromSystemTimeW(CONST SYSTEMTIME *,DWORD ,LPWSTR ,DWORD);
#define InternetTimeFromSystemTime WINELIB_NAME_AW(InternetTimeFromSystemTime)
@@ -342,8 +406,8 @@ BOOLAPI InternetCombineUrlW(LPCWSTR ,LPCWSTR ,LPWSTR ,LPDWORD ,DWORD);
#define ICU_ENCODE_SPACES_ONLY 0x04000000
#define ICU_BROWSER_MODE 0x02000000
INTERNETAPI HINTERNET WINAPI InternetOpenA(LPCSTR ,DWORD ,LPCSTR lpszProxy ,LPCSTR lpszProxyBypass ,DWORD);
INTERNETAPI HINTERNET WINAPI InternetOpenW(LPCWSTR ,DWORD ,LPCWSTR lpszProxy ,LPCWSTR lpszProxyBypass ,DWORD);
INTERNETAPI HINTERNET WINAPI InternetOpenA(LPCSTR ,DWORD ,LPCSTR ,LPCSTR ,DWORD);
INTERNETAPI HINTERNET WINAPI InternetOpenW(LPCWSTR ,DWORD ,LPCWSTR ,LPCWSTR ,DWORD);
#define InternetOpen WINELIB_NAME_AW(InternetOpen)
#define INTERNET_OPEN_TYPE_PRECONFIG 0
@@ -357,9 +421,9 @@ INTERNETAPI HINTERNET WINAPI InternetOpenW(LPCWSTR ,DWORD ,LPCWSTR lpszProxy ,LP
BOOLAPI InternetCloseHandle(HINTERNET);
INTERNETAPI HINTERNET WINAPI InternetConnectA(HINTERNET ,LPCSTR ,INTERNET_PORT ,
LPCSTR lpszUserName ,LPCSTR lpszPassword ,DWORD ,DWORD ,DWORD );
LPCSTR ,LPCSTR ,DWORD ,DWORD ,DWORD_PTR );
INTERNETAPI HINTERNET WINAPI InternetConnectW(HINTERNET ,LPCWSTR ,INTERNET_PORT ,
LPCWSTR lpszUserName ,LPCWSTR lpszPassword ,DWORD ,DWORD ,DWORD );
LPCWSTR ,LPCWSTR ,DWORD ,DWORD ,DWORD_PTR );
#define InternetConnect WINELIB_NAME_AW(InternetConnect)
#define INTERNET_SERVICE_URL 0
@@ -378,13 +442,13 @@ INTERNETAPI HINTERNET WINAPI InternetConnectW(HINTERNET ,LPCWSTR ,INTERNET_PORT
dwContext \
)
INTERNETAPI HINTERNET WINAPI InternetOpenUrlA(HINTERNET ,LPCSTR ,LPCSTR lpszHeaders ,DWORD ,DWORD ,DWORD);
INTERNETAPI HINTERNET WINAPI InternetOpenUrlW(HINTERNET ,LPCWSTR ,LPCWSTR lpszHeaders ,DWORD ,DWORD ,DWORD);
INTERNETAPI HINTERNET WINAPI InternetOpenUrlA(HINTERNET ,LPCSTR ,LPCSTR ,DWORD ,DWORD ,DWORD_PTR);
INTERNETAPI HINTERNET WINAPI InternetOpenUrlW(HINTERNET ,LPCWSTR ,LPCWSTR ,DWORD ,DWORD ,DWORD_PTR);
#define InternetOpenUrl WINELIB_NAME_AW(InternetOpenUrl)
BOOLAPI InternetReadFile( HINTERNET ,LPVOID ,DWORD ,LPDWORD );
INTERNETAPI BOOL WINAPI InternetReadFileExA( HINTERNET ,LPINTERNET_BUFFERSA ,DWORD ,DWORD );
INTERNETAPI BOOL WINAPI InternetReadFileExW( HINTERNET ,LPINTERNET_BUFFERSW ,DWORD ,DWORD );
INTERNETAPI BOOL WINAPI InternetReadFileExA( HINTERNET ,LPINTERNET_BUFFERSA ,DWORD ,DWORD_PTR );
INTERNETAPI BOOL WINAPI InternetReadFileExW( HINTERNET ,LPINTERNET_BUFFERSW ,DWORD ,DWORD_PTR );
#define InternetReadFileEx WINELIB_NAME_AW(InternetReadFileEx)
#define IRF_ASYNC WININET_API_FLAG_ASYNC
@@ -392,23 +456,23 @@ INTERNETAPI BOOL WINAPI InternetReadFileExW( HINTERNET ,LPINTERNET_BUFFERSW ,DWO
#define IRF_USE_CONTEXT WININET_API_FLAG_USE_CONTEXT
#define IRF_NO_WAIT 0x00000008
INTERNETAPI DWORD WINAPI InternetSetFilePointer(HINTERNET ,LONG ,PVOID ,DWORD ,DWORD);
INTERNETAPI DWORD WINAPI InternetSetFilePointer(HINTERNET ,LONG ,PVOID ,DWORD ,DWORD_PTR);
BOOLAPI InternetWriteFile(HINTERNET ,LPCVOID ,DWORD ,LPDWORD);
BOOLAPI InternetQueryDataAvailable(HINTERNET ,LPDWORD lpdwNumberOfBytesAvailable ,DWORD ,DWORD);
BOOLAPI InternetQueryDataAvailable(HINTERNET ,LPDWORD ,DWORD ,DWORD_PTR);
BOOLAPI InternetFindNextFileA(HINTERNET ,LPVOID);
BOOLAPI InternetFindNextFileW(HINTERNET ,LPVOID);
#define InternetFindNextFile WINELIB_NAME_AW(InternetFindNextFile)
BOOLAPI InternetQueryOptionA(HINTERNET hInternet ,DWORD ,LPVOID lpBuffer ,LPDWORD);
BOOLAPI InternetQueryOptionW(HINTERNET hInternet ,DWORD ,LPVOID lpBuffer ,LPDWORD);
BOOLAPI InternetQueryOptionA(HINTERNET ,DWORD ,LPVOID ,LPDWORD);
BOOLAPI InternetQueryOptionW(HINTERNET ,DWORD ,LPVOID ,LPDWORD);
#define InternetQueryOption WINELIB_NAME_AW(InternetQueryOption)
BOOLAPI InternetSetOptionA(HINTERNET hInternet ,DWORD ,LPVOID ,DWORD);
BOOLAPI InternetSetOptionW(HINTERNET hInternet ,DWORD ,LPVOID ,DWORD);
BOOLAPI InternetSetOptionA(HINTERNET ,DWORD ,LPVOID ,DWORD);
BOOLAPI InternetSetOptionW(HINTERNET ,DWORD ,LPVOID ,DWORD);
#define InternetSetOption WINELIB_NAME_AW(InternetSetOption)
BOOLAPI InternetSetOptionExA(HINTERNET hInternet ,DWORD ,LPVOID ,DWORD ,DWORD);
BOOLAPI InternetSetOptionExW(HINTERNET hInternet ,DWORD ,LPVOID ,DWORD ,DWORD);
BOOLAPI InternetSetOptionExA(HINTERNET ,DWORD ,LPVOID ,DWORD ,DWORD);
BOOLAPI InternetSetOptionExW(HINTERNET ,DWORD ,LPVOID ,DWORD ,DWORD);
#define InternetSetOptionEx WINELIB_NAME_AW(InternetSetOptionEx)
BOOLAPI InternetLockRequestFile(HINTERNET ,HANDLE *);
@@ -494,7 +558,6 @@ BOOLAPI InternetUnlockRequestFile(HANDLE);
#define INTERNET_OPTION_CLIENT_CERT_CONTEXT 84
#define INTERNET_OPTION_AUTH_FLAGS 85
#define INTERNET_OPTION_COOKIES_3RD_PARTY 86
#define INTERNET_OPTION_COOKIES_3RD_PARTY 86
#define INTERNET_OPTION_DISABLE_PASSPORT_AUTH 87
#define INTERNET_OPTION_SEND_UTF8_SERVERNAME_TO_PROXY 88
#define INTERNET_OPTION_EXEMPT_CONNECTION_LIMIT 89
@@ -554,12 +617,12 @@ BOOLAPI InternetUnlockRequestFile(HANDLE);
BOOLAPI InternetGetLastResponseInfoA(LPDWORD ,LPSTR lpszBuffer ,LPDWORD);
BOOLAPI InternetGetLastResponseInfoW(LPDWORD ,LPWSTR lpszBuffer ,LPDWORD);
BOOLAPI InternetGetLastResponseInfoA(LPDWORD ,LPSTR ,LPDWORD);
BOOLAPI InternetGetLastResponseInfoW(LPDWORD ,LPWSTR ,LPDWORD);
#define InternetGetLastResponseInfo WINELIB_NAME_AW(InternetGetLastResponseInfo)
typedef VOID (CALLBACK *INTERNET_STATUS_CALLBACK)(HINTERNET ,DWORD ,DWORD ,
LPVOID lpvStatusInformation ,DWORD);
typedef VOID (CALLBACK *INTERNET_STATUS_CALLBACK)(HINTERNET ,DWORD_PTR ,DWORD ,
LPVOID ,DWORD);
typedef INTERNET_STATUS_CALLBACK * LPINTERNET_STATUS_CALLBACK;
@@ -610,18 +673,20 @@ BOOLAPI FtpCommandA(HINTERNET, BOOL, DWORD, LPCSTR, DWORD_PTR, HINTERNET *);
BOOLAPI FtpCommandW(HINTERNET, BOOL, DWORD, LPCWSTR, DWORD_PTR, HINTERNET *);
#define FtpCommand WINELIB_NAME_AW(FtpCommand)
INTERNETAPI HINTERNET WINAPI FtpFindFirstFileA(HINTERNET ,LPCSTR lpszSearchFile ,
LPWIN32_FIND_DATAA lpFindFileData ,DWORD ,DWORD);
INTERNETAPI HINTERNET WINAPI FtpFindFirstFileW(HINTERNET ,LPCWSTR lpszSearchFile ,
LPWIN32_FIND_DATAW lpFindFileData ,DWORD ,DWORD);
INTERNETAPI HINTERNET WINAPI FtpFindFirstFileA(HINTERNET ,LPCSTR ,
LPWIN32_FIND_DATAA ,DWORD ,DWORD_PTR);
INTERNETAPI HINTERNET WINAPI FtpFindFirstFileW(HINTERNET ,LPCWSTR ,
LPWIN32_FIND_DATAW ,DWORD ,DWORD_PTR);
#define FtpFindFirstFile WINELIB_NAME_AW(FtpFindFirstFile)
BOOLAPI FtpGetFileA(HINTERNET ,LPCSTR ,LPCSTR ,BOOL ,DWORD ,DWORD ,DWORD);
BOOLAPI FtpGetFileW(HINTERNET ,LPCWSTR ,LPCWSTR ,BOOL ,DWORD ,DWORD ,DWORD);
BOOLAPI FtpGetFileA(HINTERNET ,LPCSTR ,LPCSTR ,BOOL ,DWORD ,DWORD ,DWORD_PTR);
BOOLAPI FtpGetFileW(HINTERNET ,LPCWSTR ,LPCWSTR ,BOOL ,DWORD ,DWORD ,DWORD_PTR);
#define FtpGetFile WINELIB_NAME_AW(FtpGetFile)
BOOLAPI FtpPutFileA(HINTERNET ,LPCSTR ,LPCSTR ,DWORD ,DWORD);
BOOLAPI FtpPutFileW(HINTERNET ,LPCWSTR ,LPCWSTR ,DWORD ,DWORD);
DWORD WINAPI FtpGetFileSize(HINTERNET, LPDWORD);
BOOLAPI FtpPutFileA(HINTERNET ,LPCSTR ,LPCSTR ,DWORD ,DWORD_PTR);
BOOLAPI FtpPutFileW(HINTERNET ,LPCWSTR ,LPCWSTR ,DWORD ,DWORD_PTR);
#define FtpPutFile WINELIB_NAME_AW(FtpPutFile)
BOOLAPI FtpDeleteFileA(HINTERNET ,LPCSTR);
@@ -632,8 +697,8 @@ BOOLAPI FtpRenameFileA(HINTERNET ,LPCSTR ,LPCSTR);
BOOLAPI FtpRenameFileW(HINTERNET ,LPCWSTR ,LPCWSTR);
#define FtpRenameFile WINELIB_NAME_AW(FtpRenameFile)
INTERNETAPI HINTERNET WINAPI FtpOpenFileA(HINTERNET ,LPCSTR ,DWORD ,DWORD ,DWORD);
INTERNETAPI HINTERNET WINAPI FtpOpenFileW(HINTERNET ,LPCWSTR ,DWORD ,DWORD ,DWORD);
INTERNETAPI HINTERNET WINAPI FtpOpenFileA(HINTERNET ,LPCSTR ,DWORD ,DWORD ,DWORD_PTR);
INTERNETAPI HINTERNET WINAPI FtpOpenFileW(HINTERNET ,LPCWSTR ,DWORD ,DWORD ,DWORD_PTR);
#define FtpOpenFile WINELIB_NAME_AW(FtpOpenFile)
BOOLAPI FtpCreateDirectoryA(HINTERNET ,LPCSTR);
@@ -1002,24 +1067,24 @@ DECL_WINELIB_TYPE_AW(LPGOPHER_ATTRIBUTE_TYPE)
#define GOPHER_ATTRIBUTE_ID_TREEWALK (GOPHER_ATTRIBUTE_ID_BASE + 24)
#define GOPHER_ATTRIBUTE_ID_UNKNOWN (GOPHER_ATTRIBUTE_ID_BASE + 25)
BOOLAPI GopherCreateLocatorA(LPCSTR ,INTERNET_PORT ,LPCSTR lpszDisplayString ,
LPCSTR lpszSelectorString ,DWORD ,LPSTR lpszLocator ,LPDWORD);
BOOLAPI GopherCreateLocatorW(LPCWSTR ,INTERNET_PORT ,LPCWSTR lpszDisplayString ,
LPCWSTR lpszSelectorString ,DWORD ,LPWSTR lpszLocator ,LPDWORD);
BOOLAPI GopherCreateLocatorA(LPCSTR ,INTERNET_PORT ,LPCSTR ,
LPCSTR ,DWORD ,LPSTR ,LPDWORD);
BOOLAPI GopherCreateLocatorW(LPCWSTR ,INTERNET_PORT ,LPCWSTR ,
LPCWSTR ,DWORD ,LPWSTR ,LPDWORD);
#define GopherCreateLocator WINELIB_NAME_AW(GopherCreateLocator)
BOOLAPI GopherGetLocatorTypeA(LPCSTR ,LPDWORD);
BOOLAPI GopherGetLocatorTypeW(LPCWSTR ,LPDWORD);
#define GopherGetLocatorType WINELIB_NAME_AW(GopherGetLocatorType)
INTERNETAPI HINTERNET WINAPI GopherFindFirstFileA(HINTERNET ,LPCSTR lpszLocator ,
LPCSTR lpszSearchString ,LPGOPHER_FIND_DATAA lpFindData ,DWORD ,DWORD);
INTERNETAPI HINTERNET WINAPI GopherFindFirstFileW(HINTERNET ,LPCWSTR lpszLocator ,
LPCWSTR lpszSearchString ,LPGOPHER_FIND_DATAW lpFindData ,DWORD ,DWORD);
INTERNETAPI HINTERNET WINAPI GopherFindFirstFileA(HINTERNET ,LPCSTR ,
LPCSTR ,LPGOPHER_FIND_DATAA ,DWORD ,DWORD_PTR);
INTERNETAPI HINTERNET WINAPI GopherFindFirstFileW(HINTERNET ,LPCWSTR ,
LPCWSTR ,LPGOPHER_FIND_DATAW ,DWORD ,DWORD_PTR);
#define GopherFindFirstFile WINELIB_NAME_AW(GopherFindFirstFile)
INTERNETAPI HINTERNET WINAPI GopherOpenFileA(HINTERNET ,LPCSTR ,LPCSTR lpszView ,DWORD ,DWORD);
INTERNETAPI HINTERNET WINAPI GopherOpenFileW(HINTERNET ,LPCWSTR ,LPCWSTR lpszView ,DWORD ,DWORD);
INTERNETAPI HINTERNET WINAPI GopherOpenFileA(HINTERNET ,LPCSTR ,LPCSTR ,DWORD ,DWORD_PTR);
INTERNETAPI HINTERNET WINAPI GopherOpenFileW(HINTERNET ,LPCWSTR ,LPCWSTR ,DWORD ,DWORD_PTR);
#define GopherOpenFile WINELIB_NAME_AW(GopherOpenFile)
typedef BOOL (CALLBACK *GOPHER_ATTRIBUTE_ENUMERATORA)(LPGOPHER_ATTRIBUTE_TYPEA ,DWORD);
@@ -1027,10 +1092,10 @@ typedef BOOL (CALLBACK *GOPHER_ATTRIBUTE_ENUMERATORW)(LPGOPHER_ATTRIBUTE_TYPEW ,
DECL_WINELIB_TYPE_AW(GOPHER_ATTRIBUTE_ENUMERATOR)
BOOLAPI GopherGetAttributeA(HINTERNET ,LPCSTR ,LPCSTR lpszAttributeName ,LPBYTE ,
DWORD ,LPDWORD ,GOPHER_ATTRIBUTE_ENUMERATORA lpfnEnumerator ,DWORD);
BOOLAPI GopherGetAttributeW(HINTERNET ,LPCWSTR ,LPCWSTR lpszAttributeName ,LPBYTE ,
DWORD ,LPDWORD ,GOPHER_ATTRIBUTE_ENUMERATORW lpfnEnumerator ,DWORD);
BOOLAPI GopherGetAttributeA(HINTERNET ,LPCSTR ,LPCSTR ,LPBYTE ,
DWORD ,LPDWORD ,GOPHER_ATTRIBUTE_ENUMERATORA ,DWORD_PTR);
BOOLAPI GopherGetAttributeW(HINTERNET ,LPCWSTR ,LPCWSTR ,LPBYTE ,
DWORD ,LPDWORD ,GOPHER_ATTRIBUTE_ENUMERATORW ,DWORD_PTR);
#define GopherGetAttribute WINELIB_NAME_AW(GopherGetAttribute)
#define HTTP_MAJOR_VERSION 1
@@ -1171,9 +1236,9 @@ BOOLAPI GopherGetAttributeW(HINTERNET ,LPCWSTR ,LPCWSTR lpszAttributeName ,LPBYT
INTERNETAPI HINTERNET WINAPI HttpOpenRequestA(HINTERNET ,LPCSTR ,LPCSTR ,LPCSTR ,
LPCSTR lpszReferrer ,LPCSTR * ,DWORD ,DWORD);
LPCSTR ,LPCSTR * ,DWORD ,DWORD_PTR);
INTERNETAPI HINTERNET WINAPI HttpOpenRequestW(HINTERNET ,LPCWSTR ,LPCWSTR ,LPCWSTR ,
LPCWSTR lpszReferrer ,LPCWSTR * ,DWORD ,DWORD);
LPCWSTR ,LPCWSTR * ,DWORD ,DWORD_PTR);
#define HttpOpenRequest WINELIB_NAME_AW(HttpOpenRequest)
BOOLAPI HttpAddRequestHeadersA(HINTERNET ,LPCSTR ,DWORD ,DWORD);
@@ -1189,14 +1254,14 @@ BOOLAPI HttpAddRequestHeadersW(HINTERNET ,LPCWSTR ,DWORD ,DWORD);
#define HTTP_ADDREQ_FLAG_COALESCE HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA
#define HTTP_ADDREQ_FLAG_REPLACE 0x80000000
BOOLAPI HttpSendRequestA(HINTERNET ,LPCSTR lpszHeaders ,DWORD ,LPVOID lpOptional ,DWORD);
BOOLAPI HttpSendRequestW(HINTERNET ,LPCWSTR lpszHeaders ,DWORD ,LPVOID lpOptional ,DWORD);
BOOLAPI HttpSendRequestA(HINTERNET ,LPCSTR ,DWORD ,LPVOID ,DWORD);
BOOLAPI HttpSendRequestW(HINTERNET ,LPCWSTR ,DWORD ,LPVOID ,DWORD);
#define HttpSendRequest WINELIB_NAME_AW(HttpSendRequest)
INTERNETAPI BOOL WINAPI HttpSendRequestExA(HINTERNET ,LPINTERNET_BUFFERSA lpBuffersIn ,
LPINTERNET_BUFFERSA lpBuffersOut ,DWORD ,DWORD);
INTERNETAPI BOOL WINAPI HttpSendRequestExW(HINTERNET ,LPINTERNET_BUFFERSW lpBuffersIn ,
LPINTERNET_BUFFERSW lpBuffersOut ,DWORD ,DWORD);
INTERNETAPI BOOL WINAPI HttpSendRequestExA(HINTERNET ,LPINTERNET_BUFFERSA ,
LPINTERNET_BUFFERSA ,DWORD ,DWORD_PTR);
INTERNETAPI BOOL WINAPI HttpSendRequestExW(HINTERNET ,LPINTERNET_BUFFERSW ,
LPINTERNET_BUFFERSW ,DWORD ,DWORD_PTR);
#define HttpSendRequestEx WINELIB_NAME_AW(HttpSendRequestEx)
#define HSR_ASYNC WININET_API_FLAG_ASYNC
@@ -1206,12 +1271,12 @@ INTERNETAPI BOOL WINAPI HttpSendRequestExW(HINTERNET ,LPINTERNET_BUFFERSW lpBuff
#define HSR_DOWNLOAD 0x00000010
#define HSR_CHUNKED 0x00000020
INTERNETAPI BOOL WINAPI HttpEndRequestA(HINTERNET ,LPINTERNET_BUFFERSA lpBuffersOut ,DWORD ,DWORD);
INTERNETAPI BOOL WINAPI HttpEndRequestW(HINTERNET ,LPINTERNET_BUFFERSW lpBuffersOut ,DWORD ,DWORD);
INTERNETAPI BOOL WINAPI HttpEndRequestA(HINTERNET ,LPINTERNET_BUFFERSA ,DWORD ,DWORD_PTR);
INTERNETAPI BOOL WINAPI HttpEndRequestW(HINTERNET ,LPINTERNET_BUFFERSW ,DWORD ,DWORD_PTR);
#define HttpEndRequest WINELIB_NAME_AW(HttpEndRequest)
BOOLAPI HttpQueryInfoA(HINTERNET ,DWORD ,LPVOID lpBuffer ,LPDWORD ,LPDWORD lpdwIndex);
BOOLAPI HttpQueryInfoW(HINTERNET ,DWORD ,LPVOID lpBuffer ,LPDWORD ,LPDWORD lpdwIndex);
BOOLAPI HttpQueryInfoA(HINTERNET ,DWORD ,LPVOID ,LPDWORD ,LPDWORD);
BOOLAPI HttpQueryInfoW(HINTERNET ,DWORD ,LPVOID ,LPDWORD ,LPDWORD);
#define HttpQueryInfo WINELIB_NAME_AW(HttpQueryInfo)
BOOLAPI InternetClearAllPerSiteCookieDecisions(VOID);
@@ -1220,6 +1285,17 @@ BOOLAPI InternetEnumPerSiteCookieDecisionA(LPSTR,unsigned long *,unsigned long *
BOOLAPI InternetEnumPerSiteCookieDecisionW(LPWSTR,unsigned long *,unsigned long *,unsigned long);
#define InternetEnumPerSiteCookieDecision WINELIB_NAME_AW(InternetEnumPerSiteCookieDecision)
#define INTERNET_COOKIE_IS_SECURE 0x00000001
#define INTERNET_COOKIE_IS_SESSION 0x00000002
#define INTERNET_COOKIE_THIRD_PARTY 0x00000010
#define INTERNET_COOKIE_PROMPT_REQUIRED 0x00000020
#define INTERNET_COOKIE_EVALUATE_P3P 0x00000040
#define INTERNET_COOKIE_APPLY_P3P 0x00000080
#define INTERNET_COOKIE_P3P_ENABLED 0x00000100
#define INTERNET_COOKIE_IS_RESTRICTED 0x00000200
#define INTERNET_COOKIE_IE6 0x00000400
#define INTERNET_COOKIE_IS_LEGACY 0x00000800
BOOLAPI InternetGetCookieExA(LPCSTR,LPCSTR,LPSTR,LPDWORD,DWORD,LPVOID);
BOOLAPI InternetGetCookieExW(LPCWSTR,LPCWSTR,LPWSTR,LPDWORD,DWORD,LPVOID);
#define InternetGetCookieEx WINELIB_NAME_AW(InternetGetCookieEx)
@@ -1257,15 +1333,15 @@ BOOLAPI InternetCheckConnectionW(LPCWSTR ,DWORD ,DWORD);
#define FLAGS_ERROR_UI_FLAGS_NO_UI 0x08
#define FLAGS_ERROR_UI_SERIALIZE_DIALOGS 0x10
DWORD InternetAuthNotifyCallback ( DWORD ,DWORD ,LPVOID );
typedef DWORD (CALLBACK *PFN_AUTH_NOTIFY) (DWORD,DWORD,LPVOID);
DWORD InternetAuthNotifyCallback ( DWORD_PTR ,DWORD ,LPVOID );
typedef DWORD (CALLBACK *PFN_AUTH_NOTIFY) (DWORD_PTR,DWORD,LPVOID);
typedef struct
{
DWORD cbStruct;
DWORD dwOptions;
PFN_AUTH_NOTIFY pfnNotify;
DWORD dwContext;
DWORD_PTR dwContext;
}
INTERNET_AUTH_NOTIFY_DATA;
@@ -1328,6 +1404,9 @@ INTERNETAPI DWORD WINAPI InternetConfirmZoneCrossingW(HWND ,LPWSTR ,LPWSTR ,BOOL
#define ERROR_INTERNET_RETRY_DIALOG (INTERNET_ERROR_BASE + 50)
#define ERROR_INTERNET_HTTPS_HTTP_SUBMIT_REDIR (INTERNET_ERROR_BASE + 52)
#define ERROR_INTERNET_INSERT_CDROM (INTERNET_ERROR_BASE + 53)
#define ERROR_INTERNET_SEC_CERT_ERRORS (INTERNET_ERROR_BASE + 55)
#define ERROR_INTERNET_SEC_CERT_NO_REV (INTERNET_ERROR_BASE + 56)
#define ERROR_INTERNET_SEC_CERT_REV_FAILED (INTERNET_ERROR_BASE + 57)
#define ERROR_FTP_TRANSFER_IN_PROGRESS (INTERNET_ERROR_BASE + 110)
#define ERROR_FTP_DROPPED (INTERNET_ERROR_BASE + 111)
#define ERROR_FTP_NO_PASSIVE_MODE (INTERNET_ERROR_BASE + 112)
@@ -1362,16 +1441,17 @@ INTERNETAPI DWORD WINAPI InternetConfirmZoneCrossingW(HWND ,LPWSTR ,LPWSTR ,BOOL
#define ERROR_INTERNET_SEC_INVALID_CERT (INTERNET_ERROR_BASE + 169)
#define ERROR_INTERNET_SEC_CERT_REVOKED (INTERNET_ERROR_BASE + 170)
#define ERROR_INTERNET_FAILED_DUETOSECURITYCHECK (INTERNET_ERROR_BASE + 171)
#define ERROR_INTERNET_NOT_INITIALIZED (INTERNET_ERROR_BASE + 172)
#define ERROR_INTERNET_NOT_INITIALIZED (INTERNET_ERROR_BASE + 172)
#define INTERNET_ERROR_LAST ERROR_INTERNET_NOT_INITIALIZED
#define NORMAL_CACHE_ENTRY 0x00000001
#define STICKY_CACHE_ENTRY 0x00000004
#define EDITED_CACHE_ENTRY 0x00000008
#define COOKIE_CACHE_ENTRY 0x00100000
#define URLHISTORY_CACHE_ENTRY 0x00200000
#define TRACK_OFFLINE_CACHE_ENTRY 0x00000010
#define TRACK_ONLINE_CACHE_ENTRY 0x00000020
#define STICKY_CACHE_ENTRY 0x00000004
#define SPARSE_CACHE_ENTRY 0x00010000
#define URLCACHE_FIND_DEFAULT_FILTER NORMAL_CACHE_ENTRY \
@@ -1528,14 +1608,14 @@ BOOLAPI DeleteUrlCacheEntryA(LPCSTR);
BOOLAPI DeleteUrlCacheEntryW(LPCWSTR);
#define DeleteUrlCacheEntry WINELIB_NAME_AW(DeleteUrlCacheEntry)
INTERNETAPI DWORD WINAPI InternetDialA(HWND ,LPSTR ,DWORD ,LPDWORD ,DWORD);
INTERNETAPI DWORD WINAPI InternetDialW(HWND ,LPWSTR ,DWORD ,LPDWORD ,DWORD);
INTERNETAPI DWORD WINAPI InternetDialA(HWND ,LPSTR ,DWORD ,DWORD_PTR* ,DWORD);
INTERNETAPI DWORD WINAPI InternetDialW(HWND ,LPWSTR ,DWORD ,DWORD_PTR* ,DWORD);
#define InternetDial WINELIB_NAME_AW(InternetDial)
#define INTERNET_DIAL_UNATTENDED 0x8000
INTERNETAPI DWORD WINAPI InternetHangUp(DWORD ,DWORD);
INTERNETAPI DWORD WINAPI InternetHangUp(DWORD_PTR ,DWORD);
BOOLAPI CreateMD5SSOHash(PWSTR,PWSTR,PWSTR,PBYTE);
#define INTERENT_GOONLINE_REFRESH 0x00000001
@@ -1573,9 +1653,12 @@ INTERNETAPI BOOL WINAPI InternetSetDialStateW(LPCWSTR ,DWORD ,DWORD);
#define InternetSetDialState WINELIB_NAME_AW(InternetSetDialState)
#define INTERNET_DIALSTATE_DISCONNECTED 1
BOOLAPI InternetCheckConnectionA(LPCSTR lpszUrl,DWORD dwFlags,DWORD dwReserved);
BOOLAPI InternetCheckConnectionW(LPCWSTR lpszUrl,DWORD dwFlags,DWORD dwReserved);
#define InternetCheckConnection WINELIB_NAME_AW(InternetCheckConnection)
BOOL WINAPI InternetGetConnectedStateExA(LPDWORD, LPSTR, DWORD, DWORD);
BOOL WINAPI InternetGetConnectedStateExW(LPDWORD, LPWSTR, DWORD, DWORD);
#define InternetGetConnectedStateEx WINELIB_NAME_AW(InternetGetConnectedStateEx)
BOOL WINAPI InternetInitializeAutoProxyDll(DWORD);
BOOL WINAPI DetectAutoProxyUrl(LPSTR, DWORD, DWORD);
#ifdef __cplusplus
}