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
2ceb0524
Commit
2ceb0524
authored
Dec 31, 2005
by
Robert Shearman
Committed by
Alexandre Julliard
Dec 31, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Move URL cache hash table creation to a separate function.
parent
3a04ff68
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
33 deletions
+32
-33
urlcache.c
dlls/wininet/urlcache.c
+32
-33
No files found.
dlls/wininet/urlcache.c
View file @
2ceb0524
...
@@ -179,7 +179,7 @@ typedef struct _URLCACHECONTAINER
...
@@ -179,7 +179,7 @@ typedef struct _URLCACHECONTAINER
/* List of all containers available */
/* List of all containers available */
static
struct
list
UrlContainers
=
LIST_INIT
(
UrlContainers
);
static
struct
list
UrlContainers
=
LIST_INIT
(
UrlContainers
);
static
BOOL
URLCache_FindFirstFreeEntry
(
URLCACHE_HEADER
*
pHeader
,
DWORD
dwBlocksNeeded
,
CACHEFILE_ENTRY
**
ppEntry
);
static
HASH_CACHEFILE_ENTRY
*
URLCache_CreateHashTable
(
LPURLCACHE_HEADER
pHeader
,
HASH_CACHEFILE_ENTRY
*
pPrevHash
);
/***********************************************************************
/***********************************************************************
* URLCache_PathToObjectName (Internal)
* URLCache_PathToObjectName (Internal)
...
@@ -297,7 +297,6 @@ static BOOL URLCacheContainer_OpenIndex(URLCACHECONTAINER * pContainer)
...
@@ -297,7 +297,6 @@ static BOOL URLCacheContainer_OpenIndex(URLCACHECONTAINER * pContainer)
WCHAR
wszDirPath
[
MAX_PATH
];
WCHAR
wszDirPath
[
MAX_PATH
];
FILETIME
ft
;
FILETIME
ft
;
int
i
,
j
;
int
i
,
j
;
HASH_CACHEFILE_ENTRY
*
pPrevHash
=
0
;
dwFileSize
=
NEWFILE_SIZE
;
dwFileSize
=
NEWFILE_SIZE
;
...
@@ -328,37 +327,7 @@ static BOOL URLCacheContainer_OpenIndex(URLCACHECONTAINER * pContainer)
...
@@ -328,37 +327,7 @@ static BOOL URLCacheContainer_OpenIndex(URLCACHECONTAINER * pContainer)
RegCloseKey
(
key
);
RegCloseKey
(
key
);
}
}
/* Now create the hash table entries. Windows would create
URLCache_CreateHashTable
(
pHeader
,
NULL
);
* these as needed, but WINE doesn't do that yet, so create
* four and hope it's enough.
*/
for
(
i
=
0
;
i
<
4
;
++
i
)
{
HASH_CACHEFILE_ENTRY
*
pHash
;
DWORD
dwOffset
;
/* Request 0x20 blocks - no need to check for failure here because
* we started with an empty file
*/
URLCache_FindFirstFreeEntry
(
pHeader
,
0x20
,
(
CACHEFILE_ENTRY
**
)
&
pHash
);
dwOffset
=
(
BYTE
*
)
pHash
-
(
BYTE
*
)
pHeader
;
if
(
pPrevHash
)
pPrevHash
->
dwAddressNext
=
dwOffset
;
else
pHeader
->
dwOffsetFirstHashTable
=
dwOffset
;
pHash
->
CacheFileEntry
.
dwSignature
=
HASH_SIGNATURE
;
pHash
->
CacheFileEntry
.
dwBlocksUsed
=
0x20
;
pHash
->
dwHashTableNumber
=
i
;
for
(
j
=
0
;
j
<
HASHTABLE_SIZE
;
++
j
)
{
pHash
->
HashTable
[
j
].
dwOffsetEntry
=
0
;
pHash
->
HashTable
[
j
].
dwHashKey
=
HASHTABLE_FREE
;
}
pPrevHash
=
pHash
;
}
/* Last step - create the directories */
/* Last step - create the directories */
...
@@ -1307,6 +1276,36 @@ static BOOL URLCache_AddEntryToHash(LPCURLCACHE_HEADER pHeader, LPCSTR lpszUrl,
...
@@ -1307,6 +1276,36 @@ static BOOL URLCache_AddEntryToHash(LPCURLCACHE_HEADER pHeader, LPCSTR lpszUrl,
return
FALSE
;
return
FALSE
;
}
}
static
HASH_CACHEFILE_ENTRY
*
URLCache_CreateHashTable
(
LPURLCACHE_HEADER
pHeader
,
HASH_CACHEFILE_ENTRY
*
pPrevHash
)
{
HASH_CACHEFILE_ENTRY
*
pHash
;
DWORD
dwOffset
;
int
i
;
if
(
!
URLCache_FindFirstFreeEntry
(
pHeader
,
0x20
,
(
CACHEFILE_ENTRY
**
)
&
pHash
))
{
FIXME
(
"no free space for hash table
\n
"
);
SetLastError
(
ERROR_DISK_FULL
);
return
NULL
;
}
dwOffset
=
(
BYTE
*
)
pHash
-
(
BYTE
*
)
pHeader
;
if
(
pPrevHash
)
pPrevHash
->
dwAddressNext
=
dwOffset
;
else
pHeader
->
dwOffsetFirstHashTable
=
dwOffset
;
pHash
->
CacheFileEntry
.
dwSignature
=
HASH_SIGNATURE
;
pHash
->
CacheFileEntry
.
dwBlocksUsed
=
0x20
;
pHash
->
dwHashTableNumber
=
pPrevHash
?
pPrevHash
->
dwHashTableNumber
+
1
:
0
;
for
(
i
=
0
;
i
<
HASHTABLE_SIZE
;
i
++
)
{
pHash
->
HashTable
[
i
].
dwOffsetEntry
=
0
;
pHash
->
HashTable
[
i
].
dwHashKey
=
HASHTABLE_FREE
;
}
return
pHash
;
}
/***********************************************************************
/***********************************************************************
* GetUrlCacheEntryInfoExA (WININET.@)
* GetUrlCacheEntryInfoExA (WININET.@)
*
*
...
...
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