Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
78835843
Commit
78835843
authored
Sep 24, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Sep 24, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Added support for cache path parameter in FreeUrlCacheSpace function.
parent
71511c9f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
+21
-9
urlcache.c
dlls/wininet/urlcache.c
+21
-9
No files found.
dlls/wininet/urlcache.c
View file @
78835843
...
...
@@ -2413,7 +2413,7 @@ static int dword_cmp(const void *p1, const void *p2)
BOOL
WINAPI
FreeUrlCacheSpaceW
(
LPCWSTR
cache_path
,
DWORD
size
,
DWORD
filter
)
{
URLCACHECONTAINER
*
container
;
DWORD
err
;
DWORD
path_len
,
err
;
TRACE
(
"(%s, %x, %x)
\n
"
,
debugstr_w
(
cache_path
),
size
,
filter
);
...
...
@@ -2423,16 +2423,20 @@ BOOL WINAPI FreeUrlCacheSpaceW(LPCWSTR cache_path, DWORD size, DWORD filter)
}
if
(
cache_path
)
{
FIXME
(
"cache_path != NULL not supported yet
\n
"
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
FALSE
;
path_len
=
strlenW
(
cache_path
);
if
(
cache_path
[
path_len
-
1
]
==
'\\'
)
path_len
--
;
}
else
{
path_len
=
0
;
}
if
(
size
==
100
&&
!
filter
)
{
LIST_FOR_EACH_ENTRY
(
container
,
&
UrlContainers
,
URLCACHECONTAINER
,
entry
)
{
/* The URL cache has prefix L"" (unlike Cookies and History) */
if
(
container
->
cache_prefix
[
0
]
==
0
)
/* 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
)
&&
(
container
->
path
[
path_len
]
==
'\0'
||
container
->
path
[
path_len
]
==
'\\'
)))
{
BOOL
ret_del
;
...
...
@@ -2444,9 +2448,12 @@ BOOL WINAPI FreeUrlCacheSpaceW(LPCWSTR cache_path, DWORD size, DWORD filter)
err
=
URLCacheContainer_OpenIndex
(
container
,
MIN_BLOCK_NO
);
ReleaseMutex
(
container
->
hMutex
);
return
ret_del
&&
(
err
==
ERROR_SUCCESS
);
if
(
!
ret_del
||
(
err
!=
ERROR_SUCCESS
))
return
FALSE
;
}
}
return
TRUE
;
}
LIST_FOR_EACH_ENTRY
(
container
,
&
UrlContainers
,
URLCACHECONTAINER
,
entry
)
...
...
@@ -2460,6 +2467,11 @@ BOOL WINAPI FreeUrlCacheSpaceW(LPCWSTR cache_path, DWORD size, DWORD filter)
DWORD
rate
[
100
],
rate_no
;
FILETIME
cur_time
;
if
((
path_len
||
container
->
cache_prefix
[
0
]
!=
0
)
&&
(
!
path_len
||
strncmpiW
(
container
->
path
,
cache_path
,
path_len
)
||
(
container
->
path
[
path_len
]
!=
'\0'
&&
container
->
path
[
path_len
]
!=
'\\'
)))
continue
;
err
=
URLCacheContainer_OpenIndex
(
container
,
MIN_BLOCK_NO
);
if
(
err
!=
ERROR_SUCCESS
)
continue
;
...
...
@@ -2555,12 +2567,12 @@ BOOL WINAPI FreeUrlCacheSpaceW(LPCWSTR cache_path, DWORD size, DWORD filter)
*
* See FreeUrlCacheSpaceW.
*/
BOOL
WINAPI
FreeUrlCacheSpaceA
(
LPCSTR
lpszCachePath
,
DWORD
dwSize
,
DWORD
dw
SizeType
)
BOOL
WINAPI
FreeUrlCacheSpaceA
(
LPCSTR
lpszCachePath
,
DWORD
dwSize
,
DWORD
dw
Filter
)
{
BOOL
ret
=
FALSE
;
LPWSTR
path
=
heap_strdupAtoW
(
lpszCachePath
);
if
(
lpszCachePath
==
NULL
||
path
!=
NULL
)
ret
=
FreeUrlCacheSpaceW
(
path
,
dwSize
,
dw
SizeType
);
ret
=
FreeUrlCacheSpaceW
(
path
,
dwSize
,
dw
Filter
);
heap_free
(
path
);
return
ret
;
}
...
...
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