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
359ed338
Commit
359ed338
authored
Sep 18, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Sep 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Delete file when cache entry is deleted.
parent
7967f8be
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
11 deletions
+13
-11
urlcache.c
dlls/wininet/tests/urlcache.c
+0
-5
urlcache.c
dlls/wininet/urlcache.c
+13
-6
No files found.
dlls/wininet/tests/urlcache.c
View file @
359ed338
...
...
@@ -481,7 +481,6 @@ static void test_urlcacheA(void)
SetLastError
(
0xdeadbeef
);
ret
=
DeleteFile
(
filenameA
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"local file should no longer exist
\n
"
);
/* Creating two entries with the same URL */
...
...
@@ -537,7 +536,6 @@ static void test_urlcacheA(void)
{
ret
=
pDeleteUrlCacheEntryA
(
TEST_URL
);
ok
(
ret
,
"DeleteUrlCacheEntryA failed with error %d
\n
"
,
GetLastError
());
todo_wine
check_file_not_exists
(
filenameA
);
todo_wine
check_file_not_exists
(
filenameA1
);
...
...
@@ -595,7 +593,6 @@ static void test_urlcacheA(void)
/* By unlocking the already-deleted cache entry, the file associated
* with it is deleted..
*/
todo_wine
check_file_not_exists
(
filenameA
);
/* (just in case, delete file) */
DeleteFileA
(
filenameA
);
...
...
@@ -692,7 +689,6 @@ static void test_urlcacheA(void)
ret
=
pDeleteUrlCacheEntryA
(
TEST_URL
);
ok
(
ret
,
"DeleteUrlCacheEntryA failed with error %d
\n
"
,
GetLastError
());
/* When explicitly deleting the cache entry, the file is also deleted */
todo_wine
check_file_not_exists
(
filenameA
);
}
/* Test once again, setting the exempt delta via SetUrlCacheEntryInfo */
...
...
@@ -760,7 +756,6 @@ static void test_urlcacheA(void)
{
ret
=
pDeleteUrlCacheEntryA
(
TEST_URL
);
ok
(
ret
,
"DeleteUrlCacheEntryA failed with error %d
\n
"
,
GetLastError
());
todo_wine
check_file_not_exists
(
filenameA
);
}
}
...
...
dlls/wininet/urlcache.c
View file @
359ed338
...
...
@@ -2175,11 +2175,13 @@ BOOL WINAPI RetrieveUrlCacheEntryFileW(
return
TRUE
;
}
static
BOOL
DeleteUrlCacheEntryInternal
(
LPURLCACHE_HEADER
pHead
er
,
struct
_HASH_ENTRY
*
pHashEntry
)
static
BOOL
DeleteUrlCacheEntryInternal
(
const
URLCACHECONTAINER
*
pContain
er
,
LPURLCACHE_HEADER
pHeader
,
struct
_HASH_ENTRY
*
pHashEntry
)
{
CACHEFILE_ENTRY
*
pEntry
;
URL_CACHEFILE_ENTRY
*
pUrlEntry
;
WCHAR
path
[
MAX_PATH
];
LONG
path_size
=
sizeof
(
path
);
pEntry
=
(
CACHEFILE_ENTRY
*
)((
LPBYTE
)
pHeader
+
pHashEntry
->
dwOffsetEntry
);
if
(
pEntry
->
dwSignature
!=
URL_SIGNATURE
)
...
...
@@ -2220,8 +2222,13 @@ static BOOL DeleteUrlCacheEntryInternal(LPURLCACHE_HEADER pHeader,
pHeader
->
CacheUsage
.
QuadPart
=
0
;
}
URLCache_DeleteEntry
(
pHeader
,
pEntry
);
if
(
pUrlEntry
->
dwOffsetLocalName
&&
URLCache_LocalFileNameToPathW
(
pContainer
,
pHeader
,
(
LPCSTR
)
pUrlEntry
+
pUrlEntry
->
dwOffsetLocalName
,
pUrlEntry
->
CacheDir
,
path
,
&
path_size
))
{
DeleteFileW
(
path
);
}
URLCache_DeleteEntry
(
pHeader
,
pEntry
);
URLCache_DeleteEntryFromHash
(
pHashEntry
);
return
TRUE
;
}
...
...
@@ -2297,7 +2304,7 @@ BOOL WINAPI UnlockUrlCacheEntryFileA(
{
URLCache_HashEntrySetFlags
(
pHashEntry
,
HASHTABLE_URL
);
if
(
pUrlEntry
->
CacheEntryType
&
PENDING_DELETE_CACHE_ENTRY
)
DeleteUrlCacheEntryInternal
(
pHeader
,
pHashEntry
);
DeleteUrlCacheEntryInternal
(
p
Container
,
p
Header
,
pHashEntry
);
}
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
...
...
@@ -3241,7 +3248,7 @@ BOOL WINAPI DeleteUrlCacheEntryA(LPCSTR lpszUrlName)
return
FALSE
;
}
ret
=
DeleteUrlCacheEntryInternal
(
pHeader
,
pHashEntry
);
ret
=
DeleteUrlCacheEntryInternal
(
p
Container
,
p
Header
,
pHashEntry
);
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
...
...
@@ -3301,7 +3308,7 @@ BOOL WINAPI DeleteUrlCacheEntryW(LPCWSTR lpszUrlName)
return
FALSE
;
}
ret
=
DeleteUrlCacheEntryInternal
(
pHeader
,
pHashEntry
);
ret
=
DeleteUrlCacheEntryInternal
(
p
Container
,
p
Header
,
pHashEntry
);
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
heap_free
(
urlA
);
...
...
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