Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
3c31cc58
Commit
3c31cc58
authored
Nov 25, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Build with msvcrt.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cee281a0
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
64 additions
and
70 deletions
+64
-70
Makefile.in
dlls/wininet/Makefile.in
+2
-0
cookie.c
dlls/wininet/cookie.c
+22
-21
dialogs.c
dlls/wininet/dialogs.c
+9
-12
ftp.c
dlls/wininet/ftp.c
+6
-6
gopher.c
dlls/wininet/gopher.c
+0
-2
http.c
dlls/wininet/http.c
+0
-0
internet.c
dlls/wininet/internet.c
+0
-0
internet.h
dlls/wininet/internet.h
+2
-3
netconnection.c
dlls/wininet/netconnection.c
+0
-1
urlcache.c
dlls/wininet/urlcache.c
+16
-18
utility.c
dlls/wininet/utility.c
+7
-7
No files found.
dlls/wininet/Makefile.in
View file @
3c31cc58
...
...
@@ -4,6 +4,8 @@ IMPORTLIB = wininet
IMPORTS
=
mpr shlwapi shell32 user32 ws2_32 advapi32
DELAYIMPORTS
=
secur32 crypt32 cryptui dhcpcsvc iphlpapi
EXTRADLLFLAGS
=
-mno-cygwin
C_SRCS
=
\
cookie.c
\
dialogs.c
\
...
...
dlls/wininet/cookie.c
View file @
3c31cc58
...
...
@@ -27,6 +27,7 @@
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <wchar.h>
#include "windef.h"
#include "winbase.h"
...
...
@@ -173,7 +174,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
]
=
to
lowerW
(
path
.
str
[
i
]);
p
[
i
]
=
to
wlower
(
path
.
str
[
i
]);
p
[
path
.
len
]
=
0
;
ret_path
->
str
=
p
;
...
...
@@ -194,7 +195,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 +266,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 +295,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 +604,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
+=
l
strlenW
(
cookie_iter
->
name
);
if
(
*
cookie_iter
->
data
)
res
->
string_len
+=
1
/* = */
+
strlenW
(
cookie_iter
->
data
);
res
->
string_len
+=
1
/* = */
+
l
strlenW
(
cookie_iter
->
data
);
}
}
}
...
...
@@ -624,13 +625,13 @@ static void cookie_set_to_string(const cookie_set_t *cookie_set, WCHAR *str)
*
ptr
++
=
' '
;
}
len
=
strlenW
(
cookie_set
->
cookies
[
i
]
->
name
);
len
=
l
strlenW
(
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
=
l
strlenW
(
cookie_set
->
cookies
[
i
]
->
data
);
memcpy
(
ptr
,
cookie_set
->
cookies
[
i
]
->
data
,
len
*
sizeof
(
WCHAR
));
ptr
+=
len
;
}
...
...
@@ -872,11 +873,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 +925,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 +950,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 +964,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 +987,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 +1000,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 +1099,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
+
l
strlenW
(
lpCookieData
);
name
=
substr
(
lpCookieData
,
ptr
-
lpCookieData
);
data
=
substrz
(
*
ptr
==
'='
?
ptr
+
1
:
ptr
);
...
...
dlls/wininet/dialogs.c
View file @
3c31cc58
...
...
@@ -35,9 +35,6 @@
#include "cryptuiapi.h"
#include "internet.h"
#include "wine/unicode.h"
#include "resource.h"
#define MAX_STRING_LEN 1024
...
...
@@ -78,8 +75,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
,
l
strlenW
(
szRealm
)
)
)
{
ERR
(
"response wrong? (%s)
\n
"
,
debugstr_w
(
szBuf
));
return
FALSE
;
...
...
@@ -90,11 +87,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
);
l
strcpyW
(
szBuf
,
p
);
return
TRUE
;
}
...
...
@@ -137,11 +134,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
=
l
strlenW
(
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
=
(
l
strlenW
(
szResource
)
+
1
)
*
sizeof
(
WCHAR
);
u_len
=
(
l
strlenW
(
szUserPass
)
+
1
)
*
sizeof
(
WCHAR
);
r
=
WNetCachePassword
(
(
CHAR
*
)
szResource
,
r_len
,
(
CHAR
*
)
szUserPass
,
u_len
,
dwMagic
,
0
);
...
...
@@ -149,13 +146,13 @@ static BOOL WININET_GetSetPassword( HWND hdlg, LPCWSTR szServer,
}
sz
=
sizeof
szUserPass
;
r_len
=
(
strlenW
(
szResource
)
+
1
)
*
sizeof
(
WCHAR
);
r_len
=
(
l
strlenW
(
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
;
...
...
dlls/wininet/ftp.c
View file @
3c31cc58
...
...
@@ -834,8 +834,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
);
...
...
@@ -2480,7 +2480,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 +2497,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
);
l
strcpyW
(
szPassword
,
szEmpty
);
}
}
RegCloseKey
(
key
);
...
...
@@ -2525,7 +2525,7 @@ HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
}
INTERNET_SendCallback
(
&
hIC
->
hdr
,
dwContext
,
INTERNET_STATUS_RESOLVING_NAME
,
(
LPWSTR
)
lpszServerName
,
(
strlenW
(
lpszServerName
)
+
1
)
*
sizeof
(
WCHAR
));
(
LPWSTR
)
lpszServerName
,
(
l
strlenW
(
lpszServerName
)
+
1
)
*
sizeof
(
WCHAR
));
sock_namelen
=
sizeof
(
socketAddr
);
if
(
!
GetAddress
(
lpszServerName
,
lpwfs
->
serverport
,
(
struct
sockaddr
*
)
&
socketAddr
,
&
sock_namelen
,
szaddr
))
...
...
@@ -3098,7 +3098,7 @@ static BOOL FTP_SendPort(ftp_session_t *lpwfs)
BOOL
bSuccess
=
FALSE
;
TRACE
(
"
\n
"
);
s
printfW
(
szIPAddress
,
szIPFormat
,
s
wprintf
(
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
,
...
...
dlls/wininet/gopher.c
View file @
3c31cc58
...
...
@@ -18,8 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdarg.h>
#include "windef.h"
...
...
dlls/wininet/http.c
View file @
3c31cc58
This diff is collapsed.
Click to expand it.
dlls/wininet/internet.c
View file @
3c31cc58
This diff is collapsed.
Click to expand it.
dlls/wininet/internet.h
View file @
3c31cc58
...
...
@@ -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
=
(
l
strlenW
(
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
,
l
strlenW
(
str
));
}
static
inline
void
WININET_find_data_WtoA
(
LPWIN32_FIND_DATAW
dataW
,
LPWIN32_FIND_DATAA
dataA
)
...
...
dlls/wininet/netconnection.c
View file @
3c31cc58
...
...
@@ -32,7 +32,6 @@
#include <stdio.h>
#include <assert.h>
#include "wine/library.h"
#include "windef.h"
#include "winbase.h"
#include "wininet.h"
...
...
dlls/wininet/urlcache.c
View file @
3c31cc58
...
...
@@ -45,8 +45,6 @@
#include "shellapi.h"
#include "internet.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
wininet
);
...
...
@@ -486,8 +484,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
);
l
strcpyW
(
dir_path
,
container
->
path
);
dir_name
=
dir_path
+
l
strlenW
(
dir_path
);
dir_name
[
8
]
=
0
;
GetSystemTimeAsFileTime
(
&
ft
);
...
...
@@ -611,8 +609,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
);
l
strcpyW
(
index_path
,
container
->
path
);
l
strcatW
(
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
)
{
...
...
@@ -779,8 +777,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
=
l
strlenW
(
wszCachePath
);
suffix_len
=
l
strlenW
(
DefaultContainerData
[
i
].
shpath_suffix
);
if
(
path_len
+
suffix_len
+
2
>
MAX_PATH
)
{
...
...
@@ -791,7 +789,7 @@ static void cache_containers_init(void)
wszCachePath
[
path_len
]
=
'\\'
;
wszCachePath
[
path_len
+
1
]
=
0
;
strcpyW
(
wszMutexName
,
wszCachePath
);
l
strcpyW
(
wszMutexName
,
wszCachePath
);
if
(
suffix_len
)
{
...
...
@@ -984,7 +982,7 @@ static BOOL urlcache_create_file_pathW(
BOOL
trunc_name
)
{
LONG
nRequired
;
int
path_len
=
strlenW
(
pContainer
->
path
);
int
path_len
=
l
strlenW
(
pContainer
->
path
);
int
file_name_len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szLocalFileName
,
-
1
,
NULL
,
0
);
if
(
Directory
!=
CACHE_CONTAINER_NO_SUBDIR
&&
Directory
>=
pHeader
->
dirs_no
)
{
...
...
@@ -1722,10 +1720,10 @@ static BOOL cache_container_delete_dir(LPCWSTR lpszPath)
SHFILEOPSTRUCTW
shfos
;
int
ret
;
path_len
=
strlenW
(
lpszPath
);
path_len
=
l
strlenW
(
lpszPath
);
if
(
path_len
>=
MAX_PATH
)
return
FALSE
;
strcpyW
(
path
,
lpszPath
);
l
strcpyW
(
path
,
lpszPath
);
path
[
path_len
+
1
]
=
0
;
/* double-NUL-terminate path */
shfos
.
hwnd
=
NULL
;
...
...
@@ -2331,7 +2329,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
;
}
...
...
@@ -2367,7 +2365,7 @@ BOOL WINAPI FreeUrlCacheSpaceW(LPCWSTR cache_path, DWORD size, DWORD filter)
}
if
(
cache_path
)
{
path_len
=
strlenW
(
cache_path
);
path_len
=
l
strlenW
(
cache_path
);
if
(
cache_path
[
path_len
-
1
]
==
'\\'
)
path_len
--
;
}
else
{
...
...
@@ -2379,7 +2377,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
;
...
...
@@ -2412,7 +2410,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
;
...
...
@@ -2747,7 +2745,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
);
l
strcpyW
(
full_path
+
full_path_len
+
8
,
extW
);
for
(
i
=
0
;
i
<
255
;
i
++
)
{
int
j
;
...
...
@@ -2903,7 +2901,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
);
...
...
dlls/wininet/utility.c
View file @
3c31cc58
...
...
@@ -46,7 +46,7 @@ time_t ConvertTimeString(LPCWSTR asctime)
WCHAR
tmpChar
[
TIME_STRING_LEN
];
WCHAR
*
tmpChar2
;
struct
tm
t
;
int
timelen
=
strlenW
(
asctime
);
int
timelen
=
l
strlenW
(
asctime
);
if
(
!
timelen
)
return
0
;
...
...
@@ -56,7 +56,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
(
l
strlenW
(
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
...
...
@@ -71,11 +71,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
+
2
0
);
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
,
1
0
);
t
.
tm_sec
=
wcstol
(
tmpChar
+
23
,
NULL
,
10
);
/* and month */
tmpChar2
=
tmpChar
+
8
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment