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
20ed414d
Commit
20ed414d
authored
Dec 22, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Store file time as a SYSTEMTIME instead of a Unix struct tm.
parent
0fbd5569
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
42 deletions
+36
-42
ftp.c
dlls/wininet/ftp.c
+36
-42
No files found.
dlls/wininet/ftp.c
View file @
20ed414d
...
@@ -94,7 +94,7 @@ typedef struct
...
@@ -94,7 +94,7 @@ typedef struct
BOOL
bIsDirectory
;
BOOL
bIsDirectory
;
LPWSTR
lpszName
;
LPWSTR
lpszName
;
DWORD
nSize
;
DWORD
nSize
;
struct
tm
tmLastModified
;
SYSTEMTIME
tmLastModified
;
unsigned
short
permissions
;
unsigned
short
permissions
;
}
FILEPROPERTIESW
,
*
LPFILEPROPERTIESW
;
}
FILEPROPERTIESW
,
*
LPFILEPROPERTIESW
;
...
@@ -3386,9 +3386,7 @@ static BOOL FTP_ConvertFileProp(LPFILEPROPERTIESW lpafp, LPWIN32_FIND_DATAW lpFi
...
@@ -3386,9 +3386,7 @@ static BOOL FTP_ConvertFileProp(LPFILEPROPERTIESW lpafp, LPWIN32_FIND_DATAW lpFi
if
(
lpafp
)
if
(
lpafp
)
{
{
/* Convert 'Unix' time to Windows time */
SystemTimeToFileTime
(
&
lpafp
->
tmLastModified
,
&
lpFindFileData
->
ftLastAccessTime
);
RtlSecondsSince1970ToTime
(
mktime
(
&
lpafp
->
tmLastModified
),
(
LARGE_INTEGER
*
)
&
(
lpFindFileData
->
ftLastAccessTime
));
lpFindFileData
->
ftLastWriteTime
=
lpFindFileData
->
ftLastAccessTime
;
lpFindFileData
->
ftLastWriteTime
=
lpFindFileData
->
ftLastAccessTime
;
lpFindFileData
->
ftCreationTime
=
lpFindFileData
->
ftLastAccessTime
;
lpFindFileData
->
ftCreationTime
=
lpFindFileData
->
ftLastAccessTime
;
...
@@ -3456,12 +3454,12 @@ static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERT
...
@@ -3456,12 +3454,12 @@ static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERT
lpfp
->
nSize
=
atol
(
pszToken
);
lpfp
->
nSize
=
atol
(
pszToken
);
}
}
lpfp
->
tmLastModified
.
tm_sec
=
0
;
lpfp
->
tmLastModified
.
wSecond
=
0
;
lpfp
->
tmLastModified
.
tm_min
=
0
;
lpfp
->
tmLastModified
.
wMinute
=
0
;
lpfp
->
tmLastModified
.
tm_hour
=
0
;
lpfp
->
tmLastModified
.
wHour
=
0
;
lpfp
->
tmLastModified
.
tm_mday
=
0
;
lpfp
->
tmLastModified
.
wDay
=
0
;
lpfp
->
tmLastModified
.
tm_mon
=
0
;
lpfp
->
tmLastModified
.
wMonth
=
0
;
lpfp
->
tmLastModified
.
tm_year
=
0
;
lpfp
->
tmLastModified
.
wYear
=
0
;
/* Determine month */
/* Determine month */
pszToken
=
strtok
(
NULL
,
szSpace
);
pszToken
=
strtok
(
NULL
,
szSpace
);
...
@@ -3469,34 +3467,31 @@ static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERT
...
@@ -3469,34 +3467,31 @@ static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERT
if
(
strlen
(
pszToken
)
>=
3
)
{
if
(
strlen
(
pszToken
)
>=
3
)
{
pszToken
[
3
]
=
0
;
pszToken
[
3
]
=
0
;
if
((
pszTmp
=
StrStrIA
(
szMonths
,
pszToken
)))
if
((
pszTmp
=
StrStrIA
(
szMonths
,
pszToken
)))
lpfp
->
tmLastModified
.
tm_mon
=
((
pszTmp
-
szMonths
)
/
3
)
+
1
;
lpfp
->
tmLastModified
.
wMonth
=
((
pszTmp
-
szMonths
)
/
3
)
+
1
;
}
}
/* Determine day */
/* Determine day */
pszToken
=
strtok
(
NULL
,
szSpace
);
pszToken
=
strtok
(
NULL
,
szSpace
);
if
(
!
pszToken
)
continue
;
if
(
!
pszToken
)
continue
;
lpfp
->
tmLastModified
.
tm_md
ay
=
atoi
(
pszToken
);
lpfp
->
tmLastModified
.
wD
ay
=
atoi
(
pszToken
);
/* Determine time or year */
/* Determine time or year */
pszToken
=
strtok
(
NULL
,
szSpace
);
pszToken
=
strtok
(
NULL
,
szSpace
);
if
(
!
pszToken
)
continue
;
if
(
!
pszToken
)
continue
;
if
((
pszTmp
=
strchr
(
pszToken
,
':'
)))
{
if
((
pszTmp
=
strchr
(
pszToken
,
':'
)))
{
struct
tm
*
apTM
;
SYSTEMTIME
curr_time
;
time_t
aTime
;
*
pszTmp
=
0
;
*
pszTmp
=
0
;
pszTmp
++
;
pszTmp
++
;
lpfp
->
tmLastModified
.
tm_min
=
atoi
(
pszTmp
);
lpfp
->
tmLastModified
.
wMinute
=
atoi
(
pszTmp
);
lpfp
->
tmLastModified
.
tm_hour
=
atoi
(
pszToken
);
lpfp
->
tmLastModified
.
wHour
=
atoi
(
pszToken
);
time
(
&
aTime
);
GetLocalTime
(
&
curr_time
);
apTM
=
localtime
(
&
aTime
);
lpfp
->
tmLastModified
.
wYear
=
curr_time
.
wYear
;
lpfp
->
tmLastModified
.
tm_year
=
apTM
->
tm_year
;
}
}
else
{
else
{
lpfp
->
tmLastModified
.
tm_year
=
atoi
(
pszToken
)
-
1900
;
lpfp
->
tmLastModified
.
wYear
=
atoi
(
pszToken
)
;
lpfp
->
tmLastModified
.
tm_h
our
=
12
;
lpfp
->
tmLastModified
.
wH
our
=
12
;
}
}
TRACE
(
"Mod time: %02d:%02d:%02d %02d/%02d/%02d
\n
"
,
TRACE
(
"Mod time: %02d:%02d:%02d %04d/%02d/%02d
\n
"
,
lpfp
->
tmLastModified
.
tm_hour
,
lpfp
->
tmLastModified
.
tm_min
,
lpfp
->
tmLastModified
.
tm_sec
,
lpfp
->
tmLastModified
.
wHour
,
lpfp
->
tmLastModified
.
wMinute
,
lpfp
->
tmLastModified
.
wSecond
,
(
lpfp
->
tmLastModified
.
tm_year
>=
100
)
?
lpfp
->
tmLastModified
.
tm_year
-
100
:
lpfp
->
tmLastModified
.
tm_year
,
lpfp
->
tmLastModified
.
wYear
,
lpfp
->
tmLastModified
.
wMonth
,
lpfp
->
tmLastModified
.
wDay
);
lpfp
->
tmLastModified
.
tm_mon
,
lpfp
->
tmLastModified
.
tm_mday
);
pszToken
=
strtok
(
NULL
,
szSpace
);
pszToken
=
strtok
(
NULL
,
szSpace
);
if
(
!
pszToken
)
continue
;
if
(
!
pszToken
)
continue
;
...
@@ -3509,32 +3504,31 @@ static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERT
...
@@ -3509,32 +3504,31 @@ static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERT
05-09-03 06:02PM 12656686 2003-04-21bgm_cmd_e.rgz
05-09-03 06:02PM 12656686 2003-04-21bgm_cmd_e.rgz
*/
*/
else
if
(
isdigit
(
pszToken
[
0
])
&&
8
==
strlen
(
pszToken
))
{
else
if
(
isdigit
(
pszToken
[
0
])
&&
8
==
strlen
(
pszToken
))
{
int
mon
,
mday
,
year
,
hour
,
min
;
lpfp
->
permissions
=
0xFFFF
;
/* No idea, put full permission :-) */
lpfp
->
permissions
=
0xFFFF
;
/* No idea, put full permission :-) */
sscanf
(
pszToken
,
"%d-%d-%d"
,
sscanf
(
pszToken
,
"%d-%d-%d"
,
&
mon
,
&
mday
,
&
year
);
&
lpfp
->
tmLastModified
.
tm_mon
,
lpfp
->
tmLastModified
.
wDay
=
mday
;
&
lpfp
->
tmLastModified
.
tm_mday
,
lpfp
->
tmLastModified
.
wMonth
=
mon
;
&
lpfp
->
tmLastModified
.
tm_year
)
;
lpfp
->
tmLastModified
.
wYear
=
year
;
/* Hacky and bad Y2K protection :-) */
/* Hacky and bad Y2K protection :-) */
if
(
lpfp
->
tmLastModified
.
tm_year
<
70
)
if
(
lpfp
->
tmLastModified
.
wYear
<
70
)
lpfp
->
tmLastModified
.
wYear
+=
2000
;
lpfp
->
tmLastModified
.
tm_year
+=
100
;
pszToken
=
strtok
(
NULL
,
szSpace
);
pszToken
=
strtok
(
NULL
,
szSpace
);
if
(
!
pszToken
)
continue
;
if
(
!
pszToken
)
continue
;
sscanf
(
pszToken
,
"%d:%d"
,
sscanf
(
pszToken
,
"%d:%d"
,
&
hour
,
&
min
);
&
lpfp
->
tmLastModified
.
tm_hour
,
lpfp
->
tmLastModified
.
wHour
=
hour
;
&
lpfp
->
tmLastModified
.
tm_min
)
;
lpfp
->
tmLastModified
.
wMinute
=
min
;
if
((
pszToken
[
5
]
==
'P'
)
&&
(
pszToken
[
6
]
==
'M'
))
{
if
((
pszToken
[
5
]
==
'P'
)
&&
(
pszToken
[
6
]
==
'M'
))
{
lpfp
->
tmLastModified
.
tm_h
our
+=
12
;
lpfp
->
tmLastModified
.
wH
our
+=
12
;
}
}
lpfp
->
tmLastModified
.
tm_sec
=
0
;
lpfp
->
tmLastModified
.
wSecond
=
0
;
TRACE
(
"Mod time: %02d:%02d:%02d %04d/%02d/%02d
\n
"
,
lpfp
->
tmLastModified
.
wHour
,
lpfp
->
tmLastModified
.
wMinute
,
lpfp
->
tmLastModified
.
wSecond
,
lpfp
->
tmLastModified
.
wYear
,
lpfp
->
tmLastModified
.
wMonth
,
lpfp
->
tmLastModified
.
wDay
);
TRACE
(
"Mod time: %02d:%02d:%02d %02d/%02d/%02d
\n
"
,
lpfp
->
tmLastModified
.
tm_hour
,
lpfp
->
tmLastModified
.
tm_min
,
lpfp
->
tmLastModified
.
tm_sec
,
(
lpfp
->
tmLastModified
.
tm_year
>=
100
)
?
lpfp
->
tmLastModified
.
tm_year
-
100
:
lpfp
->
tmLastModified
.
tm_year
,
lpfp
->
tmLastModified
.
tm_mon
,
lpfp
->
tmLastModified
.
tm_mday
);
pszToken
=
strtok
(
NULL
,
szSpace
);
pszToken
=
strtok
(
NULL
,
szSpace
);
if
(
!
pszToken
)
continue
;
if
(
!
pszToken
)
continue
;
if
(
!
strcasecmp
(
pszToken
,
"<DIR>"
))
{
if
(
!
strcasecmp
(
pszToken
,
"<DIR>"
))
{
...
...
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