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
b6a38ea6
Commit
b6a38ea6
authored
May 26, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Reimplement DosDateTimeToFileTime/FileTimeToDosDateTime using ntdll functions.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fc173ccc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
83 deletions
+49
-83
configure
configure
+0
-3
configure.ac
configure.ac
+0
-3
file.c
dlls/kernel32/file.c
+49
-0
time.c
dlls/kernel32/time.c
+0
-68
config.h.in
include/config.h.in
+0
-9
No files found.
configure
View file @
b6a38ea6
...
...
@@ -7418,7 +7418,6 @@ for ac_header in \
mach/mach.h
\
mach/machine.h
\
machine/cpu.h
\
machine/limits.h
\
machine/sysarch.h
\
mntent.h
\
ncurses.h
\
...
...
@@ -7448,7 +7447,6 @@ for ac_header in \
sys/filio.h
\
sys/ioctl.h
\
sys/ipc.h
\
sys/limits.h
\
sys/link.h
\
sys/mman.h
\
sys/modem.h
\
...
...
@@ -17984,7 +17982,6 @@ for ac_func in \
sysinfo
\
tcdrain
\
thr_kill2
\
timegm
\
usleep
do
:
...
...
configure.ac
View file @
b6a38ea6
...
...
@@ -473,7 +473,6 @@ AC_CHECK_HEADERS(\
mach/mach.h \
mach/machine.h \
machine/cpu.h \
machine/limits.h \
machine/sysarch.h \
mntent.h \
ncurses.h \
...
...
@@ -503,7 +502,6 @@ AC_CHECK_HEADERS(\
sys/filio.h \
sys/ioctl.h \
sys/ipc.h \
sys/limits.h \
sys/link.h \
sys/mman.h \
sys/modem.h \
...
...
@@ -2217,7 +2215,6 @@ AC_CHECK_FUNCS(\
sysinfo \
tcdrain \
thr_kill2 \
timegm \
usleep
)
CFLAGS="$ac_save_CFLAGS"
...
...
dlls/kernel32/file.c
View file @
b6a38ea6
...
...
@@ -407,6 +407,55 @@ BOOL WINAPI KERNEL32_FlushFileBuffers( HANDLE file )
}
/***********************************************************************
* DosDateTimeToFileTime (KERNEL32.@)
*/
BOOL
WINAPI
DosDateTimeToFileTime
(
WORD
fatdate
,
WORD
fattime
,
FILETIME
*
ft
)
{
TIME_FIELDS
fields
;
LARGE_INTEGER
time
;
fields
.
Year
=
(
fatdate
>>
9
)
+
1980
;
fields
.
Month
=
((
fatdate
>>
5
)
&
0x0f
);
fields
.
Day
=
(
fatdate
&
0x1f
);
fields
.
Hour
=
(
fattime
>>
11
);
fields
.
Minute
=
(
fattime
>>
5
)
&
0x3f
;
fields
.
Second
=
(
fattime
&
0x1f
)
*
2
;
fields
.
Milliseconds
=
0
;
if
(
!
RtlTimeFieldsToTime
(
&
fields
,
&
time
))
return
FALSE
;
ft
->
dwLowDateTime
=
time
.
u
.
LowPart
;
ft
->
dwHighDateTime
=
time
.
u
.
HighPart
;
return
TRUE
;
}
/***********************************************************************
* FileTimeToDosDateTime (KERNEL32.@)
*/
BOOL
WINAPI
FileTimeToDosDateTime
(
const
FILETIME
*
ft
,
WORD
*
fatdate
,
WORD
*
fattime
)
{
TIME_FIELDS
fields
;
LARGE_INTEGER
time
;
if
(
!
fatdate
||
!
fattime
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
time
.
u
.
LowPart
=
ft
->
dwLowDateTime
;
time
.
u
.
HighPart
=
ft
->
dwHighDateTime
;
RtlTimeToTimeFields
(
&
time
,
&
fields
);
if
(
fields
.
Year
<
1980
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
*
fattime
=
(
fields
.
Hour
<<
11
)
+
(
fields
.
Minute
<<
5
)
+
(
fields
.
Second
/
2
);
*
fatdate
=
((
fields
.
Year
-
1980
)
<<
9
)
+
(
fields
.
Month
<<
5
)
+
fields
.
Day
;
return
TRUE
;
}
/**************************************************************************
* Operations on file names *
**************************************************************************/
...
...
dlls/kernel32/time.c
View file @
b6a38ea6
...
...
@@ -30,14 +30,6 @@
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
#ifdef HAVE_SYS_TIMES_H
# include <sys/times.h>
#endif
#ifdef HAVE_SYS_LIMITS_H
#include <sys/limits.h>
#elif defined(HAVE_MACHINE_LIMITS_H)
#include <machine/limits.h>
#endif
#include "ntstatus.h"
#define WIN32_NO_STATUS
...
...
@@ -116,66 +108,6 @@ BOOL WINAPI GetDaylightFlag(void)
return
GetTimeZoneInformation
(
&
tzinfo
)
==
TIME_ZONE_ID_DAYLIGHT
;
}
/***********************************************************************
* DosDateTimeToFileTime (KERNEL32.@)
*/
BOOL
WINAPI
DosDateTimeToFileTime
(
WORD
fatdate
,
WORD
fattime
,
LPFILETIME
ft
)
{
struct
tm
newtm
;
#ifndef HAVE_TIMEGM
struct
tm
*
gtm
;
time_t
time1
,
time2
;
#endif
newtm
.
tm_sec
=
(
fattime
&
0x1f
)
*
2
;
newtm
.
tm_min
=
(
fattime
>>
5
)
&
0x3f
;
newtm
.
tm_hour
=
(
fattime
>>
11
);
newtm
.
tm_mday
=
(
fatdate
&
0x1f
);
newtm
.
tm_mon
=
((
fatdate
>>
5
)
&
0x0f
)
-
1
;
newtm
.
tm_year
=
(
fatdate
>>
9
)
+
80
;
newtm
.
tm_isdst
=
-
1
;
#ifdef HAVE_TIMEGM
RtlSecondsSince1970ToTime
(
timegm
(
&
newtm
),
(
LARGE_INTEGER
*
)
ft
);
#else
time1
=
mktime
(
&
newtm
);
gtm
=
gmtime
(
&
time1
);
time2
=
mktime
(
gtm
);
RtlSecondsSince1970ToTime
(
2
*
time1
-
time2
,
(
LARGE_INTEGER
*
)
ft
);
#endif
return
TRUE
;
}
/***********************************************************************
* FileTimeToDosDateTime (KERNEL32.@)
*/
BOOL
WINAPI
FileTimeToDosDateTime
(
const
FILETIME
*
ft
,
LPWORD
fatdate
,
LPWORD
fattime
)
{
LARGE_INTEGER
li
;
ULONG
t
;
time_t
unixtime
;
struct
tm
*
tm
;
if
(
!
fatdate
||
!
fattime
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
li
.
u
.
LowPart
=
ft
->
dwLowDateTime
;
li
.
u
.
HighPart
=
ft
->
dwHighDateTime
;
if
(
!
RtlTimeToSecondsSince1970
(
&
li
,
&
t
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
unixtime
=
t
;
tm
=
gmtime
(
&
unixtime
);
*
fattime
=
(
tm
->
tm_hour
<<
11
)
+
(
tm
->
tm_min
<<
5
)
+
(
tm
->
tm_sec
/
2
);
*
fatdate
=
((
tm
->
tm_year
-
80
)
<<
9
)
+
((
tm
->
tm_mon
+
1
)
<<
5
)
+
tm
->
tm_mday
;
return
TRUE
;
}
/******************************************************************************
* GetTickCount64 (KERNEL32.@)
*/
...
...
include/config.h.in
View file @
b6a38ea6
...
...
@@ -539,9 +539,6 @@
/* Define to 1 if you have the <machine/cpu.h> header file. */
#undef HAVE_MACHINE_CPU_H
/* Define to 1 if you have the <machine/limits.h> header file. */
#undef HAVE_MACHINE_LIMITS_H
/* Define to 1 if you have the <machine/sysarch.h> header file. */
#undef HAVE_MACHINE_SYSARCH_H
...
...
@@ -1021,9 +1018,6 @@
/* Define to 1 if you have the <sys/ipc.h> header file. */
#undef HAVE_SYS_IPC_H
/* Define to 1 if you have the <sys/limits.h> header file. */
#undef HAVE_SYS_LIMITS_H
/* Define to 1 if you have the <sys/link.h> header file. */
#undef HAVE_SYS_LINK_H
...
...
@@ -1162,9 +1156,6 @@
/* Define to 1 if you have the <tiffio.h> header file. */
#undef HAVE_TIFFIO_H
/* Define to 1 if you have the `timegm' function. */
#undef HAVE_TIMEGM
/* Define to 1 if you have the `trunc' function. */
#undef HAVE_TRUNC
...
...
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