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
d1ecb6d9
Commit
d1ecb6d9
authored
Apr 05, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Apr 06, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Don't delete locked entry in DeleteUrlCacheEntry.
parent
06c1f255
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
urlcache.c
dlls/wininet/tests/urlcache.c
+0
-5
urlcache.c
dlls/wininet/urlcache.c
+14
-0
No files found.
dlls/wininet/tests/urlcache.c
View file @
d1ecb6d9
...
...
@@ -571,9 +571,7 @@ static void test_urlcacheA(void)
if
(
pDeleteUrlCacheEntryA
)
{
ret
=
pDeleteUrlCacheEntryA
(
TEST_URL
);
todo_wine
ok
(
!
ret
,
"Expected failure
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_SHARING_VIOLATION
,
"Expected ERROR_SHARING_VIOLATION, got %d
\n
"
,
GetLastError
());
check_file_exists
(
filenameA
);
...
...
@@ -582,9 +580,7 @@ static void test_urlcacheA(void)
lpCacheEntryInfo
=
HeapAlloc
(
GetProcessHeap
(),
0
,
cbCacheEntryInfo
);
memset
(
lpCacheEntryInfo
,
0
,
cbCacheEntryInfo
);
ret
=
GetUrlCacheEntryInfo
(
TEST_URL
,
lpCacheEntryInfo
,
&
cbCacheEntryInfo
);
todo_wine
ok
(
ret
,
"GetUrlCacheEntryInfo failed with error %d
\n
"
,
GetLastError
());
todo_wine
ok
(
lpCacheEntryInfo
->
CacheEntryType
&
DELETED_CACHE_ENTRY
,
"CacheEntryType hasn't DELETED_CACHE_ENTRY set, (flags %08x)
\n
"
,
lpCacheEntryInfo
->
CacheEntryType
);
...
...
@@ -594,7 +590,6 @@ static void test_urlcacheA(void)
{
check_file_exists
(
filenameA
);
ret
=
pUnlockUrlCacheEntryFileA
(
TEST_URL
,
0
);
todo_wine
ok
(
ret
,
"UnlockUrlCacheEntryFileA failed: %d
\n
"
,
GetLastError
());
/* By unlocking the already-deleted cache entry, the file associated
* with it is deleted..
...
...
dlls/wininet/urlcache.c
View file @
d1ecb6d9
...
...
@@ -2139,7 +2139,17 @@ static BOOL DeleteUrlCacheEntryInternal(LPURLCACHE_HEADER pHeader,
SetLastError
(
ERROR_FILE_NOT_FOUND
);
return
FALSE
;
}
pUrlEntry
=
(
URL_CACHEFILE_ENTRY
*
)
pEntry
;
if
((
pHashEntry
->
dwHashKey
&
((
1
<<
HASHTABLE_FLAG_BITS
)
-
1
))
==
HASHTABLE_LOCK
)
{
/* FIXME: implement timeout object unlocking */
TRACE
(
"Trying to delete locked entry
\n
"
);
pUrlEntry
->
CacheEntryType
|=
DELETED_CACHE_ENTRY
;
SetLastError
(
ERROR_SHARING_VIOLATION
);
return
FALSE
;
}
if
(
pUrlEntry
->
CacheDir
<
pHeader
->
DirectoryCount
)
{
if
(
pHeader
->
directory_data
[
pUrlEntry
->
CacheDir
].
dwNumFiles
)
...
...
@@ -2234,7 +2244,11 @@ BOOL WINAPI UnlockUrlCacheEntryFileA(
}
pUrlEntry
->
dwUseCount
--
;
if
(
!
pUrlEntry
->
dwUseCount
)
{
URLCache_HashEntrySetFlags
(
pHashEntry
,
HASHTABLE_URL
);
if
(
pUrlEntry
->
CacheEntryType
&
DELETED_CACHE_ENTRY
)
DeleteUrlCacheEntryInternal
(
pHeader
,
pHashEntry
);
}
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
...
...
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