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
dba38b1a
Commit
dba38b1a
authored
Sep 19, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Sep 19, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Define more fields in urlcache header structure.
parent
f833ac75
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
urlcache.c
dlls/wininet/urlcache.c
+8
-7
No files found.
dlls/wininet/urlcache.c
View file @
dba38b1a
...
...
@@ -62,6 +62,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wininet);
#define ENTRY_START_OFFSET 0x4000
#define DIR_LENGTH 8
#define MAX_DIR_NO 0x20
#define BLOCKSIZE 128
#define HASHTABLE_SIZE 448
#define HASHTABLE_NUM_ENTRIES 64
/* this needs to be power of 2, that divides HASHTABLE_SIZE */
...
...
@@ -167,8 +168,10 @@ typedef struct _URLCACHE_HEADER
ULARGE_INTEGER
CacheLimit
;
ULARGE_INTEGER
CacheUsage
;
ULARGE_INTEGER
ExemptUsage
;
DWORD
DirectoryCount
;
/* number of directory_data's */
DIRECTORY_DATA
directory_data
[
1
];
/* first directory entry */
DWORD
DirectoryCount
;
DIRECTORY_DATA
directory_data
[
MAX_DIR_NO
];
DWORD
options
[
0x21
];
BYTE
allocation_table
[
ALLOCATION_TABLE_SIZE
];
}
URLCACHE_HEADER
,
*
LPURLCACHE_HEADER
;
typedef
const
URLCACHE_HEADER
*
LPCURLCACHE_HEADER
;
...
...
@@ -850,7 +853,6 @@ static inline void URLCache_Allocation_BlockAllocate(BYTE * AllocationTable, DWO
*/
static
DWORD
URLCache_FindFirstFreeEntry
(
URLCACHE_HEADER
*
pHeader
,
DWORD
dwBlocksNeeded
,
CACHEFILE_ENTRY
**
ppEntry
)
{
LPBYTE
AllocationTable
=
(
LPBYTE
)
pHeader
+
ALLOCATION_TABLE_OFFSET
;
DWORD
dwBlockNumber
;
DWORD
dwFreeCounter
;
for
(
dwBlockNumber
=
0
;
dwBlockNumber
<
pHeader
->
dwIndexCapacityInBlocks
;
dwBlockNumber
++
)
...
...
@@ -858,7 +860,7 @@ static DWORD URLCache_FindFirstFreeEntry(URLCACHE_HEADER * pHeader, DWORD dwBloc
for
(
dwFreeCounter
=
0
;
dwFreeCounter
<
dwBlocksNeeded
&&
dwFreeCounter
+
dwBlockNumber
<
pHeader
->
dwIndexCapacityInBlocks
&&
URLCache_Allocation_BlockIsFree
(
AllocationT
able
,
dwBlockNumber
+
dwFreeCounter
);
URLCache_Allocation_BlockIsFree
(
pHeader
->
allocation_t
able
,
dwBlockNumber
+
dwFreeCounter
);
dwFreeCounter
++
)
TRACE
(
"Found free block at no. %d (0x%x)
\n
"
,
dwBlockNumber
,
ENTRY_START_OFFSET
+
dwBlockNumber
*
BLOCKSIZE
);
...
...
@@ -867,7 +869,7 @@ static DWORD URLCache_FindFirstFreeEntry(URLCACHE_HEADER * pHeader, DWORD dwBloc
DWORD
index
;
TRACE
(
"Found free blocks starting at no. %d (0x%x)
\n
"
,
dwBlockNumber
,
ENTRY_START_OFFSET
+
dwBlockNumber
*
BLOCKSIZE
);
for
(
index
=
0
;
index
<
dwBlocksNeeded
;
index
++
)
URLCache_Allocation_BlockAllocate
(
AllocationT
able
,
dwBlockNumber
+
index
);
URLCache_Allocation_BlockAllocate
(
pHeader
->
allocation_t
able
,
dwBlockNumber
+
index
);
*
ppEntry
=
(
CACHEFILE_ENTRY
*
)((
LPBYTE
)
pHeader
+
ENTRY_START_OFFSET
+
dwBlockNumber
*
BLOCKSIZE
);
for
(
index
=
0
;
index
<
dwBlocksNeeded
*
BLOCKSIZE
/
sizeof
(
DWORD
);
index
++
)
((
DWORD
*
)
*
ppEntry
)[
index
]
=
0xdeadbeef
;
...
...
@@ -893,12 +895,11 @@ static BOOL URLCache_DeleteEntry(LPURLCACHE_HEADER pHeader, CACHEFILE_ENTRY * pE
{
DWORD
dwStartBlock
;
DWORD
dwBlock
;
BYTE
*
AllocationTable
=
(
LPBYTE
)
pHeader
+
ALLOCATION_TABLE_OFFSET
;
/* update allocation table */
dwStartBlock
=
((
DWORD
)((
BYTE
*
)
pEntry
-
(
BYTE
*
)
pHeader
)
-
ENTRY_START_OFFSET
)
/
BLOCKSIZE
;
for
(
dwBlock
=
dwStartBlock
;
dwBlock
<
dwStartBlock
+
pEntry
->
dwBlocksUsed
;
dwBlock
++
)
URLCache_Allocation_BlockFree
(
AllocationT
able
,
dwBlock
);
URLCache_Allocation_BlockFree
(
pHeader
->
allocation_t
able
,
dwBlock
);
return
TRUE
;
}
...
...
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