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
6617c19c
Commit
6617c19c
authored
Mar 07, 2011
by
Juan Lang
Committed by
Alexandre Julliard
Mar 10, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Treat times of 0 as a special value.
parent
9a45cfc5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
9 deletions
+32
-9
urlcache.c
dlls/wininet/tests/urlcache.c
+1
-1
urlcache.c
dlls/wininet/urlcache.c
+31
-8
No files found.
dlls/wininet/tests/urlcache.c
View file @
6617c19c
...
...
@@ -257,7 +257,6 @@ static void test_urlcacheA(void)
lpCacheEntryInfo
=
HeapAlloc
(
GetProcessHeap
(),
0
,
cbCacheEntryInfo
);
ret
=
GetUrlCacheEntryInfo
(
TEST_URL1
,
lpCacheEntryInfo
,
&
cbCacheEntryInfo
);
ok
(
ret
,
"GetUrlCacheEntryInfo failed with error %d
\n
"
,
GetLastError
());
todo_wine
ok
(
!
memcmp
(
&
lpCacheEntryInfo
->
ExpireTime
,
&
filetime_zero
,
sizeof
(
FILETIME
)),
"expected zero ExpireTime
\n
"
);
ok
(
!
memcmp
(
&
lpCacheEntryInfo
->
LastModifiedTime
,
&
filetime_zero
,
sizeof
(
FILETIME
)),
...
...
@@ -282,6 +281,7 @@ static void test_urlcacheA(void)
ret
=
GetUrlCacheEntryInfo
(
TEST_URL1
,
lpCacheEntryInfo
,
&
cbCacheEntryInfo
);
ok
(
ret
,
"GetUrlCacheEntryInfo failed with error %d
\n
"
,
GetLastError
());
/* but it does change the time.. */
todo_wine
ok
(
memcmp
(
&
lpCacheEntryInfo
->
ExpireTime
,
&
filetime_zero
,
sizeof
(
FILETIME
)),
"expected positive ExpireTime
\n
"
);
todo_wine
...
...
dlls/wininet/urlcache.c
View file @
6617c19c
...
...
@@ -927,6 +927,18 @@ static BOOL URLCache_LocalFileNameToPathA(
return
FALSE
;
}
/* Just like DosDateTimeToFileTime, except that it also maps the special
* case of a DOS date/time of (0,0) to a filetime of (0,0).
*/
static
void
URLCache_DosDateTimeToFileTime
(
WORD
fatdate
,
WORD
fattime
,
FILETIME
*
ft
)
{
if
(
!
fatdate
&&
!
fattime
)
ft
->
dwLowDateTime
=
ft
->
dwHighDateTime
=
0
;
else
DosDateTimeToFileTime
(
fatdate
,
fattime
,
ft
);
}
/***********************************************************************
* URLCache_CopyEntry (Internal)
*
...
...
@@ -962,12 +974,12 @@ static DWORD URLCache_CopyEntry(
lpCacheEntryInfo
->
dwSizeLow
=
pUrlEntry
->
size
.
u
.
LowPart
;
lpCacheEntryInfo
->
dwStructSize
=
sizeof
(
*
lpCacheEntryInfo
);
lpCacheEntryInfo
->
dwUseCount
=
pUrlEntry
->
dwUseCount
;
DosDateTimeToFileTime
(
pUrlEntry
->
wExpiredDate
,
pUrlEntry
->
wExpiredTime
,
&
lpCacheEntryInfo
->
ExpireTime
);
URLCache_
DosDateTimeToFileTime
(
pUrlEntry
->
wExpiredDate
,
pUrlEntry
->
wExpiredTime
,
&
lpCacheEntryInfo
->
ExpireTime
);
lpCacheEntryInfo
->
LastAccessTime
.
dwHighDateTime
=
pUrlEntry
->
LastAccessTime
.
dwHighDateTime
;
lpCacheEntryInfo
->
LastAccessTime
.
dwLowDateTime
=
pUrlEntry
->
LastAccessTime
.
dwLowDateTime
;
lpCacheEntryInfo
->
LastModifiedTime
.
dwHighDateTime
=
pUrlEntry
->
LastModifiedTime
.
dwHighDateTime
;
lpCacheEntryInfo
->
LastModifiedTime
.
dwLowDateTime
=
pUrlEntry
->
LastModifiedTime
.
dwLowDateTime
;
DosDateTimeToFileTime
(
pUrlEntry
->
wLastSyncDate
,
pUrlEntry
->
wLastSyncTime
,
&
lpCacheEntryInfo
->
LastSyncTime
);
URLCache_
DosDateTimeToFileTime
(
pUrlEntry
->
wLastSyncDate
,
pUrlEntry
->
wLastSyncTime
,
&
lpCacheEntryInfo
->
LastSyncTime
);
}
if
((
dwRequiredSize
%
4
)
&&
(
dwRequiredSize
<
*
lpdwBufferSize
))
...
...
@@ -1057,6 +1069,17 @@ static DWORD URLCache_CopyEntry(
return
ERROR_SUCCESS
;
}
/* Just like FileTimeToDosDateTime, except that it also maps the special
* case of a filetime of (0,0) to a DOS date/time of (0,0).
*/
static
void
URLCache_FileTimeToDosDateTime
(
const
FILETIME
*
ft
,
WORD
*
fatdate
,
WORD
*
fattime
)
{
if
(
!
ft
->
dwLowDateTime
&&
!
ft
->
dwHighDateTime
)
*
fatdate
=
*
fattime
=
0
;
else
FileTimeToDosDateTime
(
ft
,
fatdate
,
fattime
);
}
/***********************************************************************
* URLCache_SetEntryInfo (Internal)
...
...
@@ -1078,7 +1101,7 @@ static DWORD URLCache_SetEntryInfo(URL_CACHEFILE_ENTRY * pUrlEntry, const INTERN
if
(
dwFieldControl
&
CACHE_ENTRY_EXEMPT_DELTA_FC
)
pUrlEntry
->
dwExemptDelta
=
lpCacheEntryInfo
->
u
.
dwExemptDelta
;
if
(
dwFieldControl
&
CACHE_ENTRY_EXPTIME_FC
)
FileTimeToDosDateTime
(
&
lpCacheEntryInfo
->
ExpireTime
,
&
pUrlEntry
->
wExpiredDate
,
&
pUrlEntry
->
wExpiredTime
);
URLCache_
FileTimeToDosDateTime
(
&
lpCacheEntryInfo
->
ExpireTime
,
&
pUrlEntry
->
wExpiredDate
,
&
pUrlEntry
->
wExpiredTime
);
if
(
dwFieldControl
&
CACHE_ENTRY_HEADERINFO_FC
)
FIXME
(
"CACHE_ENTRY_HEADERINFO_FC unimplemented
\n
"
);
if
(
dwFieldControl
&
CACHE_ENTRY_HITRATE_FC
)
...
...
@@ -1086,7 +1109,7 @@ static DWORD URLCache_SetEntryInfo(URL_CACHEFILE_ENTRY * pUrlEntry, const INTERN
if
(
dwFieldControl
&
CACHE_ENTRY_MODTIME_FC
)
pUrlEntry
->
LastModifiedTime
=
lpCacheEntryInfo
->
LastModifiedTime
;
if
(
dwFieldControl
&
CACHE_ENTRY_SYNCTIME_FC
)
FileTimeToDosDateTime
(
&
lpCacheEntryInfo
->
LastAccessTime
,
&
pUrlEntry
->
wLastSyncDate
,
&
pUrlEntry
->
wLastSyncTime
);
URLCache_
FileTimeToDosDateTime
(
&
lpCacheEntryInfo
->
LastAccessTime
,
&
pUrlEntry
->
wLastSyncDate
,
&
pUrlEntry
->
wLastSyncTime
);
return
ERROR_SUCCESS
;
}
...
...
@@ -2599,8 +2622,8 @@ static BOOL CommitUrlCacheEntryInternal(
pUrlEntry
->
dwUseCount
=
0
;
GetSystemTimeAsFileTime
(
&
pUrlEntry
->
LastAccessTime
);
pUrlEntry
->
LastModifiedTime
=
LastModifiedTime
;
FileTimeToDosDateTime
(
&
pUrlEntry
->
LastAccessTime
,
&
pUrlEntry
->
wLastSyncDate
,
&
pUrlEntry
->
wLastSyncTime
);
FileTimeToDosDateTime
(
&
ExpireTime
,
&
pUrlEntry
->
wExpiredDate
,
&
pUrlEntry
->
wExpiredTime
);
URLCache_
FileTimeToDosDateTime
(
&
pUrlEntry
->
LastAccessTime
,
&
pUrlEntry
->
wLastSyncDate
,
&
pUrlEntry
->
wLastSyncTime
);
URLCache_
FileTimeToDosDateTime
(
&
ExpireTime
,
&
pUrlEntry
->
wExpiredDate
,
&
pUrlEntry
->
wExpiredTime
);
pUrlEntry
->
wUnknownDate
=
pUrlEntry
->
wLastSyncDate
;
pUrlEntry
->
wUnknownTime
=
pUrlEntry
->
wLastSyncTime
;
...
...
@@ -3671,7 +3694,7 @@ BOOL WINAPI IsUrlCacheEntryExpiredA( LPCSTR url, DWORD dwFlags, FILETIME* pftLas
pUrlEntry
=
(
const
URL_CACHEFILE_ENTRY
*
)
pEntry
;
DosDateTimeToFileTime
(
pUrlEntry
->
wExpiredDate
,
pUrlEntry
->
wExpiredTime
,
pftLastModified
);
URLCache_
DosDateTimeToFileTime
(
pUrlEntry
->
wExpiredDate
,
pUrlEntry
->
wExpiredTime
,
pftLastModified
);
URLCacheContainer_UnlockIndex
(
pContainer
,
pHeader
);
...
...
@@ -3733,7 +3756,7 @@ BOOL WINAPI IsUrlCacheEntryExpiredW( LPCWSTR url, DWORD dwFlags, FILETIME* pftLa
pUrlEntry
=
(
const
URL_CACHEFILE_ENTRY
*
)
pEntry
;
DosDateTimeToFileTime
(
pUrlEntry
->
wExpiredDate
,
pUrlEntry
->
wExpiredTime
,
pftLastModified
);
URLCache_
DosDateTimeToFileTime
(
pUrlEntry
->
wExpiredDate
,
pUrlEntry
->
wExpiredTime
,
pftLastModified
);
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