mirror of
https://github.com/reactos/reactos.git
synced 2025-03-30 17:10:22 +00:00
[WINESYNC] wininet: Build with msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 3c31cc5836026b45a40818ec874bbbcc4d6ad982 by Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
4eead52783
commit
5f12c8d726
13 changed files with 361 additions and 363 deletions
|
@ -11,8 +11,6 @@ add_definitions(
|
|||
-D_WINE
|
||||
-Dclose=_close)
|
||||
|
||||
include_directories(BEFORE ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine)
|
||||
|
||||
spec2def(wininet.dll wininet.spec ADD_IMPORTLIB)
|
||||
|
||||
list(APPEND SOURCE
|
||||
|
@ -21,23 +19,29 @@ list(APPEND SOURCE
|
|||
ftp.c
|
||||
gopher.c
|
||||
http.c
|
||||
inflate.c
|
||||
internet.c
|
||||
netconnection.c
|
||||
urlcache.c
|
||||
utility.c)
|
||||
|
||||
list(APPEND PCH_SKIP_SOURCE
|
||||
# Sometimes wine uses nameless structs & unions. Sometimes not... */
|
||||
netconnection.c
|
||||
urlcache.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/wininet_stubs.c)
|
||||
|
||||
add_library(wininet_inflate OBJECT inflate.c)
|
||||
target_include_directories(wininet_inflate BEFORE PRIVATE ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine)
|
||||
add_dependencies(wininet_inflate psdk)
|
||||
|
||||
add_library(wininet MODULE
|
||||
${SOURCE}
|
||||
${PCH_SKIP_SOURCE}
|
||||
$<TARGET_OBJECTS:wininet_inflate>
|
||||
rsrc.rc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/wininet.def)
|
||||
|
||||
set_module_type(wininet win32dll)
|
||||
target_link_libraries(wininet wine ${PSEH_LIB})
|
||||
target_link_libraries(wininet wine ${PSEH_LIB} oldnames)
|
||||
|
||||
add_delay_importlibs(wininet secur32 crypt32 cryptui iphlpapi dhcpcsvc)
|
||||
add_importlibs(wininet mpr shlwapi shell32 user32 advapi32 ws2_32 normaliz kernel32_vista msvcrt kernel32 ntdll)
|
||||
add_pch(wininet precomp.h "${PCH_SKIP_SOURCE}")
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
#ifdef __REACTOS__
|
||||
#include "precomp.h"
|
||||
#else
|
||||
/*
|
||||
* Wininet - cookie handling stuff
|
||||
*
|
||||
|
@ -27,6 +30,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
|
@ -36,6 +40,7 @@
|
|||
|
||||
#include "wine/debug.h"
|
||||
#include "internet.h"
|
||||
#endif /* defined(__REACTOS__) */
|
||||
|
||||
#define RESPONSE_TIMEOUT 30 /* FROM internet.c */
|
||||
|
||||
|
@ -173,7 +178,7 @@ static WCHAR *create_cookie_url(substr_t domain, substr_t path, substr_t *ret_pa
|
|||
p += domain.len;
|
||||
|
||||
for(i=0; i < path.len; i++)
|
||||
p[i] = tolowerW(path.str[i]);
|
||||
p[i] = towlower(path.str[i]);
|
||||
p[path.len] = 0;
|
||||
|
||||
ret_path->str = p;
|
||||
|
@ -194,7 +199,7 @@ static cookie_container_t *get_cookie_container(substr_t domain, substr_t path,
|
|||
if(cookie_container->path.len < path.len)
|
||||
break;
|
||||
|
||||
if(path.len == cookie_container->path.len && !strncmpiW(cookie_container->path.str, path.str, path.len))
|
||||
if(path.len == cookie_container->path.len && !wcsnicmp(cookie_container->path.str, path.str, path.len))
|
||||
return cookie_container;
|
||||
}
|
||||
|
||||
|
@ -265,7 +270,7 @@ static cookie_t *find_cookie(cookie_container_t *container, substr_t name)
|
|||
cookie_t *iter;
|
||||
|
||||
LIST_FOR_EACH_ENTRY(iter, &container->cookie_list, cookie_t, entry) {
|
||||
if(strlenW(iter->name) == name.len && !strncmpiW(iter->name, name.str, name.len))
|
||||
if(lstrlenW(iter->name) == name.len && !wcsnicmp(iter->name, name.str, name.len))
|
||||
return iter;
|
||||
}
|
||||
|
||||
|
@ -294,7 +299,7 @@ static void replace_cookie(cookie_container_t *container, cookie_t *new_cookie)
|
|||
|
||||
static BOOL cookie_match_path(cookie_container_t *container, substr_t path)
|
||||
{
|
||||
return path.len >= container->path.len && !strncmpiW(container->path.str, path.str, container->path.len);
|
||||
return path.len >= container->path.len && !wcsnicmp(container->path.str, path.str, container->path.len);
|
||||
}
|
||||
|
||||
static BOOL load_persistent_cookie(substr_t domain, substr_t path)
|
||||
|
@ -603,9 +608,9 @@ static DWORD get_cookie(substr_t host, substr_t path, DWORD flags, cookie_set_t
|
|||
res->string_len += 2; /* '; ' */
|
||||
res->cookies[res->cnt++] = cookie_iter;
|
||||
|
||||
res->string_len += strlenW(cookie_iter->name);
|
||||
res->string_len += lstrlenW(cookie_iter->name);
|
||||
if(*cookie_iter->data)
|
||||
res->string_len += 1 /* = */ + strlenW(cookie_iter->data);
|
||||
res->string_len += 1 /* = */ + lstrlenW(cookie_iter->data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -624,13 +629,13 @@ static void cookie_set_to_string(const cookie_set_t *cookie_set, WCHAR *str)
|
|||
*ptr++ = ' ';
|
||||
}
|
||||
|
||||
len = strlenW(cookie_set->cookies[i]->name);
|
||||
len = lstrlenW(cookie_set->cookies[i]->name);
|
||||
memcpy(ptr, cookie_set->cookies[i]->name, len*sizeof(WCHAR));
|
||||
ptr += len;
|
||||
|
||||
if(*cookie_set->cookies[i]->data) {
|
||||
*ptr++ = '=';
|
||||
len = strlenW(cookie_set->cookies[i]->data);
|
||||
len = lstrlenW(cookie_set->cookies[i]->data);
|
||||
memcpy(ptr, cookie_set->cookies[i]->data, len*sizeof(WCHAR));
|
||||
ptr += len;
|
||||
}
|
||||
|
@ -872,11 +877,11 @@ static BOOL is_domain_legal_for_cookie(substr_t domain, substr_t full_domain)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if(domain.len > full_domain.len || !memchrW(domain.str, '.', domain.len) || !memchrW(full_domain.str, '.', full_domain.len))
|
||||
if(domain.len > full_domain.len || !wmemchr(domain.str, '.', domain.len) || !wmemchr(full_domain.str, '.', full_domain.len))
|
||||
return FALSE;
|
||||
|
||||
ptr = full_domain.str + full_domain.len - domain.len;
|
||||
if (strncmpiW(domain.str, ptr, domain.len) || (full_domain.len > domain.len && ptr[-1] != '.')) {
|
||||
if (wcsnicmp(domain.str, ptr, domain.len) || (full_domain.len > domain.len && ptr[-1] != '.')) {
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -924,7 +929,7 @@ DWORD set_cookie(substr_t domain, substr_t path, substr_t name, substr_t data, D
|
|||
|
||||
/* lots of information can be parsed out of the cookie value */
|
||||
|
||||
if(!(end_ptr = memchrW(data.str, ';', data.len)))
|
||||
if(!(end_ptr = wmemchr(data.str, ';', data.len)))
|
||||
end_ptr = data.str + data.len;
|
||||
value = substr(data.str, end_ptr-data.str);
|
||||
data.str += value.len;
|
||||
|
@ -949,10 +954,10 @@ DWORD set_cookie(substr_t domain, substr_t path, substr_t name, substr_t data, D
|
|||
if(!data.len)
|
||||
break;
|
||||
|
||||
if(!(end_ptr = memchrW(data.str, ';', data.len)))
|
||||
if(!(end_ptr = wmemchr(data.str, ';', data.len)))
|
||||
end_ptr = data.str + data.len;
|
||||
|
||||
if(data.len >= (len = ARRAY_SIZE(szDomain)) && !strncmpiW(data.str, szDomain, len)) {
|
||||
if(data.len >= (len = ARRAY_SIZE(szDomain)) && !wcsnicmp(data.str, szDomain, len)) {
|
||||
substr_skip(&data, len);
|
||||
|
||||
if(data.len && *data.str == '.')
|
||||
|
@ -963,11 +968,11 @@ DWORD set_cookie(substr_t domain, substr_t path, substr_t name, substr_t data, D
|
|||
|
||||
domain = substr(data.str, end_ptr-data.str);
|
||||
TRACE("Parsing new domain %s\n", debugstr_wn(domain.str, domain.len));
|
||||
}else if(data.len >= (len = ARRAY_SIZE(szPath)) && !strncmpiW(data.str, szPath, len)) {
|
||||
}else if(data.len >= (len = ARRAY_SIZE(szPath)) && !wcsnicmp(data.str, szPath, len)) {
|
||||
substr_skip(&data, len);
|
||||
path = substr(data.str, end_ptr - data.str);
|
||||
TRACE("Parsing new path %s\n", debugstr_wn(path.str, path.len));
|
||||
}else if(data.len >= (len = ARRAY_SIZE(szExpires)) && !strncmpiW(data.str, szExpires, len)) {
|
||||
}else if(data.len >= (len = ARRAY_SIZE(szExpires)) && !wcsnicmp(data.str, szExpires, len)) {
|
||||
SYSTEMTIME st;
|
||||
WCHAR buf[128];
|
||||
|
||||
|
@ -986,10 +991,10 @@ DWORD set_cookie(substr_t domain, substr_t path, substr_t name, substr_t data, D
|
|||
}
|
||||
}
|
||||
}
|
||||
}else if(data.len >= (len = ARRAY_SIZE(szSecure)) && !strncmpiW(data.str, szSecure, len)) {
|
||||
}else if(data.len >= (len = ARRAY_SIZE(szSecure)) && !wcsnicmp(data.str, szSecure, len)) {
|
||||
substr_skip(&data, len);
|
||||
FIXME("secure not handled\n");
|
||||
}else if(data.len >= (len = ARRAY_SIZE(szHttpOnly)) && !strncmpiW(data.str, szHttpOnly, len)) {
|
||||
}else if(data.len >= (len = ARRAY_SIZE(szHttpOnly)) && !wcsnicmp(data.str, szHttpOnly, len)) {
|
||||
substr_skip(&data, len);
|
||||
|
||||
if(!(flags & INTERNET_COOKIE_HTTPONLY)) {
|
||||
|
@ -999,11 +1004,11 @@ DWORD set_cookie(substr_t domain, substr_t path, substr_t name, substr_t data, D
|
|||
}
|
||||
|
||||
cookie_flags |= INTERNET_COOKIE_HTTPONLY;
|
||||
}else if(data.len >= (len = ARRAY_SIZE(szVersion)) && !strncmpiW(data.str, szVersion, len)) {
|
||||
}else if(data.len >= (len = ARRAY_SIZE(szVersion)) && !wcsnicmp(data.str, szVersion, len)) {
|
||||
substr_skip(&data, len);
|
||||
|
||||
FIXME("version not handled (%s)\n",debugstr_wn(data.str, data.len));
|
||||
}else if(data.len >= (len = ARRAY_SIZE(max_ageW)) && !strncmpiW(data.str, max_ageW, len)) {
|
||||
}else if(data.len >= (len = ARRAY_SIZE(max_ageW)) && !wcsnicmp(data.str, max_ageW, len)) {
|
||||
/* Native doesn't support Max-Age attribute. */
|
||||
WARN("Max-Age ignored\n");
|
||||
}else if(data.len) {
|
||||
|
@ -1098,8 +1103,8 @@ DWORD WINAPI InternetSetCookieExW(LPCWSTR lpszUrl, LPCWSTR lpszCookieName,
|
|||
/* some apps (or is it us??) try to add a cookie with no cookie name, but
|
||||
* the cookie data in the form of name[=data].
|
||||
*/
|
||||
if (!(ptr = strchrW(lpCookieData, '=')))
|
||||
ptr = lpCookieData + strlenW(lpCookieData);
|
||||
if (!(ptr = wcschr(lpCookieData, '=')))
|
||||
ptr = lpCookieData + lstrlenW(lpCookieData);
|
||||
|
||||
name = substr(lpCookieData, ptr - lpCookieData);
|
||||
data = substrz(*ptr == '=' ? ptr+1 : ptr);
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
#ifdef __REACTOS__
|
||||
#include "precomp.h"
|
||||
#else
|
||||
/*
|
||||
* Wininet
|
||||
*
|
||||
|
@ -35,10 +38,8 @@
|
|||
#include "cryptuiapi.h"
|
||||
|
||||
#include "internet.h"
|
||||
|
||||
#include "wine/unicode.h"
|
||||
|
||||
#include "resource.h"
|
||||
#endif /* defined(__REACTOS__) */
|
||||
|
||||
#define MAX_STRING_LEN 1024
|
||||
|
||||
|
@ -78,8 +79,8 @@ static BOOL WININET_GetAuthRealm( HINTERNET hRequest, LPWSTR szBuf, DWORD sz, BO
|
|||
* FIXME: maybe we should check that we're
|
||||
* dealing with 'Basic' Authentication
|
||||
*/
|
||||
p = strchrW( szBuf, ' ' );
|
||||
if( !p || strncmpW( p+1, szRealm, strlenW(szRealm) ) )
|
||||
p = wcschr( szBuf, ' ' );
|
||||
if( !p || wcsncmp( p+1, szRealm, lstrlenW(szRealm) ) )
|
||||
{
|
||||
ERR("response wrong? (%s)\n", debugstr_w(szBuf));
|
||||
return FALSE;
|
||||
|
@ -90,11 +91,11 @@ static BOOL WININET_GetAuthRealm( HINTERNET hRequest, LPWSTR szBuf, DWORD sz, BO
|
|||
if( *p == '"' )
|
||||
{
|
||||
p++;
|
||||
q = strrchrW( p, '"' );
|
||||
q = wcsrchr( p, '"' );
|
||||
if( q )
|
||||
*q = 0;
|
||||
}
|
||||
strcpyW( szBuf, p );
|
||||
lstrcpyW( szBuf, p );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -106,7 +107,7 @@ extern DWORD WINAPI WNetGetCachedPassword(LPSTR,WORD,LPSTR,LPWORD,BYTE);
|
|||
/***********************************************************************
|
||||
* WININET_GetSetPassword
|
||||
*/
|
||||
static BOOL WININET_GetSetPassword( HWND hdlg, LPCWSTR szServer,
|
||||
static BOOL WININET_GetSetPassword( HWND hdlg, LPCWSTR szServer,
|
||||
LPCWSTR szRealm, BOOL bSet )
|
||||
{
|
||||
WCHAR szResource[0x80], szUserPass[0x40];
|
||||
|
@ -137,11 +138,11 @@ static BOOL WININET_GetSetPassword( HWND hdlg, LPCWSTR szServer,
|
|||
szUserPass[0] = 0;
|
||||
GetWindowTextW( hUserItem, szUserPass, ARRAY_SIZE( szUserPass ) - 1 );
|
||||
lstrcatW(szUserPass, szColon);
|
||||
u_len = strlenW( szUserPass );
|
||||
u_len = lstrlenW( szUserPass );
|
||||
GetWindowTextW( hPassItem, szUserPass+u_len, ARRAY_SIZE( szUserPass ) - u_len );
|
||||
|
||||
r_len = (strlenW( szResource ) + 1)*sizeof(WCHAR);
|
||||
u_len = (strlenW( szUserPass ) + 1)*sizeof(WCHAR);
|
||||
r_len = (lstrlenW( szResource ) + 1)*sizeof(WCHAR);
|
||||
u_len = (lstrlenW( szUserPass ) + 1)*sizeof(WCHAR);
|
||||
r = WNetCachePassword( (CHAR*)szResource, r_len,
|
||||
(CHAR*)szUserPass, u_len, dwMagic, 0 );
|
||||
|
||||
|
@ -149,13 +150,13 @@ static BOOL WININET_GetSetPassword( HWND hdlg, LPCWSTR szServer,
|
|||
}
|
||||
|
||||
sz = sizeof szUserPass;
|
||||
r_len = (strlenW( szResource ) + 1)*sizeof(WCHAR);
|
||||
r_len = (lstrlenW( szResource ) + 1)*sizeof(WCHAR);
|
||||
r = WNetGetCachedPassword( (CHAR*)szResource, r_len,
|
||||
(CHAR*)szUserPass, &sz, dwMagic );
|
||||
if( r != WN_SUCCESS )
|
||||
return FALSE;
|
||||
|
||||
p = strchrW( szUserPass, ':' );
|
||||
p = wcschr( szUserPass, ':' );
|
||||
if( p )
|
||||
{
|
||||
*p = 0;
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
#ifdef __REACTOS__
|
||||
#include "precomp.h"
|
||||
#else
|
||||
/*
|
||||
* WININET - Ftp implementation
|
||||
*
|
||||
|
@ -49,6 +52,7 @@
|
|||
|
||||
#include "wine/debug.h"
|
||||
#include "internet.h"
|
||||
#endif /* defined(__REACTOS__) */
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(wininet);
|
||||
|
||||
|
@ -224,7 +228,7 @@ BOOL WINAPI FtpPutFileA(HINTERNET hConnect, LPCSTR lpszLocalFile,
|
|||
LPWSTR lpwzLocalFile;
|
||||
LPWSTR lpwzNewRemoteFile;
|
||||
BOOL ret;
|
||||
|
||||
|
||||
lpwzLocalFile = heap_strdupAtoW(lpszLocalFile);
|
||||
lpwzNewRemoteFile = heap_strdupAtoW(lpszNewRemoteFile);
|
||||
ret = FtpPutFileW(hConnect, lpwzLocalFile, lpwzNewRemoteFile,
|
||||
|
@ -417,7 +421,7 @@ BOOL WINAPI FtpSetCurrentDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory)
|
|||
{
|
||||
LPWSTR lpwzDirectory;
|
||||
BOOL ret;
|
||||
|
||||
|
||||
lpwzDirectory = heap_strdupAtoW(lpszDirectory);
|
||||
ret = FtpSetCurrentDirectoryW(hConnect, lpwzDirectory);
|
||||
heap_free(lpwzDirectory);
|
||||
|
@ -564,7 +568,7 @@ BOOL WINAPI FtpCreateDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory)
|
|||
{
|
||||
LPWSTR lpwzDirectory;
|
||||
BOOL ret;
|
||||
|
||||
|
||||
lpwzDirectory = heap_strdupAtoW(lpszDirectory);
|
||||
ret = FtpCreateDirectoryW(hConnect, lpwzDirectory);
|
||||
heap_free(lpwzDirectory);
|
||||
|
@ -710,12 +714,12 @@ HINTERNET WINAPI FtpFindFirstFileA(HINTERNET hConnect,
|
|||
WIN32_FIND_DATAW wfd;
|
||||
LPWIN32_FIND_DATAW lpFindFileDataW;
|
||||
HINTERNET ret;
|
||||
|
||||
|
||||
lpwzSearchFile = heap_strdupAtoW(lpszSearchFile);
|
||||
lpFindFileDataW = lpFindFileData?&wfd:NULL;
|
||||
ret = FtpFindFirstFileW(hConnect, lpwzSearchFile, lpFindFileDataW, dwFlags, dwContext);
|
||||
heap_free(lpwzSearchFile);
|
||||
|
||||
|
||||
if (ret && lpFindFileData)
|
||||
WININET_find_data_WtoA(lpFindFileDataW, lpFindFileData);
|
||||
|
||||
|
@ -834,8 +838,8 @@ static HINTERNET FTP_FtpFindFirstFileW(ftp_session_t *lpwfs,
|
|||
if (lpszSearchFile)
|
||||
{
|
||||
LPCWSTR name = lpszSearchFile, p;
|
||||
if ((p = strrchrW( name, '\\' ))) name = p + 1;
|
||||
if ((p = strrchrW( name, '/' ))) name = p + 1;
|
||||
if ((p = wcsrchr( name, '\\' ))) name = p + 1;
|
||||
if ((p = wcsrchr( name, '/' ))) name = p + 1;
|
||||
if (name != lpszSearchFile)
|
||||
{
|
||||
lpszSearchPath = heap_strndupW(lpszSearchFile, name - lpszSearchFile);
|
||||
|
@ -1351,7 +1355,7 @@ static HINTERNET FTP_FtpOpenFileW(ftp_session_t *lpwfs,
|
|||
WININET_AddRef( &lpwfs->hdr );
|
||||
lpwh->lpFtpSession = lpwfs;
|
||||
list_add_head( &lpwfs->hdr.children, &lpwh->hdr.entry );
|
||||
|
||||
|
||||
/* Indicate that a download is currently in progress */
|
||||
lpwfs->download_in_progress = lpwh;
|
||||
}
|
||||
|
@ -1560,7 +1564,7 @@ BOOL WINAPI FtpGetFileA(HINTERNET hInternet, LPCSTR lpszRemoteFile, LPCSTR lpszN
|
|||
LPWSTR lpwzRemoteFile;
|
||||
LPWSTR lpwzNewFile;
|
||||
BOOL ret;
|
||||
|
||||
|
||||
lpwzRemoteFile = heap_strdupAtoW(lpszRemoteFile);
|
||||
lpwzNewFile = heap_strdupAtoW(lpszNewFile);
|
||||
ret = FtpGetFileW(hInternet, lpwzRemoteFile, lpwzNewFile, fFailIfExists,
|
||||
|
@ -1642,7 +1646,7 @@ BOOL WINAPI FtpGetFileW(HINTERNET hInternet, LPCWSTR lpszRemoteFile, LPCWSTR lps
|
|||
INTERNET_SetLastError(ERROR_FTP_TRANSFER_IN_PROGRESS);
|
||||
goto lend;
|
||||
}
|
||||
|
||||
|
||||
hIC = lpwfs->lpAppInfo;
|
||||
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC)
|
||||
{
|
||||
|
@ -1775,7 +1779,7 @@ BOOL WINAPI FtpDeleteFileA(HINTERNET hFtpSession, LPCSTR lpszFileName)
|
|||
{
|
||||
LPWSTR lpwzFileName;
|
||||
BOOL ret;
|
||||
|
||||
|
||||
lpwzFileName = heap_strdupAtoW(lpszFileName);
|
||||
ret = FtpDeleteFileW(hFtpSession, lpwzFileName);
|
||||
heap_free(lpwzFileName);
|
||||
|
@ -1922,7 +1926,7 @@ BOOL WINAPI FtpRemoveDirectoryA(HINTERNET hFtpSession, LPCSTR lpszDirectory)
|
|||
{
|
||||
LPWSTR lpwzDirectory;
|
||||
BOOL ret;
|
||||
|
||||
|
||||
lpwzDirectory = heap_strdupAtoW(lpszDirectory);
|
||||
ret = FtpRemoveDirectoryW(hFtpSession, lpwzDirectory);
|
||||
heap_free(lpwzDirectory);
|
||||
|
@ -2066,7 +2070,7 @@ BOOL WINAPI FtpRenameFileA(HINTERNET hFtpSession, LPCSTR lpszSrc, LPCSTR lpszDes
|
|||
LPWSTR lpwzSrc;
|
||||
LPWSTR lpwzDest;
|
||||
BOOL ret;
|
||||
|
||||
|
||||
lpwzSrc = heap_strdupAtoW(lpszSrc);
|
||||
lpwzDest = heap_strdupAtoW(lpszDest);
|
||||
ret = FtpRenameFileW(hFtpSession, lpwzSrc, lpwzDest);
|
||||
|
@ -2453,7 +2457,7 @@ HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
|
|||
INTERNET_SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
lpwfs = alloc_object(&hIC->hdr, &FTPSESSIONVtbl, sizeof(ftp_session_t));
|
||||
if (NULL == lpwfs)
|
||||
{
|
||||
|
@ -2480,7 +2484,7 @@ HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
|
|||
list_add_head( &hIC->hdr.children, &lpwfs->hdr.entry );
|
||||
|
||||
if(hIC->proxy && hIC->accessType == INTERNET_OPEN_TYPE_PROXY) {
|
||||
if(strchrW(hIC->proxy, ' '))
|
||||
if(wcschr(hIC->proxy, ' '))
|
||||
FIXME("Several proxies not implemented.\n");
|
||||
if(hIC->proxyBypass)
|
||||
FIXME("Proxy bypass is ignored.\n");
|
||||
|
@ -2497,7 +2501,7 @@ HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
|
|||
/* Nothing in the registry, get the username and use that as the password */
|
||||
if (!GetUserNameW(szPassword, &len)) {
|
||||
/* Should never get here, but use an empty password as failsafe */
|
||||
strcpyW(szPassword, szEmpty);
|
||||
lstrcpyW(szPassword, szEmpty);
|
||||
}
|
||||
}
|
||||
RegCloseKey(key);
|
||||
|
@ -2510,7 +2514,7 @@ HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
|
|||
lpwfs->lpszPassword = heap_strdupW(lpszPassword ? lpszPassword : szEmpty);
|
||||
}
|
||||
lpwfs->servername = heap_strdupW(lpszServerName);
|
||||
|
||||
|
||||
/* Don't send a handle created callback if this handle was created with InternetOpenUrl */
|
||||
if (!(lpwfs->hdr.dwInternalFlags & INET_OPENURL))
|
||||
{
|
||||
|
@ -2523,9 +2527,9 @@ HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
|
|||
INTERNET_STATUS_HANDLE_CREATED, &iar,
|
||||
sizeof(INTERNET_ASYNC_RESULT));
|
||||
}
|
||||
|
||||
|
||||
INTERNET_SendCallback(&hIC->hdr, dwContext, INTERNET_STATUS_RESOLVING_NAME,
|
||||
(LPWSTR) lpszServerName, (strlenW(lpszServerName)+1) * sizeof(WCHAR));
|
||||
(LPWSTR) lpszServerName, (lstrlenW(lpszServerName)+1) * sizeof(WCHAR));
|
||||
|
||||
sock_namelen = sizeof(socketAddr);
|
||||
if (!GetAddress(lpszServerName, lpwfs->serverport, (struct sockaddr *)&socketAddr, &sock_namelen, szaddr))
|
||||
|
@ -3067,7 +3071,7 @@ static BOOL FTP_GetFileSize(ftp_session_t *lpwfs, LPCWSTR lpszRemoteFile, DWORD
|
|||
for (i = 0; (lpszResponseBuffer[i] != ' ') && (lpszResponseBuffer[i] != '\0'); i++) ;
|
||||
if (lpszResponseBuffer[i] == '\0') return FALSE;
|
||||
*dwSize = atol(&(lpszResponseBuffer[i + 1]));
|
||||
|
||||
|
||||
bSuccess = TRUE;
|
||||
} else {
|
||||
FTP_SetResponseError(nResCode);
|
||||
|
@ -3098,7 +3102,7 @@ static BOOL FTP_SendPort(ftp_session_t *lpwfs)
|
|||
BOOL bSuccess = FALSE;
|
||||
TRACE("\n");
|
||||
|
||||
sprintfW(szIPAddress, szIPFormat,
|
||||
swprintf(szIPAddress, ARRAY_SIZE(szIPAddress), szIPFormat,
|
||||
lpwfs->lstnSocketAddress.sin_addr.S_un.S_addr&0x000000FF,
|
||||
(lpwfs->lstnSocketAddress.sin_addr.S_un.S_addr&0x0000FF00)>>8,
|
||||
(lpwfs->lstnSocketAddress.sin_addr.S_un.S_addr&0x00FF0000)>>16,
|
||||
|
@ -3603,7 +3607,7 @@ static BOOL FTP_ConvertFileProp(LPFILEPROPERTIESW lpafp, LPWIN32_FIND_DATAW lpFi
|
|||
SystemTimeToFileTime( &lpafp->tmLastModified, &lpFindFileData->ftLastAccessTime );
|
||||
lpFindFileData->ftLastWriteTime = lpFindFileData->ftLastAccessTime;
|
||||
lpFindFileData->ftCreationTime = lpFindFileData->ftLastAccessTime;
|
||||
|
||||
|
||||
/* Not all fields are filled in */
|
||||
lpFindFileData->nFileSizeHigh = 0; /* We do not handle files bigger than 0xFFFFFFFF bytes yet :-) */
|
||||
lpFindFileData->nFileSizeLow = lpafp->nSize;
|
||||
|
@ -3638,12 +3642,12 @@ static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERT
|
|||
char *pszTmp;
|
||||
BOOL found = FALSE;
|
||||
int i;
|
||||
|
||||
|
||||
lpfp->lpszName = NULL;
|
||||
do {
|
||||
if(!(pszLine = FTP_GetNextLine(nSocket, &nBufLen)))
|
||||
return FALSE;
|
||||
|
||||
|
||||
pszToken = strtok(pszLine, szSpace);
|
||||
/* ls format
|
||||
* <Permissions> <NoLinks> <owner> <group> <size> <date> <time or year> <filename>
|
||||
|
@ -3667,14 +3671,14 @@ static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERT
|
|||
TRACE("Size: %s\n", pszToken);
|
||||
lpfp->nSize = atol(pszToken);
|
||||
}
|
||||
|
||||
|
||||
lpfp->tmLastModified.wSecond = 0;
|
||||
lpfp->tmLastModified.wMinute = 0;
|
||||
lpfp->tmLastModified.wHour = 0;
|
||||
lpfp->tmLastModified.wDay = 0;
|
||||
lpfp->tmLastModified.wMonth = 0;
|
||||
lpfp->tmLastModified.wYear = 0;
|
||||
|
||||
|
||||
/* Determine month */
|
||||
pszToken = strtok(NULL, szSpace);
|
||||
if(!pszToken) continue;
|
||||
|
@ -3713,14 +3717,14 @@ static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERT
|
|||
TRACE("File: %s\n", debugstr_w(lpfp->lpszName));
|
||||
}
|
||||
/* NT way of parsing ... :
|
||||
|
||||
|
||||
07-13-03 08:55PM <DIR> sakpatch
|
||||
05-09-03 06:02PM 12656686 2003-04-21bgm_cmd_e.rgz
|
||||
*/
|
||||
else if(isdigit(pszToken[0]) && 8 == strlen(pszToken)) {
|
||||
int mon, mday, year, hour, min;
|
||||
lpfp->permissions = 0xFFFF; /* No idea, put full permission :-) */
|
||||
|
||||
|
||||
sscanf(pszToken, "%d-%d-%d", &mon, &mday, &year);
|
||||
lpfp->tmLastModified.wDay = mday;
|
||||
lpfp->tmLastModified.wMonth = mon;
|
||||
|
@ -3755,7 +3759,7 @@ static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERT
|
|||
lpfp->nSize = atol(pszToken);
|
||||
TRACE("Size: %d\n", lpfp->nSize);
|
||||
}
|
||||
|
||||
|
||||
pszToken = strtok(NULL, szSpace);
|
||||
if(!pszToken) continue;
|
||||
lpfp->lpszName = heap_strdupAtoW(pszToken);
|
||||
|
@ -3765,7 +3769,7 @@ static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERT
|
|||
else if(pszToken[0] == '+') {
|
||||
FIXME("EPLF Format not implemented\n");
|
||||
}
|
||||
|
||||
|
||||
if(lpfp->lpszName) {
|
||||
if((lpszSearchFile == NULL) ||
|
||||
(PathMatchSpecW(lpfp->lpszName, lpszSearchFile))) {
|
||||
|
@ -3808,7 +3812,7 @@ static BOOL FTP_ParseDirectory(ftp_session_t *lpwfs, INT nSocket, LPCWSTR lpszSe
|
|||
if (indexFilePropArray+1 >= sizeFilePropArray)
|
||||
{
|
||||
LPFILEPROPERTIESW tmpafp;
|
||||
|
||||
|
||||
sizeFilePropArray *= 2;
|
||||
tmpafp = heap_realloc_zero(*lpafp, sizeof(FILEPROPERTIESW)*sizeFilePropArray);
|
||||
if (NULL == tmpafp)
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/*
|
||||
#ifdef __REACTOS__
|
||||
#include "precomp.h"
|
||||
#else/*
|
||||
* WININET - Gopher implementation
|
||||
*
|
||||
* Copyright 2003 Kirill Smelkov
|
||||
|
@ -18,8 +20,6 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "windef.h"
|
||||
|
@ -27,6 +27,7 @@
|
|||
#include "wininet.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
#endif /* defined(__REACTOS__) */
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(wininet);
|
||||
|
||||
|
@ -65,7 +66,7 @@ BOOL WINAPI GopherCreateLocatorA(
|
|||
|
||||
/***********************************************************************
|
||||
* GopherCreateLocatorW (WININET.@)
|
||||
*
|
||||
*
|
||||
* See GopherCreateLocatorA.
|
||||
*/
|
||||
BOOL WINAPI GopherCreateLocatorW(
|
||||
|
@ -138,7 +139,7 @@ HINTERNET WINAPI GopherFindFirstFileW(
|
|||
* GopherGetAttributeA (WININET.@)
|
||||
*
|
||||
* Retrieves the specific attribute information from the server.
|
||||
*
|
||||
*
|
||||
* RETURNS
|
||||
* TRUE on success
|
||||
* FALSE on failure
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -29,8 +29,6 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "winsock2.h"
|
||||
#include "ws2ipdef.h"
|
||||
|
||||
|
@ -40,6 +38,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
|
@ -60,8 +59,6 @@
|
|||
|
||||
#include "internet.h"
|
||||
#include "resource.h"
|
||||
|
||||
#include "wine/unicode.h"
|
||||
#endif /* defined(__REACTOS__) */
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(wininet);
|
||||
|
@ -401,11 +398,11 @@ WCHAR *INTERNET_FindProxyForProtocol(LPCWSTR szProxy, LPCWSTR proto)
|
|||
{
|
||||
LPCWSTR end, equal;
|
||||
|
||||
if (!(end = strchrW(ptr, ' ')))
|
||||
end = ptr + strlenW(ptr);
|
||||
if ((equal = strchrW(ptr, '=')) && equal < end &&
|
||||
equal - ptr == strlenW(proto) &&
|
||||
!strncmpiW(proto, ptr, strlenW(proto)))
|
||||
if (!(end = wcschr(ptr, ' ')))
|
||||
end = ptr + lstrlenW(ptr);
|
||||
if ((equal = wcschr(ptr, '=')) && equal < end &&
|
||||
equal - ptr == lstrlenW(proto) &&
|
||||
!wcsnicmp(proto, ptr, lstrlenW(proto)))
|
||||
{
|
||||
ret = heap_strndupW(equal + 1, end - equal - 1);
|
||||
TRACE("found proxy for %s: %s\n", debugstr_w(proto), debugstr_w(ret));
|
||||
|
@ -422,9 +419,9 @@ WCHAR *INTERNET_FindProxyForProtocol(LPCWSTR szProxy, LPCWSTR proto)
|
|||
{
|
||||
LPCWSTR end;
|
||||
|
||||
if (!(end = strchrW(ptr, ' ')))
|
||||
end = ptr + strlenW(ptr);
|
||||
if (!strchrW(ptr, '='))
|
||||
if (!(end = wcschr(ptr, ' ')))
|
||||
end = ptr + lstrlenW(ptr);
|
||||
if (!wcschr(ptr, '='))
|
||||
{
|
||||
ret = heap_strndupW(ptr, end - ptr);
|
||||
TRACE("found proxy for %s: %s\n", debugstr_w(proto), debugstr_w(ret));
|
||||
|
@ -514,7 +511,7 @@ static BOOL parse_proxy_url( proxyinfo_t *info, const WCHAR *url )
|
|||
return TRUE;
|
||||
}
|
||||
if (!(info->proxy = heap_alloc( (uc.dwHostNameLength + 12) * sizeof(WCHAR) ))) return FALSE;
|
||||
sprintfW( info->proxy, fmt, uc.dwHostNameLength, uc.lpszHostName, uc.nPort );
|
||||
swprintf( info->proxy, uc.dwHostNameLength + 12, fmt, uc.dwHostNameLength, uc.lpszHostName, uc.nPort );
|
||||
|
||||
if (!uc.dwUserNameLength) info->proxyUsername = NULL;
|
||||
else if (!(info->proxyUsername = heap_strndupW( uc.lpszUserName, uc.dwUserNameLength )))
|
||||
|
@ -597,13 +594,13 @@ static LONG INTERNET_LoadProxySettings( proxyinfo_t *lpwpi )
|
|||
RegQueryValueExW( key, szProxyServer, NULL, &type, (BYTE*)szProxy, &len );
|
||||
|
||||
/* find the http proxy, and strip away everything else */
|
||||
p = strstrW( szProxy, szHttp );
|
||||
p = wcsstr( szProxy, szHttp );
|
||||
if (p)
|
||||
{
|
||||
p += lstrlenW( szHttp );
|
||||
lstrcpyW( szProxy, p );
|
||||
}
|
||||
p = strchrW( szProxy, ';' );
|
||||
p = wcschr( szProxy, ';' );
|
||||
if (p) *p = 0;
|
||||
|
||||
FreeProxyInfo( lpwpi );
|
||||
|
@ -830,14 +827,14 @@ static DWORD APPINFO_QueryOption(object_header_t *hdr, DWORD option, void *buffe
|
|||
bufsize = *size;
|
||||
|
||||
if (unicode) {
|
||||
DWORD len = ai->agent ? strlenW(ai->agent) : 0;
|
||||
DWORD len = ai->agent ? lstrlenW(ai->agent) : 0;
|
||||
|
||||
*size = (len + 1) * sizeof(WCHAR);
|
||||
if(!buffer || bufsize < *size)
|
||||
return ERROR_INSUFFICIENT_BUFFER;
|
||||
|
||||
if (ai->agent)
|
||||
strcpyW(buffer, ai->agent);
|
||||
lstrcpyW(buffer, ai->agent);
|
||||
else
|
||||
*(WCHAR *)buffer = 0;
|
||||
/* If the buffer is copied, the returned length doesn't include
|
||||
|
@ -1626,7 +1623,7 @@ static INTERNET_SCHEME GetInternetSchemeW(LPCWSTR lpszScheme, DWORD nMaxCmp)
|
|||
return INTERNET_SCHEME_UNKNOWN;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(url_schemes); i++)
|
||||
if (!strncmpiW(lpszScheme, url_schemes[i], nMaxCmp))
|
||||
if (!wcsnicmp(lpszScheme, url_schemes[i], nMaxCmp))
|
||||
return INTERNET_SCHEME_FIRST + i;
|
||||
|
||||
return INTERNET_SCHEME_UNKNOWN;
|
||||
|
@ -1654,7 +1651,7 @@ BOOL WINAPI InternetCrackUrlW(const WCHAR *lpszUrl, DWORD dwUrlLength, DWORD dwF
|
|||
LPCWSTR lpszcp = NULL, lpszNetLoc;
|
||||
|
||||
TRACE("(%s %u %x %p)\n",
|
||||
lpszUrl ? debugstr_wn(lpszUrl, dwUrlLength ? dwUrlLength : strlenW(lpszUrl)) : "(null)",
|
||||
lpszUrl ? debugstr_wn(lpszUrl, dwUrlLength ? dwUrlLength : lstrlenW(lpszUrl)) : "(null)",
|
||||
dwUrlLength, dwFlags, lpUC);
|
||||
|
||||
if (!lpszUrl || !*lpszUrl || !lpUC)
|
||||
|
@ -1662,7 +1659,7 @@ BOOL WINAPI InternetCrackUrlW(const WCHAR *lpszUrl, DWORD dwUrlLength, DWORD dwF
|
|||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
if (!dwUrlLength) dwUrlLength = strlenW(lpszUrl);
|
||||
if (!dwUrlLength) dwUrlLength = lstrlenW(lpszUrl);
|
||||
|
||||
if (dwFlags & ICU_DECODE)
|
||||
{
|
||||
|
@ -1701,7 +1698,7 @@ BOOL WINAPI InternetCrackUrlW(const WCHAR *lpszUrl, DWORD dwUrlLength, DWORD dwF
|
|||
/* Determine if the URI is absolute. */
|
||||
while (lpszap - lpszUrl < dwUrlLength)
|
||||
{
|
||||
if (isalnumW(*lpszap) || *lpszap == '+' || *lpszap == '.' || *lpszap == '-')
|
||||
if (iswalnum(*lpszap) || *lpszap == '+' || *lpszap == '.' || *lpszap == '-')
|
||||
{
|
||||
lpszap++;
|
||||
continue;
|
||||
|
@ -1728,9 +1725,9 @@ BOOL WINAPI InternetCrackUrlW(const WCHAR *lpszUrl, DWORD dwUrlLength, DWORD dwF
|
|||
lpUC->nPort = INTERNET_INVALID_PORT_NUMBER;
|
||||
|
||||
/* Parse <params> */
|
||||
lpszParam = memchrW(lpszap, '?', dwUrlLength - (lpszap - lpszUrl));
|
||||
lpszParam = wmemchr(lpszap, '?', dwUrlLength - (lpszap - lpszUrl));
|
||||
if(!lpszParam)
|
||||
lpszParam = memchrW(lpszap, '#', dwUrlLength - (lpszap - lpszUrl));
|
||||
lpszParam = wmemchr(lpszap, '#', dwUrlLength - (lpszap - lpszUrl));
|
||||
|
||||
if(!set_url_component(&lpUC->lpszExtraInfo, &lpUC->dwExtraInfoLength,
|
||||
lpszParam, lpszParam ? dwUrlLength-(lpszParam-lpszUrl) : 0))
|
||||
|
@ -1750,7 +1747,7 @@ BOOL WINAPI InternetCrackUrlW(const WCHAR *lpszUrl, DWORD dwUrlLength, DWORD dwF
|
|||
{
|
||||
lpszcp += 2;
|
||||
|
||||
lpszNetLoc = memchrW(lpszcp, '/', dwUrlLength - (lpszcp - lpszUrl));
|
||||
lpszNetLoc = wmemchr(lpszcp, '/', dwUrlLength - (lpszcp - lpszUrl));
|
||||
if (lpszParam)
|
||||
{
|
||||
if (lpszNetLoc)
|
||||
|
@ -1770,7 +1767,7 @@ BOOL WINAPI InternetCrackUrlW(const WCHAR *lpszUrl, DWORD dwUrlLength, DWORD dwF
|
|||
/* [<user>[<:password>]@]<host>[:<port>] */
|
||||
/* First find the user and password if they exist */
|
||||
|
||||
lpszHost = memchrW(lpszcp, '@', dwUrlLength - (lpszcp - lpszUrl));
|
||||
lpszHost = wmemchr(lpszcp, '@', dwUrlLength - (lpszcp - lpszUrl));
|
||||
if (lpszHost == NULL || lpszHost > lpszNetLoc)
|
||||
{
|
||||
/* username and password not specified. */
|
||||
|
@ -1836,7 +1833,7 @@ BOOL WINAPI InternetCrackUrlW(const WCHAR *lpszUrl, DWORD dwUrlLength, DWORD dwF
|
|||
if(!set_url_component(&lpUC->lpszHostName, &lpUC->dwHostNameLength, lpszHost, lpszPort - lpszHost))
|
||||
return FALSE;
|
||||
if (lpszPort != lpszNetLoc)
|
||||
lpUC->nPort = atoiW(++lpszPort);
|
||||
lpUC->nPort = wcstol(++lpszPort, NULL, 10);
|
||||
else switch (lpUC->nScheme)
|
||||
{
|
||||
case INTERNET_SCHEME_HTTP:
|
||||
|
@ -1884,7 +1881,7 @@ BOOL WINAPI InternetCrackUrlW(const WCHAR *lpszUrl, DWORD dwUrlLength, DWORD dwF
|
|||
/* Leave the parameter list in lpszUrlPath. Strip off any trailing
|
||||
* newlines if necessary.
|
||||
*/
|
||||
LPWSTR lpsznewline = memchrW(lpszcp, '\n', dwUrlLength - (lpszcp - lpszUrl));
|
||||
LPWSTR lpsznewline = wmemchr(lpszcp, '\n', dwUrlLength - (lpszcp - lpszUrl));
|
||||
if (lpsznewline != NULL)
|
||||
len = lpsznewline - lpszcp;
|
||||
else
|
||||
|
@ -3364,7 +3361,7 @@ BOOL WINAPI InternetTimeFromSystemTimeW( const SYSTEMTIME* time, DWORD format, L
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
sprintfW( string, date,
|
||||
swprintf( string, size, date,
|
||||
WININET_wkday[time->wDayOfWeek],
|
||||
time->wDay,
|
||||
WININET_month[time->wMonth - 1],
|
||||
|
@ -3415,15 +3412,13 @@ BOOL WINAPI InternetTimeToSystemTimeW( LPCWSTR string, SYSTEMTIME* time, DWORD r
|
|||
* a SYSTEMTIME structure.
|
||||
*/
|
||||
|
||||
while (*s && !isalphaW( *s )) s++;
|
||||
while (*s && !iswalpha( *s )) s++;
|
||||
if (s[0] == '\0' || s[1] == '\0' || s[2] == '\0') return TRUE;
|
||||
time->wDayOfWeek = 7;
|
||||
|
||||
for (i = 0; i < 7; i++)
|
||||
{
|
||||
if (toupperW( WININET_wkday[i][0] ) == toupperW( s[0] ) &&
|
||||
toupperW( WININET_wkday[i][1] ) == toupperW( s[1] ) &&
|
||||
toupperW( WININET_wkday[i][2] ) == toupperW( s[2] ) )
|
||||
if (!wcsnicmp( WININET_wkday[i], s, 3 ))
|
||||
{
|
||||
time->wDayOfWeek = i;
|
||||
break;
|
||||
|
@ -3431,19 +3426,17 @@ BOOL WINAPI InternetTimeToSystemTimeW( LPCWSTR string, SYSTEMTIME* time, DWORD r
|
|||
}
|
||||
|
||||
if (time->wDayOfWeek > 6) return TRUE;
|
||||
while (*s && !isdigitW( *s )) s++;
|
||||
time->wDay = strtolW( s, &end, 10 );
|
||||
while (*s && !iswdigit( *s )) s++;
|
||||
time->wDay = wcstol( s, &end, 10 );
|
||||
s = end;
|
||||
|
||||
while (*s && !isalphaW( *s )) s++;
|
||||
while (*s && !iswalpha( *s )) s++;
|
||||
if (s[0] == '\0' || s[1] == '\0' || s[2] == '\0') return TRUE;
|
||||
time->wMonth = 0;
|
||||
|
||||
for (i = 0; i < 12; i++)
|
||||
{
|
||||
if (toupperW( WININET_month[i][0]) == toupperW( s[0] ) &&
|
||||
toupperW( WININET_month[i][1]) == toupperW( s[1] ) &&
|
||||
toupperW( WININET_month[i][2]) == toupperW( s[2] ) )
|
||||
if (!wcsnicmp( WININET_month[i], s, 3 ))
|
||||
{
|
||||
time->wMonth = i + 1;
|
||||
break;
|
||||
|
@ -3451,24 +3444,24 @@ BOOL WINAPI InternetTimeToSystemTimeW( LPCWSTR string, SYSTEMTIME* time, DWORD r
|
|||
}
|
||||
if (time->wMonth == 0) return TRUE;
|
||||
|
||||
while (*s && !isdigitW( *s )) s++;
|
||||
while (*s && !iswdigit( *s )) s++;
|
||||
if (*s == '\0') return TRUE;
|
||||
time->wYear = strtolW( s, &end, 10 );
|
||||
time->wYear = wcstol( s, &end, 10 );
|
||||
s = end;
|
||||
|
||||
while (*s && !isdigitW( *s )) s++;
|
||||
while (*s && !iswdigit( *s )) s++;
|
||||
if (*s == '\0') return TRUE;
|
||||
time->wHour = strtolW( s, &end, 10 );
|
||||
time->wHour = wcstol( s, &end, 10 );
|
||||
s = end;
|
||||
|
||||
while (*s && !isdigitW( *s )) s++;
|
||||
while (*s && !iswdigit( *s )) s++;
|
||||
if (*s == '\0') return TRUE;
|
||||
time->wMinute = strtolW( s, &end, 10 );
|
||||
time->wMinute = wcstol( s, &end, 10 );
|
||||
s = end;
|
||||
|
||||
while (*s && !isdigitW( *s )) s++;
|
||||
while (*s && !iswdigit( *s )) s++;
|
||||
if (*s == '\0') return TRUE;
|
||||
time->wSecond = strtolW( s, &end, 10 );
|
||||
time->wSecond = wcstol( s, &end, 10 );
|
||||
s = end;
|
||||
|
||||
time->wMilliseconds = 0;
|
||||
|
@ -3643,7 +3636,7 @@ static HINTERNET INTERNET_InternetOpenUrlW(appinfo_t *hIC, LPCWSTR lpszUrl,
|
|||
urlComponents.dwPasswordLength = 1;
|
||||
urlComponents.dwUrlPathLength = 1;
|
||||
urlComponents.dwExtraInfoLength = 1;
|
||||
if(!InternetCrackUrlW(lpszUrl, strlenW(lpszUrl), 0, &urlComponents))
|
||||
if(!InternetCrackUrlW(lpszUrl, lstrlenW(lpszUrl), 0, &urlComponents))
|
||||
return NULL;
|
||||
|
||||
if ((urlComponents.nScheme == INTERNET_SCHEME_HTTP || urlComponents.nScheme == INTERNET_SCHEME_HTTPS) &&
|
||||
|
@ -4191,7 +4184,7 @@ BOOL WINAPI InternetCombineUrlW(LPCWSTR lpszBaseUrl, LPCWSTR lpszRelativeUrl,
|
|||
#define MAX_WORD_DIGITS 5
|
||||
|
||||
#define URL_GET_COMP_LENGTH(url, component) ((url)->dw##component##Length ? \
|
||||
(url)->dw##component##Length : strlenW((url)->lpsz##component))
|
||||
(url)->dw##component##Length : lstrlenW((url)->lpsz##component))
|
||||
#define URL_GET_COMP_LENGTHA(url, component) ((url)->dw##component##Length ? \
|
||||
(url)->dw##component##Length : strlen((url)->lpsz##component))
|
||||
|
||||
|
@ -4263,7 +4256,7 @@ static BOOL calc_url_length(LPURL_COMPONENTSW lpUrlComponents,
|
|||
if (nScheme == INTERNET_SCHEME_DEFAULT)
|
||||
nScheme = INTERNET_SCHEME_HTTP;
|
||||
scheme = INTERNET_GetSchemeString(nScheme);
|
||||
*lpdwUrlLength += strlenW(scheme);
|
||||
*lpdwUrlLength += lstrlenW(scheme);
|
||||
}
|
||||
|
||||
(*lpdwUrlLength)++; /* ':' */
|
||||
|
@ -4454,6 +4447,7 @@ BOOL WINAPI InternetCreateUrlW(LPURL_COMPONENTSW lpUrlComponents, DWORD dwFlags,
|
|||
{
|
||||
DWORD dwLen;
|
||||
INTERNET_SCHEME nScheme;
|
||||
WCHAR *start = lpszUrl;
|
||||
|
||||
static const WCHAR slashSlashW[] = {'/','/'};
|
||||
static const WCHAR fmtW[] = {'%','u',0};
|
||||
|
@ -4498,7 +4492,7 @@ BOOL WINAPI InternetCreateUrlW(LPURL_COMPONENTSW lpUrlComponents, DWORD dwFlags,
|
|||
nScheme = INTERNET_SCHEME_HTTP;
|
||||
|
||||
scheme = INTERNET_GetSchemeString(nScheme);
|
||||
dwLen = strlenW(scheme);
|
||||
dwLen = lstrlenW(scheme);
|
||||
memcpy(lpszUrl, scheme, dwLen * sizeof(WCHAR));
|
||||
lpszUrl += dwLen;
|
||||
}
|
||||
|
@ -4543,7 +4537,7 @@ BOOL WINAPI InternetCreateUrlW(LPURL_COMPONENTSW lpUrlComponents, DWORD dwFlags,
|
|||
{
|
||||
*lpszUrl = ':';
|
||||
lpszUrl++;
|
||||
lpszUrl += sprintfW(lpszUrl, fmtW, lpUrlComponents->nPort);
|
||||
lpszUrl += swprintf(lpszUrl, *lpdwUrlLength - (lpszUrl - start), fmtW, lpUrlComponents->nPort);
|
||||
}
|
||||
|
||||
/* add slash between hostname and path if necessary */
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#ifndef _WINE_INTERNET_H_
|
||||
#define _WINE_INTERNET_H_
|
||||
|
||||
#include "wine/unicode.h"
|
||||
#include "wine/heap.h"
|
||||
#include "wine/list.h"
|
||||
|
||||
|
@ -102,7 +101,7 @@ static inline LPWSTR heap_strdupW(LPCWSTR str)
|
|||
if(str) {
|
||||
DWORD size;
|
||||
|
||||
size = (strlenW(str)+1)*sizeof(WCHAR);
|
||||
size = (lstrlenW(str)+1)*sizeof(WCHAR);
|
||||
ret = heap_alloc(size);
|
||||
if(ret)
|
||||
memcpy(ret, str, size);
|
||||
|
@ -209,7 +208,7 @@ static inline substr_t substr(const WCHAR *str, size_t len)
|
|||
|
||||
static inline substr_t substrz(const WCHAR *str)
|
||||
{
|
||||
return substr(str, strlenW(str));
|
||||
return substr(str, lstrlenW(str));
|
||||
}
|
||||
|
||||
static inline void WININET_find_data_WtoA(LPWIN32_FIND_DATAW dataW, LPWIN32_FIND_DATAA dataA)
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
#ifdef __REACTOS__
|
||||
#define NONAMELESSUNION
|
||||
#include "precomp.h"
|
||||
#else
|
||||
/*
|
||||
* Wininet - networking layer
|
||||
*
|
||||
|
@ -32,7 +36,6 @@
|
|||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "wine/library.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wininet.h"
|
||||
|
@ -40,6 +43,7 @@
|
|||
|
||||
#include "wine/debug.h"
|
||||
#include "internet.h"
|
||||
#endif /* defined(__REACTOS__) */
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(wininet);
|
||||
|
||||
|
|
|
@ -1,60 +1,40 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <wine/config.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#define _INC_WINDOWS
|
||||
#define COM_NO_WINDOWS_H
|
||||
|
||||
#include <kefuncs.h>
|
||||
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
#include <winreg.h>
|
||||
#include <winuser.h>
|
||||
#include <winnls.h>
|
||||
#include <wininet.h>
|
||||
#include <winnetwk.h>
|
||||
|
||||
#define NO_SHLWAPI_STREAM
|
||||
#define NO_SHLWAPI_REG
|
||||
#define NO_SHLWAPI_GDI
|
||||
#include <shlwapi.h>
|
||||
|
||||
#include <wine/debug.h>
|
||||
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <sys/types.h>
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
# include <sys/ioctl.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_POLL_H
|
||||
# include <sys/poll.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined(__MINGW32__) || defined (_MSC_VER)
|
||||
#include <ws2tcpip.h>
|
||||
#else
|
||||
#define closesocket close
|
||||
#define ioctlsocket ioctl
|
||||
#endif /* __MINGW32__ */
|
||||
#include <iphlpapi.h>
|
||||
#include <dhcpcsdk.h>
|
||||
#include <shlobj.h>
|
||||
#include <shellapi.h>
|
||||
|
||||
#include <cryptuiapi.h>
|
||||
|
||||
#include <wine/debug.h>
|
||||
#include <wine/exception.h>
|
||||
|
||||
#include "internet.h"
|
||||
#include "resource.h"
|
||||
|
||||
/* msvcrt/ucrtbase incompatibilities */
|
||||
#define swprintf _snwprintf
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
#ifdef __REACTOS__
|
||||
#define NONAMELESSUNION
|
||||
#define NONAMELESSSTRUCT
|
||||
#include "precomp.h"
|
||||
#else
|
||||
/*
|
||||
* Wininet - Url Cache functions
|
||||
*
|
||||
|
@ -45,9 +50,8 @@
|
|||
#include "shellapi.h"
|
||||
|
||||
#include "internet.h"
|
||||
|
||||
#include "wine/unicode.h"
|
||||
#include "wine/debug.h"
|
||||
#endif /* defined(__REACTOS__) */
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(wininet);
|
||||
|
||||
|
@ -488,8 +492,8 @@ static DWORD cache_container_set_size(cache_container *container, HANDLE file, D
|
|||
urlcache_create_hash_table(header, NULL, &hashtable_entry);
|
||||
|
||||
/* Last step - create the directories */
|
||||
strcpyW(dir_path, container->path);
|
||||
dir_name = dir_path + strlenW(dir_path);
|
||||
lstrcpyW(dir_path, container->path);
|
||||
dir_name = dir_path + lstrlenW(dir_path);
|
||||
dir_name[8] = 0;
|
||||
|
||||
GetSystemTimeAsFileTime(&ft);
|
||||
|
@ -613,8 +617,8 @@ static DWORD cache_container_open_index(cache_container *container, DWORD blocks
|
|||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
strcpyW(index_path, container->path);
|
||||
strcatW(index_path, index_dat);
|
||||
lstrcpyW(index_path, container->path);
|
||||
lstrcatW(index_path, index_dat);
|
||||
|
||||
file = CreateFileW(index_path, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_ALWAYS, 0, NULL);
|
||||
if(file == INVALID_HANDLE_VALUE) {
|
||||
|
@ -763,7 +767,7 @@ static void cache_containers_init(void)
|
|||
const WCHAR *shpath_suffix; /* suffix on path returned by SHGetSpecialFolderPath */
|
||||
const char *cache_prefix; /* prefix used to reference the container */
|
||||
DWORD default_entry_type;
|
||||
} DefaultContainerData[] =
|
||||
} DefaultContainerData[] =
|
||||
{
|
||||
{ CSIDL_INTERNET_CACHE, UrlSuffix, "", NORMAL_CACHE_ENTRY },
|
||||
{ CSIDL_HISTORY, HistorySuffix, "Visited:", URLHISTORY_CACHE_ENTRY },
|
||||
|
@ -790,8 +794,8 @@ static void cache_containers_init(void)
|
|||
ERR("Couldn't get path for default container %u\n", i);
|
||||
continue;
|
||||
}
|
||||
path_len = strlenW(wszCachePath);
|
||||
suffix_len = strlenW(DefaultContainerData[i].shpath_suffix);
|
||||
path_len = lstrlenW(wszCachePath);
|
||||
suffix_len = lstrlenW(DefaultContainerData[i].shpath_suffix);
|
||||
|
||||
if (path_len + suffix_len + 2 > MAX_PATH)
|
||||
{
|
||||
|
@ -802,8 +806,8 @@ static void cache_containers_init(void)
|
|||
wszCachePath[path_len] = '\\';
|
||||
wszCachePath[path_len+1] = 0;
|
||||
|
||||
strcpyW(wszMutexName, wszCachePath);
|
||||
|
||||
lstrcpyW(wszMutexName, wszCachePath);
|
||||
|
||||
if (suffix_len)
|
||||
{
|
||||
memcpy(wszCachePath + path_len + 1, DefaultContainerData[i].shpath_suffix, (suffix_len + 1) * sizeof(WCHAR));
|
||||
|
@ -974,7 +978,7 @@ static urlcache_header* cache_container_lock_index(cache_container *pContainer)
|
|||
{
|
||||
TRACE("Directory[%d] = \"%.8s\"\n", index, pHeader->directory_data[index].name);
|
||||
}
|
||||
|
||||
|
||||
return pHeader;
|
||||
}
|
||||
|
||||
|
@ -1011,7 +1015,7 @@ static BOOL urlcache_create_file_pathW(
|
|||
BOOL trunc_name)
|
||||
{
|
||||
LONG nRequired;
|
||||
int path_len = strlenW(pContainer->path);
|
||||
int path_len = lstrlenW(pContainer->path);
|
||||
int file_name_len = MultiByteToWideChar(CP_ACP, 0, szLocalFileName, -1, NULL, 0);
|
||||
if (Directory!=CACHE_CONTAINER_NO_SUBDIR && Directory>=pHeader->dirs_no)
|
||||
{
|
||||
|
@ -1468,7 +1472,7 @@ static DWORD urlcache_hash_key(LPCSTR lpszKey)
|
|||
/* NOTE: this uses the same lookup table as SHLWAPI.UrlHash{A,W}
|
||||
* but the algorithm and result are not the same!
|
||||
*/
|
||||
static const unsigned char lookupTable[256] =
|
||||
static const unsigned char lookupTable[256] =
|
||||
{
|
||||
0x01, 0x0E, 0x6E, 0x19, 0x61, 0xAE, 0x84, 0x77,
|
||||
0x8A, 0xAA, 0x7D, 0x76, 0x1B, 0xE9, 0x8C, 0x33,
|
||||
|
@ -1749,10 +1753,10 @@ static BOOL cache_container_delete_dir(LPCWSTR lpszPath)
|
|||
SHFILEOPSTRUCTW shfos;
|
||||
int ret;
|
||||
|
||||
path_len = strlenW(lpszPath);
|
||||
path_len = lstrlenW(lpszPath);
|
||||
if (path_len >= MAX_PATH)
|
||||
return FALSE;
|
||||
strcpyW(path, lpszPath);
|
||||
lstrcpyW(path, lpszPath);
|
||||
path[path_len + 1] = 0; /* double-NUL-terminate path */
|
||||
|
||||
shfos.hwnd = NULL;
|
||||
|
@ -2358,7 +2362,7 @@ static DWORD urlcache_rate_entry(entry_url *url_entry, FILETIME *cur_time)
|
|||
return rating;
|
||||
}
|
||||
|
||||
static int dword_cmp(const void *p1, const void *p2)
|
||||
static int __cdecl dword_cmp(const void *p1, const void *p2)
|
||||
{
|
||||
return *(const DWORD*)p1 - *(const DWORD*)p2;
|
||||
}
|
||||
|
@ -2394,7 +2398,7 @@ BOOL WINAPI FreeUrlCacheSpaceW(LPCWSTR cache_path, DWORD size, DWORD filter)
|
|||
}
|
||||
|
||||
if(cache_path) {
|
||||
path_len = strlenW(cache_path);
|
||||
path_len = lstrlenW(cache_path);
|
||||
if(cache_path[path_len-1] == '\\')
|
||||
path_len--;
|
||||
}else {
|
||||
|
@ -2406,7 +2410,7 @@ BOOL WINAPI FreeUrlCacheSpaceW(LPCWSTR cache_path, DWORD size, DWORD filter)
|
|||
{
|
||||
/* When cache_path==NULL only clean Temporary Internet Files */
|
||||
if((!path_len && container->cache_prefix[0]==0) ||
|
||||
(path_len && !strncmpiW(container->path, cache_path, path_len) &&
|
||||
(path_len && !wcsnicmp(container->path, cache_path, path_len) &&
|
||||
(container->path[path_len]=='\0' || container->path[path_len]=='\\')))
|
||||
{
|
||||
BOOL ret_del;
|
||||
|
@ -2439,7 +2443,7 @@ BOOL WINAPI FreeUrlCacheSpaceW(LPCWSTR cache_path, DWORD size, DWORD filter)
|
|||
FILETIME cur_time;
|
||||
|
||||
if((path_len || container->cache_prefix[0]!=0) &&
|
||||
(!path_len || strncmpiW(container->path, cache_path, path_len) ||
|
||||
(!path_len || wcsnicmp(container->path, cache_path, path_len) ||
|
||||
(container->path[path_len]!='\0' && container->path[path_len]!='\\')))
|
||||
continue;
|
||||
|
||||
|
@ -2774,7 +2778,7 @@ static BOOL urlcache_entry_create(const char *url, const char *ext, WCHAR *full_
|
|||
|
||||
/* Try to generate random name */
|
||||
GetSystemTimeAsFileTime(&ft);
|
||||
strcpyW(full_path+full_path_len+8, extW);
|
||||
lstrcpyW(full_path+full_path_len+8, extW);
|
||||
|
||||
for(i=0; i<255; i++) {
|
||||
int j;
|
||||
|
@ -2930,7 +2934,7 @@ static BOOL urlcache_entry_commit(const char *url, const WCHAR *file_name,
|
|||
if(file_name) {
|
||||
BOOL bFound = FALSE;
|
||||
|
||||
if(strncmpW(file_name, container->path, lstrlenW(container->path))) {
|
||||
if(wcsncmp(file_name, container->path, lstrlenW(container->path))) {
|
||||
ERR("path %s must begin with cache content path %s\n", debugstr_w(file_name), debugstr_w(container->path));
|
||||
cache_container_unlock_index(container, header);
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
|
|
|
@ -51,7 +51,7 @@ time_t ConvertTimeString(LPCWSTR asctime)
|
|||
WCHAR tmpChar[TIME_STRING_LEN];
|
||||
WCHAR *tmpChar2;
|
||||
struct tm t;
|
||||
int timelen = strlenW(asctime);
|
||||
int timelen = lstrlenW(asctime);
|
||||
|
||||
if(!timelen)
|
||||
return 0;
|
||||
|
@ -61,7 +61,7 @@ time_t ConvertTimeString(LPCWSTR asctime)
|
|||
lstrcpynW(tmpChar, asctime, TIME_STRING_LEN);
|
||||
|
||||
/* Assert that the string is the expected length */
|
||||
if (strlenW(asctime) >= TIME_STRING_LEN) FIXME("\n");
|
||||
if (lstrlenW(asctime) >= TIME_STRING_LEN) FIXME("\n");
|
||||
|
||||
/* Convert a time such as 'Mon, 15 Nov 1999 16:09:35 GMT' into a SYSTEMTIME structure
|
||||
* We assume the time is in this format
|
||||
|
@ -76,11 +76,11 @@ time_t ConvertTimeString(LPCWSTR asctime)
|
|||
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);
|
||||
t.tm_min = atoiW(tmpChar+20);
|
||||
t.tm_sec = atoiW(tmpChar+23);
|
||||
t.tm_year = wcstol(tmpChar+12, NULL, 10) - 1900;
|
||||
t.tm_mday = wcstol(tmpChar+5, NULL, 10);
|
||||
t.tm_hour = wcstol(tmpChar+17, NULL, 10);
|
||||
t.tm_min = wcstol(tmpChar+20, NULL, 10);
|
||||
t.tm_sec = wcstol(tmpChar+23, NULL, 10);
|
||||
|
||||
/* and month */
|
||||
tmpChar2 = tmpChar + 8;
|
||||
|
|
|
@ -5,4 +5,4 @@ files:
|
|||
include/wininet.h: sdk/include/psdk/wininet.h
|
||||
include/winineti.h: sdk/include/psdk/winineti.h
|
||||
tags:
|
||||
wine: cee281a036cf5e9017d5a25e0cbe75c2bcd2c146
|
||||
wine: 3c31cc5836026b45a40818ec874bbbcc4d6ad982
|
||||
|
|
Loading…
Reference in a new issue