Piotr Caban : wininet: Support Punycode in DeleteUrlCacheEntryW.

Alexandre Julliard julliard at winehq.org
Mon Apr 1 13:48:42 CDT 2013


Module: wine
Branch: master
Commit: 2f3f9739234946ac9b1e518f75033eb42854945d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2f3f9739234946ac9b1e518f75033eb42854945d

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Mon Apr  1 13:16:24 2013 +0200

wininet: Support Punycode in DeleteUrlCacheEntryW.

---

 dlls/wininet/urlcache.c |   51 +++-------------------------------------------
 1 files changed, 4 insertions(+), 47 deletions(-)

diff --git a/dlls/wininet/urlcache.c b/dlls/wininet/urlcache.c
index 23ff308..0d8c9aa 100644
--- a/dlls/wininet/urlcache.c
+++ b/dlls/wininet/urlcache.c
@@ -3477,57 +3477,14 @@ BOOL WINAPI DeleteUrlCacheEntryA(LPCSTR lpszUrlName)
  */
 BOOL WINAPI DeleteUrlCacheEntryW(LPCWSTR lpszUrlName)
 {
-    cache_container *pContainer;
-    urlcache_header *pHeader;
-    struct hash_entry *pHashEntry;
-    LPSTR urlA;
-    DWORD error;
+    char *url;
     BOOL ret;
 
-    TRACE("(%s)\n", debugstr_w(lpszUrlName));
-
-    urlA = heap_strdupWtoA(lpszUrlName);
-    if (!urlA)
-    {
-        SetLastError(ERROR_OUTOFMEMORY);
-        return FALSE;
-    }
-
-    error = cache_containers_findW(lpszUrlName, &pContainer);
-    if (error != ERROR_SUCCESS)
-    {
-        heap_free(urlA);
-        SetLastError(error);
-        return FALSE;
-    }
-
-    error = cache_container_open_index(pContainer, MIN_BLOCK_NO);
-    if (error != ERROR_SUCCESS)
-    {
-        heap_free(urlA);
-        SetLastError(error);
-        return FALSE;
-    }
-
-    if (!(pHeader = cache_container_lock_index(pContainer)))
-    {
-        heap_free(urlA);
-        return FALSE;
-    }
-
-    if (!urlcache_find_hash_entry(pHeader, urlA, &pHashEntry))
-    {
-        cache_container_unlock_index(pContainer, pHeader);
-        TRACE("entry %s not found!\n", debugstr_a(urlA));
-        heap_free(urlA);
-        SetLastError(ERROR_FILE_NOT_FOUND);
+    if(!urlcache_encode_url_alloc(lpszUrlName, &url))
         return FALSE;
-    }
 
-    ret = urlcache_entry_delete(pContainer, pHeader, pHashEntry);
-
-    cache_container_unlock_index(pContainer, pHeader);
-    heap_free(urlA);
+    ret = DeleteUrlCacheEntryA(url);
+    heap_free(url);
     return ret;
 }
 




More information about the wine-cvs mailing list