- Implementation of [Internet|Ftp]*W functions to extend (almost)
non-existant wide-character support. - Moved some functions from "stub in wininet.spec" to "FIXME("STUB")" to allow for testing of changes.
This commit is contained in:
parent
c36d63f436
commit
aeef9b4f71
@ -7,6 +7,7 @@
|
|||||||
* Noureddine Jemmali
|
* Noureddine Jemmali
|
||||||
*
|
*
|
||||||
* Copyright 2000 Andreas Mohr
|
* Copyright 2000 Andreas Mohr
|
||||||
|
* Copyright 2002 Jaco Greeff
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
@ -43,6 +44,7 @@
|
|||||||
#include "wingdi.h"
|
#include "wingdi.h"
|
||||||
#include "winuser.h"
|
#include "winuser.h"
|
||||||
#include "wininet.h"
|
#include "wininet.h"
|
||||||
|
#include "winnls.h"
|
||||||
#include "winerror.h"
|
#include "winerror.h"
|
||||||
|
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
@ -301,6 +303,33 @@ BOOL WINAPI FtpSetCurrentDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* FtpSetCurrentDirectoryW (WININET.@)
|
||||||
|
*
|
||||||
|
* Change the working directory on the FTP server
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* TRUE on success
|
||||||
|
* FALSE on failure
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
BOOL WINAPI FtpSetCurrentDirectoryW(HINTERNET hConnect, LPCWSTR lpszDirectory)
|
||||||
|
{
|
||||||
|
CHAR *szDir;
|
||||||
|
INT len;
|
||||||
|
BOOL rc;
|
||||||
|
|
||||||
|
len = lstrlenW(lpszDirectory)+1;
|
||||||
|
if (!(szDir = (CHAR *)malloc(len*sizeof(CHAR))))
|
||||||
|
return FALSE;
|
||||||
|
WideCharToMultiByte(CP_ACP, -1, lpszDirectory, -1, szDir, len, NULL, NULL);
|
||||||
|
rc = FtpSetCurrentDirectoryA(hConnect, szDir);
|
||||||
|
free(szDir);
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* FTP_FtpSetCurrentDirectoryA (Internal)
|
* FTP_FtpSetCurrentDirectoryA (Internal)
|
||||||
*
|
*
|
||||||
@ -398,6 +427,33 @@ BOOL WINAPI FtpCreateDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* FtpCreateDirectoryW (WININET.@)
|
||||||
|
*
|
||||||
|
* Create new directory on the FTP server
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* TRUE on success
|
||||||
|
* FALSE on failure
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
BOOL WINAPI FtpCreateDirectoryW(HINTERNET hConnect, LPCWSTR lpszDirectory)
|
||||||
|
{
|
||||||
|
CHAR *szDir;
|
||||||
|
INT len;
|
||||||
|
BOOL rc;
|
||||||
|
|
||||||
|
len = lstrlenW(lpszDirectory)+1;
|
||||||
|
if (!(szDir = (CHAR *)malloc(len*sizeof(CHAR))))
|
||||||
|
return FALSE;
|
||||||
|
WideCharToMultiByte(CP_ACP, -1, lpszDirectory, -1, szDir, len, NULL, NULL);
|
||||||
|
rc = FtpCreateDirectoryA(hConnect, szDir);
|
||||||
|
free(szDir);
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* FTP_FtpCreateDirectoryA (Internal)
|
* FTP_FtpCreateDirectoryA (Internal)
|
||||||
*
|
*
|
||||||
@ -499,6 +555,24 @@ HINTERNET WINAPI FtpFindFirstFileA(HINTERNET hConnect,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* FtpFindFirstFileA (WININET.@)
|
||||||
|
*
|
||||||
|
* Search the specified directory
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* HINTERNET on success
|
||||||
|
* NULL on failure
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
HINTERNET WINAPI FtpFindFirstFileW(HINTERNET hConnect,
|
||||||
|
LPCWSTR lpszSearchFile, LPWIN32_FIND_DATAW lpFindFileData, DWORD dwFlags, DWORD dwContext)
|
||||||
|
{
|
||||||
|
FIXME("STUB\n");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* FTP_FtpFindFirstFileA (Internal)
|
* FTP_FtpFindFirstFileA (Internal)
|
||||||
*
|
*
|
||||||
@ -637,6 +711,24 @@ BOOL WINAPI FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrentDire
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* FtpGetCurrentDirectoryW (WININET.@)
|
||||||
|
*
|
||||||
|
* Retrieves the current directory
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* TRUE on success
|
||||||
|
* FALSE on failure
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
BOOL WINAPI FtpGetCurrentDirectoryW(HINTERNET hFtpSession, LPWSTR lpszCurrentDirectory,
|
||||||
|
LPDWORD lpdwCurrentDirectory)
|
||||||
|
{
|
||||||
|
FIXME("STUB\n");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* FTP_FtpGetCurrentDirectoryA (Internal)
|
* FTP_FtpGetCurrentDirectoryA (Internal)
|
||||||
*
|
*
|
||||||
@ -762,6 +854,25 @@ HINTERNET WINAPI FtpOpenFileA(HINTERNET hFtpSession,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* FtpOpenFileW (WININET.@)
|
||||||
|
*
|
||||||
|
* Open a remote file for writing or reading
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* HINTERNET handle on success
|
||||||
|
* NULL on failure
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
HINTERNET WINAPI FtpOpenFileW(HINTERNET hFtpSession,
|
||||||
|
LPCWSTR lpszFileName, DWORD fdwAccess, DWORD dwFlags,
|
||||||
|
DWORD dwContext)
|
||||||
|
{
|
||||||
|
FIXME("STUB\n");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* FTP_FtpOpenFileA (Internal)
|
* FTP_FtpOpenFileA (Internal)
|
||||||
*
|
*
|
||||||
@ -888,6 +999,25 @@ BOOL WINAPI FtpGetFileA(HINTERNET hInternet, LPCSTR lpszRemoteFile, LPCSTR lpszN
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* FtpGetFileW (WININET.@)
|
||||||
|
*
|
||||||
|
* Retrieve file from the FTP server
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* TRUE on success
|
||||||
|
* FALSE on failure
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
BOOL WINAPI FtpGetFileW(HINTERNET hInternet, LPCWSTR lpszRemoteFile, LPCWSTR lpszNewFile,
|
||||||
|
BOOL fFailIfExists, DWORD dwLocalFlagsAttribute, DWORD dwInternetFlags,
|
||||||
|
DWORD dwContext)
|
||||||
|
{
|
||||||
|
FIXME("STUB\n");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* FTP_FtpGetFileA (Internal)
|
* FTP_FtpGetFileA (Internal)
|
||||||
*
|
*
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
* Ulrich Czekalla
|
* Ulrich Czekalla
|
||||||
* Aric Stewart
|
* Aric Stewart
|
||||||
*
|
*
|
||||||
|
* Copyright 2002 Jaco Greeff
|
||||||
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
* License as published by the Free Software Foundation; either
|
* License as published by the Free Software Foundation; either
|
||||||
@ -45,6 +47,7 @@
|
|||||||
#include "winbase.h"
|
#include "winbase.h"
|
||||||
#include "winreg.h"
|
#include "winreg.h"
|
||||||
#include "wininet.h"
|
#include "wininet.h"
|
||||||
|
#include "winnls.h"
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
#include "winerror.h"
|
#include "winerror.h"
|
||||||
#define NO_SHLWAPI_STREAM
|
#define NO_SHLWAPI_STREAM
|
||||||
@ -165,6 +168,26 @@ WININET_LibMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* InternetInitializeAutoProxyDll (WININET.@)
|
||||||
|
*
|
||||||
|
* Setup the internal proxy
|
||||||
|
*
|
||||||
|
* PARAMETERS
|
||||||
|
* dwReserved
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* FALSE on failure
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
BOOL InternetInitializeAutoProxyDll(DWORD dwReserved)
|
||||||
|
{
|
||||||
|
FIXME("STUB\n");
|
||||||
|
INTERNET_SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* InternetOpenA (WININET.@)
|
* InternetOpenA (WININET.@)
|
||||||
*
|
*
|
||||||
@ -175,9 +198,8 @@ WININET_LibMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|||||||
* NULL on failure
|
* NULL on failure
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
HINTERNET WINAPI InternetOpenA(LPCSTR lpszAgent,
|
HINTERNET WINAPI InternetOpenA(LPCSTR lpszAgent, DWORD dwAccessType,
|
||||||
DWORD dwAccessType, LPCSTR lpszProxy,
|
LPCSTR lpszProxy, LPCSTR lpszProxyBypass, DWORD dwFlags)
|
||||||
LPCSTR lpszProxyBypass, DWORD dwFlags)
|
|
||||||
{
|
{
|
||||||
LPWININETAPPINFOA lpwai = NULL;
|
LPWININETAPPINFOA lpwai = NULL;
|
||||||
|
|
||||||
@ -217,6 +239,54 @@ HINTERNET WINAPI InternetOpenA(LPCSTR lpszAgent,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* InternetOpenW (WININET.@)
|
||||||
|
*
|
||||||
|
* Per-application initialization of wininet
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* HINTERNET on success
|
||||||
|
* NULL on failure
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
HINTERNET WINAPI InternetOpenW(LPCWSTR lpszAgent, DWORD dwAccessType,
|
||||||
|
LPCWSTR lpszProxy, LPCWSTR lpszProxyBypass, DWORD dwFlags)
|
||||||
|
{
|
||||||
|
HINTERNET rc = (HINTERNET)NULL;
|
||||||
|
INT lenAgent = lstrlenW(lpszAgent)+1;
|
||||||
|
INT lenProxy = lstrlenW(lpszProxy)+1;
|
||||||
|
INT lenBypass = lstrlenW(lpszProxyBypass)+1;
|
||||||
|
CHAR *szAgent = (CHAR *)malloc(lenAgent*sizeof(CHAR));
|
||||||
|
CHAR *szProxy = (CHAR *)malloc(lenProxy*sizeof(CHAR));
|
||||||
|
CHAR *szBypass = (CHAR *)malloc(lenBypass*sizeof(CHAR));
|
||||||
|
|
||||||
|
if (!szAgent || !szProxy || !szBypass)
|
||||||
|
{
|
||||||
|
if (szAgent)
|
||||||
|
free(szAgent);
|
||||||
|
if (szProxy)
|
||||||
|
free(szProxy);
|
||||||
|
if (szBypass)
|
||||||
|
free(szBypass);
|
||||||
|
return (HINTERNET)NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
WideCharToMultiByte(CP_ACP, -1, lpszAgent, -1, szAgent, lenAgent,
|
||||||
|
NULL, NULL);
|
||||||
|
WideCharToMultiByte(CP_ACP, -1, lpszProxy, -1, szProxy, lenProxy,
|
||||||
|
NULL, NULL);
|
||||||
|
WideCharToMultiByte(CP_ACP, -1, lpszProxyBypass, -1, szBypass, lenBypass,
|
||||||
|
NULL, NULL);
|
||||||
|
|
||||||
|
rc = InternetOpenA(szAgent, dwAccessType, szProxy, szBypass, dwFlags);
|
||||||
|
|
||||||
|
free(szAgent);
|
||||||
|
free(szProxy);
|
||||||
|
free(szBypass);
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* InternetGetLastResponseInfoA (WININET.@)
|
* InternetGetLastResponseInfoA (WININET.@)
|
||||||
*
|
*
|
||||||
@ -310,6 +380,58 @@ HINTERNET WINAPI InternetConnectA(HINTERNET hInternet,
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* InternetConnectW (WININET.@)
|
||||||
|
*
|
||||||
|
* Open a ftp, gopher or http session
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* HINTERNET a session handle on success
|
||||||
|
* NULL on failure
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
HINTERNET WINAPI InternetConnectW(HINTERNET hInternet,
|
||||||
|
LPCWSTR lpszServerName, INTERNET_PORT nServerPort,
|
||||||
|
LPCWSTR lpszUserName, LPCWSTR lpszPassword,
|
||||||
|
DWORD dwService, DWORD dwFlags, DWORD dwContext)
|
||||||
|
{
|
||||||
|
HINTERNET rc = (HINTERNET)NULL;
|
||||||
|
INT lenServer = lstrlenW(lpszServerName)+1;
|
||||||
|
INT lenUser = lstrlenW(lpszUserName)+1;
|
||||||
|
INT lenPass = lstrlenW(lpszPassword)+1;
|
||||||
|
CHAR *szServerName = (CHAR *)malloc(lenServer*sizeof(CHAR));
|
||||||
|
CHAR *szUserName = (CHAR *)malloc(lenUser*sizeof(CHAR));
|
||||||
|
CHAR *szPassword = (CHAR *)malloc(lenPass*sizeof(CHAR));
|
||||||
|
|
||||||
|
if (!szServerName || !szUserName || !szPassword)
|
||||||
|
{
|
||||||
|
if (szServerName)
|
||||||
|
free(szServerName);
|
||||||
|
if (szUserName)
|
||||||
|
free(szUserName);
|
||||||
|
if (szPassword)
|
||||||
|
free(szPassword);
|
||||||
|
return (HINTERNET)NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
WideCharToMultiByte(CP_ACP, -1, lpszServerName, -1, szServerName, lenServer,
|
||||||
|
NULL, NULL);
|
||||||
|
WideCharToMultiByte(CP_ACP, -1, lpszUserName, -1, szUserName, lenUser,
|
||||||
|
NULL, NULL);
|
||||||
|
WideCharToMultiByte(CP_ACP, -1, lpszPassword, -1, szPassword, lenPass,
|
||||||
|
NULL, NULL);
|
||||||
|
|
||||||
|
rc = InternetConnectA(hInternet, szServerName, nServerPort,
|
||||||
|
szUserName, szPassword, dwService, dwFlags, dwContext);
|
||||||
|
|
||||||
|
free(szServerName);
|
||||||
|
free(szUserName);
|
||||||
|
free(szPassword);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* InternetFindNextFileA (WININET.@)
|
* InternetFindNextFileA (WININET.@)
|
||||||
*
|
*
|
||||||
@ -524,7 +646,8 @@ BOOL WINAPI InternetCloseHandle(HINTERNET hInternet)
|
|||||||
* FALSE on failure
|
* FALSE on failure
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
BOOL SetUrlComponentValue(LPSTR* lppszComponent, LPDWORD dwComponentLen, LPCSTR lpszStart, INT len)
|
BOOL SetUrlComponentValue(LPSTR* lppszComponent, LPDWORD dwComponentLen,
|
||||||
|
LPCSTR lpszStart, INT len)
|
||||||
{
|
{
|
||||||
TRACE("%s (%d)\n", lpszStart, len);
|
TRACE("%s (%d)\n", lpszStart, len);
|
||||||
|
|
||||||
@ -821,6 +944,34 @@ BOOL WINAPI InternetCanonicalizeUrlA(LPCSTR lpszUrl, LPSTR lpszBuffer,
|
|||||||
return (hr == S_OK) ? TRUE : FALSE;
|
return (hr == S_OK) ? TRUE : FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* InternetCanonicalizeUrlW (WININET.@)
|
||||||
|
*
|
||||||
|
* Escape unsafe characters and spaces
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* TRUE on success
|
||||||
|
* FALSE on failure
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
BOOL WINAPI InternetCanonicalizeUrlW(LPCWSTR lpszUrl, LPWSTR lpszBuffer,
|
||||||
|
LPDWORD lpdwBufferLength, DWORD dwFlags)
|
||||||
|
{
|
||||||
|
HRESULT hr;
|
||||||
|
TRACE("%s %p %p %08lx\n", debugstr_w(lpszUrl), lpszBuffer,
|
||||||
|
lpdwBufferLength, dwFlags);
|
||||||
|
|
||||||
|
/* Flip this bit to correspond to URL_ESCAPE_UNSAFE */
|
||||||
|
dwFlags ^= ICU_NO_ENCODE;
|
||||||
|
|
||||||
|
dwFlags |= 0x80000000; /* Don't know what this means */
|
||||||
|
|
||||||
|
hr = UrlCanonicalizeW(lpszUrl, lpszBuffer, lpdwBufferLength, dwFlags);
|
||||||
|
|
||||||
|
return (hr == S_OK) ? TRUE : FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* InternetSetStatusCallback (WININET.@)
|
* InternetSetStatusCallback (WININET.@)
|
||||||
*
|
*
|
||||||
@ -1107,7 +1258,7 @@ BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption,
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
INTERNET_SetLastError(ERROR_INVALID_PARAMETER);
|
INTERNET_SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
FIXME("Stub!\n");
|
FIXME("STUB\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1148,11 +1299,33 @@ BOOL WINAPI InternetSetOptionA(HINTERNET hInternet, DWORD dwOption,
|
|||||||
BOOL WINAPI InternetGetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName,
|
BOOL WINAPI InternetGetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName,
|
||||||
LPSTR lpCookieData, LPDWORD lpdwSize)
|
LPSTR lpCookieData, LPDWORD lpdwSize)
|
||||||
{
|
{
|
||||||
FIXME("(%s,%s,%p), stub!\n",debugstr_a(lpszUrl),debugstr_a(lpszCookieName),
|
FIXME("STUB\n");
|
||||||
lpCookieData
|
TRACE("(%s,%s,%p)\n", debugstr_a(lpszUrl),debugstr_a(lpszCookieName),
|
||||||
);
|
lpCookieData);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* InternetGetCookieW (WININET.@)
|
||||||
|
*
|
||||||
|
* Retrieve cookie from the specified url
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* TRUE on success
|
||||||
|
* FALSE on failure
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
BOOL WINAPI InternetGetCookieW(LPCSTR lpszUrl, LPCWSTR lpszCookieName,
|
||||||
|
LPWSTR lpCookieData, LPDWORD lpdwSize)
|
||||||
|
{
|
||||||
|
FIXME("STUB\n");
|
||||||
|
TRACE("(%s,%s,%p)\n", debugstr_a(lpszUrl), debugstr_w(lpszCookieName),
|
||||||
|
lpCookieData);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* InternetSetCookieA (WININET.@)
|
* InternetSetCookieA (WININET.@)
|
||||||
*
|
*
|
||||||
@ -1163,13 +1336,36 @@ BOOL WINAPI InternetGetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName,
|
|||||||
* FALSE on failure
|
* FALSE on failure
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI InternetSetCookieA(
|
BOOL WINAPI InternetSetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName,
|
||||||
LPCSTR lpszUrl, LPCSTR lpszCookieName, LPCSTR lpCookieData
|
LPCSTR lpCookieData)
|
||||||
) {
|
{
|
||||||
FIXME("(%s,%s,%s), stub!\n",debugstr_a(lpszUrl),debugstr_a(lpszCookieName),debugstr_a(lpCookieData));
|
FIXME("STUB\n");
|
||||||
|
TRACE("(%s,%s,%s)\n", debugstr_a(lpszUrl),
|
||||||
|
debugstr_a(lpszCookieName), debugstr_a(lpCookieData));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* InternetSetCookieW (WININET.@)
|
||||||
|
*
|
||||||
|
* Sets cookie for the specified url
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* TRUE on success
|
||||||
|
* FALSE on failure
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
BOOL WINAPI InternetSetCookieW(LPCSTR lpszUrl, LPCWSTR lpszCookieName,
|
||||||
|
LPCWSTR lpCookieData)
|
||||||
|
{
|
||||||
|
FIXME("STUB\n");
|
||||||
|
TRACE("(%s,%s,%s)\n", debugstr_a(lpszUrl),
|
||||||
|
debugstr_w(lpszCookieName), debugstr_w(lpCookieData));
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* GetInternetScheme (internal)
|
* GetInternetScheme (internal)
|
||||||
*
|
*
|
||||||
@ -1210,9 +1406,8 @@ INTERNET_SCHEME GetInternetScheme(LPCSTR lpszScheme, INT nMaxCmp)
|
|||||||
* Pings a requested host to check internet connection
|
* Pings a requested host to check internet connection
|
||||||
*
|
*
|
||||||
* RETURNS
|
* RETURNS
|
||||||
*
|
* TRUE on success and FALSE on failure. If a failure then
|
||||||
* TRUE on success and FALSE on failure. if a failures then
|
* ERROR_NOT_CONNECTED is placesd into GetLastError
|
||||||
* ERROR_NOT_CONNECTED is places into GetLastError
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI InternetCheckConnectionA( LPCSTR lpszUrl, DWORD dwFlags, DWORD dwReserved )
|
BOOL WINAPI InternetCheckConnectionA( LPCSTR lpszUrl, DWORD dwFlags, DWORD dwReserved )
|
||||||
@ -1284,6 +1479,34 @@ End:
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* InternetCheckConnectionW (WININET.@)
|
||||||
|
*
|
||||||
|
* Pings a requested host to check internet connection
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* TRUE on success and FALSE on failure. If a failure then
|
||||||
|
* ERROR_NOT_CONNECTED is placed into GetLastError
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
BOOL WINAPI InternetCheckConnectionW(LPCWSTR lpszUrl, DWORD dwFlags, DWORD dwReserved)
|
||||||
|
{
|
||||||
|
CHAR *szUrl;
|
||||||
|
INT len;
|
||||||
|
BOOL rc;
|
||||||
|
|
||||||
|
len = lstrlenW(lpszUrl)+1;
|
||||||
|
if (!(szUrl = (CHAR *)malloc(len*sizeof(CHAR))))
|
||||||
|
return FALSE;
|
||||||
|
WideCharToMultiByte(CP_ACP, -1, lpszUrl, -1, szUrl, len, NULL, NULL);
|
||||||
|
rc = InternetCheckConnectionA((LPCSTR)szUrl, dwFlags, dwReserved);
|
||||||
|
free(szUrl);
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************
|
/**********************************************************
|
||||||
* InternetOpenUrlA (WININET.@)
|
* InternetOpenUrlA (WININET.@)
|
||||||
*
|
*
|
||||||
@ -1292,10 +1515,12 @@ End:
|
|||||||
* RETURNS
|
* RETURNS
|
||||||
* handle of connection or NULL on failure
|
* handle of connection or NULL on failure
|
||||||
*/
|
*/
|
||||||
HINTERNET WINAPI InternetOpenUrlA(HINTERNET hInternet, LPCSTR lpszUrl, LPCSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD dwContext)
|
HINTERNET WINAPI InternetOpenUrlA(HINTERNET hInternet, LPCSTR lpszUrl,
|
||||||
|
LPCSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD dwContext)
|
||||||
{
|
{
|
||||||
URL_COMPONENTSA urlComponents;
|
URL_COMPONENTSA urlComponents;
|
||||||
char protocol[32], hostName[MAXHOSTNAME], userName[1024], password[1024], path[2048], extra[1024];
|
char protocol[32], hostName[MAXHOSTNAME], userName[1024];
|
||||||
|
char password[1024], path[2048], extra[1024];
|
||||||
HINTERNET client = NULL, client1 = NULL;
|
HINTERNET client = NULL, client1 = NULL;
|
||||||
urlComponents.dwStructSize = sizeof(URL_COMPONENTSA);
|
urlComponents.dwStructSize = sizeof(URL_COMPONENTSA);
|
||||||
urlComponents.lpszScheme = protocol;
|
urlComponents.lpszScheme = protocol;
|
||||||
@ -1316,7 +1541,8 @@ HINTERNET WINAPI InternetOpenUrlA(HINTERNET hInternet, LPCSTR lpszUrl, LPCSTR lp
|
|||||||
case INTERNET_SCHEME_FTP:
|
case INTERNET_SCHEME_FTP:
|
||||||
if(urlComponents.nPort == 0)
|
if(urlComponents.nPort == 0)
|
||||||
urlComponents.nPort = INTERNET_DEFAULT_FTP_PORT;
|
urlComponents.nPort = INTERNET_DEFAULT_FTP_PORT;
|
||||||
client = InternetConnectA(hInternet, hostName, urlComponents.nPort, userName, password, INTERNET_SERVICE_FTP, dwFlags, dwContext);
|
client = InternetConnectA(hInternet, hostName, urlComponents.nPort,
|
||||||
|
userName, password, INTERNET_SERVICE_FTP, dwFlags, dwContext);
|
||||||
return FtpOpenFileA(client, path, GENERIC_READ, dwFlags, dwContext);
|
return FtpOpenFileA(client, path, GENERIC_READ, dwFlags, dwContext);
|
||||||
break;
|
break;
|
||||||
case INTERNET_SCHEME_HTTP:
|
case INTERNET_SCHEME_HTTP:
|
||||||
@ -1331,7 +1557,8 @@ HINTERNET WINAPI InternetOpenUrlA(HINTERNET hInternet, LPCSTR lpszUrl, LPCSTR lp
|
|||||||
else
|
else
|
||||||
urlComponents.nPort = INTERNET_DEFAULT_HTTPS_PORT;
|
urlComponents.nPort = INTERNET_DEFAULT_HTTPS_PORT;
|
||||||
}
|
}
|
||||||
client = InternetConnectA(hInternet, hostName, urlComponents.nPort, userName, password, INTERNET_SERVICE_HTTP, dwFlags, dwContext);
|
client = InternetConnectA(hInternet, hostName, urlComponents.nPort, userName,
|
||||||
|
password, INTERNET_SERVICE_HTTP, dwFlags, dwContext);
|
||||||
if(client == NULL)
|
if(client == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
client1 = HttpOpenRequestA(hInternet, NULL, path, NULL, NULL, accept, dwFlags, dwContext);
|
client1 = HttpOpenRequestA(hInternet, NULL, path, NULL, NULL, accept, dwFlags, dwContext);
|
||||||
@ -1360,6 +1587,48 @@ HINTERNET WINAPI InternetOpenUrlA(HINTERNET hInternet, LPCSTR lpszUrl, LPCSTR lp
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**********************************************************
|
||||||
|
* InternetOpenUrlW (WININET.@)
|
||||||
|
*
|
||||||
|
* Opens an URL
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* handle of connection or NULL on failure
|
||||||
|
*/
|
||||||
|
HINTERNET WINAPI InternetOpenUrlW(HINTERNET hInternet, LPCWSTR lpszUrl,
|
||||||
|
LPCWSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD dwContext)
|
||||||
|
{
|
||||||
|
HINTERNET rc = (HINTERNET)NULL;
|
||||||
|
|
||||||
|
INT lenUrl = lstrlenW(lpszUrl)+1;
|
||||||
|
INT lenHeaders = lstrlenW(lpszHeaders)+1;
|
||||||
|
CHAR *szUrl = (CHAR *)malloc(lenUrl*sizeof(CHAR));
|
||||||
|
CHAR *szHeaders = (CHAR *)malloc(lenHeaders*sizeof(CHAR));
|
||||||
|
|
||||||
|
if (!szUrl || !szHeaders)
|
||||||
|
{
|
||||||
|
if (szUrl)
|
||||||
|
free(szUrl);
|
||||||
|
if (szHeaders)
|
||||||
|
free(szHeaders);
|
||||||
|
return (HINTERNET)NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
WideCharToMultiByte(CP_ACP, -1, lpszUrl, -1, szUrl, lenUrl,
|
||||||
|
NULL, NULL);
|
||||||
|
WideCharToMultiByte(CP_ACP, -1, lpszHeaders, -1, szHeaders, lenHeaders,
|
||||||
|
NULL, NULL);
|
||||||
|
|
||||||
|
rc = InternetOpenUrlA(hInternet, szUrl, szHeaders,
|
||||||
|
dwHeadersLength, dwFlags, dwContext);
|
||||||
|
|
||||||
|
free(szUrl);
|
||||||
|
free(szHeaders);
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* INTERNET_SetLastError (internal)
|
* INTERNET_SetLastError (internal)
|
||||||
*
|
*
|
||||||
@ -1829,7 +2098,6 @@ BOOL WINAPI InternetUnlockRequestFile( HANDLE hLockHandle)
|
|||||||
* FALSE on failure
|
* FALSE on failure
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
BOOL WINAPI InternetAutoDial(DWORD dwFlags, HWND hwndParent)
|
BOOL WINAPI InternetAutoDial(DWORD dwFlags, HWND hwndParent)
|
||||||
{
|
{
|
||||||
FIXME("STUB\n");
|
FIXME("STUB\n");
|
||||||
@ -1837,3 +2105,23 @@ BOOL WINAPI InternetAutoDial(DWORD dwFlags, HWND hwndParent)
|
|||||||
/* Tell that we are connected to the internet. */
|
/* Tell that we are connected to the internet. */
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* InternetAutoDialHangup
|
||||||
|
*
|
||||||
|
* Hangs up an connection made with InternetAutoDial
|
||||||
|
*
|
||||||
|
* PARAM
|
||||||
|
* dwReserved
|
||||||
|
* RETURNS
|
||||||
|
* TRUE on success
|
||||||
|
* FALSE on failure
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
BOOL WINAPI InternetAutodialHangup(DWORD dwReserved)
|
||||||
|
{
|
||||||
|
FIXME("STUB\n");
|
||||||
|
|
||||||
|
/* we didn't dial, we don't disconnect */
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
init WININET_LibMain
|
init WININET_LibMain
|
||||||
|
|
||||||
@ stub InternetInitializeAutoProxyDll
|
@ stdcall InternetInitializeAutoProxyDll(long) InternetInitializeAutoProxyDll
|
||||||
@ stub ShowCertificate
|
@ stub ShowCertificate
|
||||||
@ stdcall CommitUrlCacheEntryA(str str long long long str long str str) CommitUrlCacheEntryA
|
@ stdcall CommitUrlCacheEntryA(str str long long long str long str str) CommitUrlCacheEntryA
|
||||||
@ stub CommitUrlCacheEntryW
|
@ stub CommitUrlCacheEntryW
|
||||||
@ -31,17 +31,17 @@ init WININET_LibMain
|
|||||||
@ stub FreeUrlCacheSpaceA
|
@ stub FreeUrlCacheSpaceA
|
||||||
@ stub FreeUrlCacheSpaceW
|
@ stub FreeUrlCacheSpaceW
|
||||||
@ stdcall FtpCreateDirectoryA(ptr str) FtpCreateDirectoryA
|
@ stdcall FtpCreateDirectoryA(ptr str) FtpCreateDirectoryA
|
||||||
@ stub FtpCreateDirectoryW
|
@ stdcall FtpCreateDirectoryW(ptr wstr) FtpCreateDirectoryW
|
||||||
@ stdcall FtpDeleteFileA(ptr str) FtpDeleteFileA
|
@ stdcall FtpDeleteFileA(ptr str) FtpDeleteFileA
|
||||||
@ stub FtpDeleteFileW
|
@ stub FtpDeleteFileW
|
||||||
@ stdcall FtpFindFirstFileA(ptr str str long long) FtpFindFirstFileA
|
@ stdcall FtpFindFirstFileA(ptr str str long long) FtpFindFirstFileA
|
||||||
@ stub FtpFindFirstFileW
|
@ stdcall FtpFindFirstFileW(ptr wstr wstr long long) FtpFindFirstFileW
|
||||||
@ stdcall FtpGetCurrentDirectoryA(ptr str ptr) FtpGetCurrentDirectoryA
|
@ stdcall FtpGetCurrentDirectoryA(ptr str ptr) FtpGetCurrentDirectoryA
|
||||||
@ stub FtpGetCurrentDirectoryW
|
@ stdcall FtpGetCurrentDirectoryW(ptr wstr ptr) FtpGetCurrentDirectoryW
|
||||||
@ stdcall FtpGetFileA(ptr str str long long long long) FtpGetFileA
|
@ stdcall FtpGetFileA(ptr str str long long long long) FtpGetFileA
|
||||||
@ stub FtpGetFileW
|
@ stdcall FtpGetFileW(ptr wstr wstr long long long long) FtpGetFileW
|
||||||
@ stdcall FtpOpenFileA(ptr str long long long) FtpOpenFileA
|
@ stdcall FtpOpenFileA(ptr str long long long) FtpOpenFileA
|
||||||
@ stub FtpOpenFileW
|
@ stdcall FtpOpenFileW(ptr wstr long long long) FtpOpenFileW
|
||||||
@ stdcall FtpPutFileA(ptr str str long long) FtpPutFileA
|
@ stdcall FtpPutFileA(ptr str str long long) FtpPutFileA
|
||||||
@ stub FtpPutFileW
|
@ stub FtpPutFileW
|
||||||
@ stdcall FtpRemoveDirectoryA(ptr str) FtpRemoveDirectoryA
|
@ stdcall FtpRemoveDirectoryA(ptr str) FtpRemoveDirectoryA
|
||||||
@ -49,7 +49,7 @@ init WININET_LibMain
|
|||||||
@ stdcall FtpRenameFileA(ptr str str) FtpRenameFileA
|
@ stdcall FtpRenameFileA(ptr str str) FtpRenameFileA
|
||||||
@ stub FtpRenameFileW
|
@ stub FtpRenameFileW
|
||||||
@ stdcall FtpSetCurrentDirectoryA(ptr str) FtpSetCurrentDirectoryA
|
@ stdcall FtpSetCurrentDirectoryA(ptr str) FtpSetCurrentDirectoryA
|
||||||
@ stub FtpSetCurrentDirectoryW
|
@ stdcall FtpSetCurrentDirectoryW(ptr wstr) FtpSetCurrentDirectoryW
|
||||||
@ stub GetUrlCacheConfigInfoA
|
@ stub GetUrlCacheConfigInfoA
|
||||||
@ stub GetUrlCacheConfigInfoW
|
@ stub GetUrlCacheConfigInfoW
|
||||||
@ stdcall GetUrlCacheEntryInfoA(str ptr long) GetUrlCacheEntryInfoA
|
@ stdcall GetUrlCacheEntryInfoA(str ptr long) GetUrlCacheEntryInfoA
|
||||||
@ -83,17 +83,17 @@ init WININET_LibMain
|
|||||||
@ stdcall InternetAttemptConnect(long) InternetAttemptConnect
|
@ stdcall InternetAttemptConnect(long) InternetAttemptConnect
|
||||||
@ stdcall InternetAutodial(long ptr) InternetAutoDial
|
@ stdcall InternetAutodial(long ptr) InternetAutoDial
|
||||||
@ stub InternetAutodialCallback
|
@ stub InternetAutodialCallback
|
||||||
@ stub InternetAutodialHangup
|
@ stdcall InternetAutodialHangup(long) InternetAutodialHangup
|
||||||
@ stdcall InternetCanonicalizeUrlA(str str ptr long) InternetCanonicalizeUrlA
|
@ stdcall InternetCanonicalizeUrlA(str str ptr long) InternetCanonicalizeUrlA
|
||||||
@ stub InternetCanonicalizeUrlW
|
@ stdcall InternetCanonicalizeUrlW(wstr wstr ptr long) InternetCanonicalizeUrlW
|
||||||
@ stdcall InternetCheckConnectionA(ptr long long) InternetCheckConnectionA
|
@ stdcall InternetCheckConnectionA(ptr long long) InternetCheckConnectionA
|
||||||
@ stub InternetCheckConnectionW
|
@ stdcall InternetCheckConnectionW(ptr long long) InternetCheckConnectionW
|
||||||
@ stdcall InternetCloseHandle(long) InternetCloseHandle
|
@ stdcall InternetCloseHandle(long) InternetCloseHandle
|
||||||
@ stub InternetCombineUrlA
|
@ stub InternetCombineUrlA
|
||||||
@ stub InternetCombineUrlW
|
@ stub InternetCombineUrlW
|
||||||
@ stub InternetConfirmZoneCrossing
|
@ stub InternetConfirmZoneCrossing
|
||||||
@ stdcall InternetConnectA(ptr str long str str long long long) InternetConnectA
|
@ stdcall InternetConnectA(ptr str long str str long long long) InternetConnectA
|
||||||
@ stub InternetConnectW
|
@ stdcall InternetConnectW(ptr wstr long wstr wstr long long long) InternetConnectW
|
||||||
@ stdcall InternetCrackUrlA(str long long ptr) InternetCrackUrlA
|
@ stdcall InternetCrackUrlA(str long long ptr) InternetCrackUrlA
|
||||||
@ stub InternetCrackUrlW
|
@ stub InternetCrackUrlW
|
||||||
@ stub InternetCreateUrlA
|
@ stub InternetCreateUrlA
|
||||||
@ -106,17 +106,17 @@ init WININET_LibMain
|
|||||||
@ stub InternetGetCertByURL
|
@ stub InternetGetCertByURL
|
||||||
@ stdcall InternetGetConnectedState(ptr long) InternetGetConnectedState
|
@ stdcall InternetGetConnectedState(ptr long) InternetGetConnectedState
|
||||||
@ stdcall InternetGetCookieA(str str ptr long) InternetGetCookieA
|
@ stdcall InternetGetCookieA(str str ptr long) InternetGetCookieA
|
||||||
@ stub InternetGetCookieW
|
@ stdcall InternetGetCookieW(wstr wstr ptr long) InternetGetCookieW
|
||||||
@ stdcall InternetGetLastResponseInfoA(ptr str ptr) InternetGetLastResponseInfoA
|
@ stdcall InternetGetLastResponseInfoA(ptr str ptr) InternetGetLastResponseInfoA
|
||||||
@ stub InternetGetLastResponseInfoW
|
@ stub InternetGetLastResponseInfoW
|
||||||
@ stub InternetGoOnline
|
@ stub InternetGoOnline
|
||||||
@ stub InternetHangUp
|
@ stub InternetHangUp
|
||||||
@ stdcall InternetLockRequestFile(ptr ptr) InternetLockRequestFile
|
@ stdcall InternetLockRequestFile(ptr ptr) InternetLockRequestFile
|
||||||
@ stdcall InternetOpenA(str long str str long) InternetOpenA
|
@ stdcall InternetOpenA(str long str str long) InternetOpenA
|
||||||
|
@ stdcall InternetOpenW(wstr long wstr wstr long) InternetOpenW
|
||||||
@ stub InternetOpenServerPushParse
|
@ stub InternetOpenServerPushParse
|
||||||
@ stdcall InternetOpenUrlA(ptr str str long long long) InternetOpenUrlA
|
@ stdcall InternetOpenUrlA(ptr str str long long long) InternetOpenUrlA
|
||||||
@ stub InternetOpenUrlW
|
@ stdcall InternetOpenUrlW(ptr wstr wstr long long long) InternetOpenUrlW
|
||||||
@ stub InternetOpenW
|
|
||||||
@ stdcall InternetQueryDataAvailable(ptr ptr long long) InternetQueryDataAvailable
|
@ stdcall InternetQueryDataAvailable(ptr ptr long long) InternetQueryDataAvailable
|
||||||
@ stdcall InternetQueryOptionA(ptr long ptr ptr) InternetQueryOptionA
|
@ stdcall InternetQueryOptionA(ptr long ptr ptr) InternetQueryOptionA
|
||||||
@ stub InternetQueryOptionW
|
@ stub InternetQueryOptionW
|
||||||
@ -125,7 +125,7 @@ init WININET_LibMain
|
|||||||
@ stdcall InternetReadFileExW(ptr ptr long long) InternetReadFileExW
|
@ stdcall InternetReadFileExW(ptr ptr long long) InternetReadFileExW
|
||||||
@ stub InternetServerPushParse
|
@ stub InternetServerPushParse
|
||||||
@ stdcall InternetSetCookieA(str str str) InternetSetCookieA
|
@ stdcall InternetSetCookieA(str str str) InternetSetCookieA
|
||||||
@ stub InternetSetCookieW
|
@ stdcall InternetSetCookieW(wstr wstr wstr) InternetSetCookieW
|
||||||
@ stub InternetSetDialState
|
@ stub InternetSetDialState
|
||||||
@ stub InternetSetFilePointer
|
@ stub InternetSetFilePointer
|
||||||
@ stdcall InternetSetOptionA(ptr long ptr long) InternetSetOptionA
|
@ stdcall InternetSetOptionA(ptr long ptr long) InternetSetOptionA
|
||||||
|
Loading…
x
Reference in New Issue
Block a user