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
fa19e1bd
Commit
fa19e1bd
authored
Mar 02, 2011
by
Alexander Scott-Johns
Committed by
Alexandre Julliard
Mar 11, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Partially implement FreeUrlCacheSpaceW.
parent
0c33f1dd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
99 additions
and
10 deletions
+99
-10
urlcache.c
dlls/wininet/urlcache.c
+89
-10
wininet.h
include/wininet.h
+10
-0
No files found.
dlls/wininet/urlcache.c
View file @
fa19e1bd
...
...
@@ -48,10 +48,12 @@
#include "wininet.h"
#include "winineti.h"
#include "winerror.h"
#include "internet.h"
#include "winreg.h"
#include "shlwapi.h"
#include "shlobj.h"
#include "shellapi.h"
#include "internet.h"
#include "wine/unicode.h"
#include "wine/debug.h"
...
...
@@ -1460,28 +1462,105 @@ static BOOL URLCache_EnumHashTableEntries(LPCURLCACHE_HEADER pHeader, const HASH
}
/***********************************************************************
* FreeUrlCacheSpaceA (WININET.@)
* URLCache_DeleteCacheDirectory (Internal)
*
* Erase a directory containing an URL cache.
*
* RETURNS
* TRUE success, FALSE failure/aborted.
*
*/
BOOL
WINAPI
FreeUrlCacheSpaceA
(
LPCSTR
lpszCachePath
,
DWORD
dwSize
,
DWORD
dwFilter
)
static
BOOL
URLCache_DeleteCacheDirectory
(
LPCWSTR
lpszPath
)
{
FIXME
(
"stub!
\n
"
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
FALSE
;
DWORD
path_len
;
WCHAR
path
[
MAX_PATH
+
1
];
SHFILEOPSTRUCTW
shfos
;
int
ret
;
path_len
=
strlenW
(
lpszPath
);
if
(
path_len
>=
MAX_PATH
)
return
FALSE
;
strcpyW
(
path
,
lpszPath
);
path
[
path_len
+
1
]
=
0
;
/* double-NUL-terminate path */
shfos
.
hwnd
=
NULL
;
shfos
.
wFunc
=
FO_DELETE
;
shfos
.
pFrom
=
path
;
shfos
.
pTo
=
NULL
;
shfos
.
fFlags
=
0
;
shfos
.
fAnyOperationsAborted
=
FALSE
;
ret
=
SHFileOperationW
(
&
shfos
);
if
(
ret
)
ERR
(
"SHFileOperationW on %s returned %i
\n
"
,
debugstr_w
(
path
),
ret
);
return
!
(
ret
||
shfos
.
fAnyOperationsAborted
);
}
/***********************************************************************
/***********************************************************************
* FreeUrlCacheSpaceW (WININET.@)
*
* Frees up some cache.
*
* PARAMETERS
* lpszCachePath [I] Which volume to free up from, or NULL if you don't care.
* dwSize [I] How much space to free up.
* dwSizeType [I] How to interpret dwSize.
*
* RETURNS
* TRUE success. FALSE failure.
*
* IMPLEMENTATION
* This implementation just retrieves the path of the cache directory, and
* deletes its contents from the filesystem. The correct approach would
* probably be to implement and use {FindFirst,FindNext,Delete}UrlCacheGroup().
*/
BOOL
WINAPI
FreeUrlCacheSpaceW
(
LPCWSTR
lpszCachePath
,
DWORD
dwSize
,
DWORD
dw
Filter
)
BOOL
WINAPI
FreeUrlCacheSpaceW
(
LPCWSTR
lpszCachePath
,
DWORD
dwSize
,
DWORD
dw
SizeType
)
{
FIXME
(
"stub!
\n
"
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
URLCACHECONTAINER
*
pContainer
;
if
(
lpszCachePath
!=
NULL
||
dwSize
!=
100
||
dwSizeType
!=
FCS_PERCENT_CACHE_SPACE
)
{
FIXME
(
"(%s, %x, %x): partial stub!
\n
"
,
debugstr_w
(
lpszCachePath
),
dwSize
,
dwSizeType
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
FALSE
;
}
LIST_FOR_EACH_ENTRY
(
pContainer
,
&
UrlContainers
,
URLCACHECONTAINER
,
entry
)
{
/* The URL cache has prefix L"" (unlike Cookies and History) */
if
(
pContainer
->
cache_prefix
[
0
]
==
0
)
{
BOOL
ret_del
;
DWORD
ret_open
;
WaitForSingleObject
(
pContainer
->
hMutex
,
INFINITE
);
/* unlock, delete, recreate and lock cache */
URLCacheContainer_CloseIndex
(
pContainer
);
ret_del
=
URLCache_DeleteCacheDirectory
(
pContainer
->
path
);
ret_open
=
URLCacheContainer_OpenIndex
(
pContainer
);
ReleaseMutex
(
pContainer
->
hMutex
);
return
ret_del
&&
(
ret_open
==
ERROR_SUCCESS
);
}
}
return
FALSE
;
}
/***********************************************************************
* FreeUrlCacheSpaceA (WININET.@)
*
* See FreeUrlCacheSpaceW.
*/
BOOL
WINAPI
FreeUrlCacheSpaceA
(
LPCSTR
lpszCachePath
,
DWORD
dwSize
,
DWORD
dwSizeType
)
{
BOOL
ret
=
FALSE
;
LPWSTR
path
=
heap_strdupAtoW
(
lpszCachePath
);
if
(
lpszCachePath
==
NULL
||
path
!=
NULL
)
ret
=
FreeUrlCacheSpaceW
(
path
,
dwSize
,
dwSizeType
);
heap_free
(
path
);
return
ret
;
}
/***********************************************************************
* GetUrlCacheEntryInfoExA (WININET.@)
*
*/
...
...
include/wininet.h
View file @
fa19e1bd
...
...
@@ -1660,6 +1660,16 @@ BOOLAPI DeleteUrlCacheEntryA(LPCSTR);
BOOLAPI
DeleteUrlCacheEntryW
(
LPCWSTR
);
#define DeleteUrlCacheEntry WINELIB_NAME_AW(DeleteUrlCacheEntry)
/* FCS_ flags and FreeUrlCacheSpace are no longer documented */
#define FCS_PERCENT_CACHE_SPACE 0
/* guessed value */
#define FCS_PERCENT_DISK_SPACE 1
/* guessed value */
#define FCS_ABSOLUTE_SIZE 2
/* guessed value */
BOOLAPI
FreeUrlCacheSpaceA
(
LPCSTR
,
DWORD
,
DWORD
);
BOOLAPI
FreeUrlCacheSpaceW
(
LPCWSTR
,
DWORD
,
DWORD
);
#define FreeUrlCacheSpace WINELIB_NAME_AW(FreeUrlCacheSpace)
INTERNETAPI
DWORD
WINAPI
InternetDialA
(
HWND
,
LPSTR
,
DWORD
,
DWORD_PTR
*
,
DWORD
);
INTERNETAPI
DWORD
WINAPI
InternetDialW
(
HWND
,
LPWSTR
,
DWORD
,
DWORD_PTR
*
,
DWORD
);
#define InternetDial WINELIB_NAME_AW(InternetDial)
...
...
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