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
4b65a702
Commit
4b65a702
authored
Nov 10, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use a proper Unix syscall for RtlGetSystemTimePrecise().
parent
1fe7b8dd
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
16 additions
and
57 deletions
+16
-57
loader.c
dlls/ntdll/loader.c
+0
-25
ntdll.spec
dlls/ntdll/ntdll.spec
+0
-1
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+0
-1
time.c
dlls/ntdll/time.c
+4
-1
loader.c
dlls/ntdll/unix/loader.c
+2
-18
sync.c
dlls/ntdll/unix/sync.c
+8
-3
unix_private.h
dlls/ntdll/unix/unix_private.h
+1
-0
unixlib.h
dlls/ntdll/unixlib.h
+1
-8
No files found.
dlls/ntdll/loader.c
View file @
4b65a702
...
...
@@ -4600,28 +4600,3 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
if
(
reason
==
DLL_PROCESS_ATTACH
)
LdrDisableThreadCalloutsForDll
(
inst
);
return
TRUE
;
}
static
LONGLONG
WINAPI
RtlGetSystemTimePrecise_fallback
(
void
)
{
LARGE_INTEGER
now
;
NtQuerySystemTime
(
&
now
);
return
now
.
QuadPart
;
}
static
const
struct
unix_funcs
unix_fallbacks
=
{
RtlGetSystemTimePrecise_fallback
,
};
const
struct
unix_funcs
*
unix_funcs
=
&
unix_fallbacks
;
/***********************************************************************
* __wine_set_unix_funcs
*/
NTSTATUS
CDECL
__wine_set_unix_funcs
(
int
version
,
const
struct
unix_funcs
*
funcs
)
{
if
(
version
!=
NTDLL_UNIXLIB_VERSION
)
return
STATUS_REVISION_MISMATCH
;
unix_funcs
=
funcs
;
return
STATUS_SUCCESS
;
}
dlls/ntdll/ntdll.spec
View file @
4b65a702
...
...
@@ -1692,7 +1692,6 @@
# Unix interface
@ stdcall -syscall __wine_unix_call(int64 long ptr)
@ stdcall -syscall __wine_unix_spawnvp(long ptr)
@ cdecl __wine_set_unix_funcs(long ptr)
@ stdcall __wine_ctrl_routine(ptr)
@ extern __wine_syscall_dispatcher
@ extern -arch=i386 __wine_ldt_copy
...
...
dlls/ntdll/ntdll_misc.h
View file @
4b65a702
...
...
@@ -85,7 +85,6 @@ extern const WCHAR windows_dir[] DECLSPEC_HIDDEN;
extern
const
WCHAR
system_dir
[]
DECLSPEC_HIDDEN
;
extern
void
(
FASTCALL
*
pBaseThreadInitThunk
)(
DWORD
,
LPTHREAD_START_ROUTINE
,
void
*
)
DECLSPEC_HIDDEN
;
extern
const
struct
unix_funcs
*
unix_funcs
DECLSPEC_HIDDEN
;
extern
struct
_KUSER_SHARED_DATA
*
user_shared_data
DECLSPEC_HIDDEN
;
...
...
dlls/ntdll/time.c
View file @
4b65a702
...
...
@@ -372,7 +372,10 @@ void WINAPI RtlTimeToElapsedTimeFields( const LARGE_INTEGER *Time, PTIME_FIELDS
*/
LONGLONG
WINAPI
RtlGetSystemTimePrecise
(
void
)
{
return
unix_funcs
->
RtlGetSystemTimePrecise
();
LONGLONG
ret
;
NTDLL_UNIX_CALL
(
system_time_precise
,
&
ret
);
return
ret
;
}
/******************************************************************************
...
...
dlls/ntdll/unix/loader.c
View file @
4b65a702
...
...
@@ -116,7 +116,6 @@ void (WINAPI *pRtlUserThreadStart)( PRTL_THREAD_START_ROUTINE entry, void *a
void
(
WINAPI
*
p__wine_ctrl_routine
)(
void
*
);
SYSTEM_DLL_INIT_BLOCK
*
pLdrSystemDllInitBlock
=
NULL
;
static
NTSTATUS
(
CDECL
*
p__wine_set_unix_funcs
)(
int
version
,
const
struct
unix_funcs
*
funcs
);
static
void
*
p__wine_syscall_dispatcher
;
static
void
*
const
syscalls
[]
=
...
...
@@ -1062,7 +1061,6 @@ static void load_ntdll_functions( HMODULE module )
GET_FUNC
(
LdrSystemDllInitBlock
);
GET_FUNC
(
RtlUserThreadStart
);
GET_FUNC
(
__wine_ctrl_routine
);
GET_FUNC
(
__wine_set_unix_funcs
);
GET_FUNC
(
__wine_syscall_dispatcher
);
#ifdef __i386__
{
...
...
@@ -2151,15 +2149,6 @@ static ULONG_PTR get_image_address(void)
/***********************************************************************
* unix_funcs
*/
static
struct
unix_funcs
unix_funcs
=
{
RtlGetSystemTimePrecise
,
};
/***********************************************************************
* __wine_unix_call_funcs
*/
const
unixlib_entry_t
__wine_unix_call_funcs
[]
=
...
...
@@ -2167,6 +2156,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
load_so_dll
,
init_builtin_dll
,
unwind_builtin_dll
,
system_time_precise
,
};
...
...
@@ -2182,6 +2172,7 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] =
wow64_load_so_dll
,
wow64_init_builtin_dll
,
wow64_unwind_builtin_dll
,
system_time_precise
,
};
...
...
@@ -2191,7 +2182,6 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] =
static
void
start_main_thread
(
void
)
{
SYSTEM_SERVICE_TABLE
syscall_table
=
{
(
ULONG_PTR
*
)
syscalls
,
NULL
,
ARRAY_SIZE
(
syscalls
),
syscall_args
};
NTSTATUS
status
;
TEB
*
teb
=
virtual_alloc_first_teb
();
signal_init_threading
();
...
...
@@ -2214,12 +2204,6 @@ static void start_main_thread(void)
if
(
main_image_info
.
Machine
!=
current_machine
)
load_wow64_ntdll
(
main_image_info
.
Machine
);
load_apiset_dll
();
ntdll_init_syscalls
(
0
,
&
syscall_table
,
p__wine_syscall_dispatcher
);
status
=
p__wine_set_unix_funcs
(
NTDLL_UNIXLIB_VERSION
,
&
unix_funcs
);
if
(
status
==
STATUS_REVISION_MISMATCH
)
{
ERR
(
"ntdll library version mismatch
\n
"
);
NtTerminateProcess
(
GetCurrentProcess
(),
status
);
}
server_init_process_done
();
}
...
...
dlls/ntdll/unix/sync.c
View file @
4b65a702
...
...
@@ -1642,17 +1642,22 @@ ULONG WINAPI NtGetTickCount(void)
/******************************************************************************
* RtlGetSystemTimePrecise (NTDLL.@)
*/
LONGLONG
WINAPI
RtlGetSystemTimePrecise
(
void
)
NTSTATUS
system_time_precise
(
void
*
args
)
{
LONGLONG
*
ret
=
args
;
struct
timeval
now
;
#ifdef HAVE_CLOCK_GETTIME
struct
timespec
ts
;
if
(
!
clock_gettime
(
CLOCK_REALTIME
,
&
ts
))
return
ticks_from_time_t
(
ts
.
tv_sec
)
+
(
ts
.
tv_nsec
+
50
)
/
100
;
{
*
ret
=
ticks_from_time_t
(
ts
.
tv_sec
)
+
(
ts
.
tv_nsec
+
50
)
/
100
;
return
STATUS_SUCCESS
;
}
#endif
gettimeofday
(
&
now
,
0
);
return
ticks_from_time_t
(
now
.
tv_sec
)
+
now
.
tv_usec
*
10
;
*
ret
=
ticks_from_time_t
(
now
.
tv_sec
)
+
now
.
tv_usec
*
10
;
return
STATUS_SUCCESS
;
}
...
...
dlls/ntdll/unix/unix_private.h
View file @
4b65a702
...
...
@@ -192,6 +192,7 @@ extern NTSTATUS set_thread_context( HANDLE handle, const void *context, BOOL *se
extern
NTSTATUS
get_thread_context
(
HANDLE
handle
,
void
*
context
,
BOOL
*
self
,
USHORT
machine
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
alloc_object_attributes
(
const
OBJECT_ATTRIBUTES
*
attr
,
struct
object_attributes
**
ret
,
data_size_t
*
ret_len
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
system_time_precise
(
void
*
args
)
DECLSPEC_HIDDEN
;
extern
void
*
anon_mmap_fixed
(
void
*
start
,
size_t
size
,
int
prot
,
int
flags
)
DECLSPEC_HIDDEN
;
extern
void
*
anon_mmap_alloc
(
size_t
size
,
int
prot
)
DECLSPEC_HIDDEN
;
...
...
dlls/ntdll/unixlib.h
View file @
4b65a702
...
...
@@ -43,18 +43,11 @@ enum ntdll_unix_funcs
unix_load_so_dll
,
unix_init_builtin_dll
,
unix_unwind_builtin_dll
,
unix_system_time_precise
,
};
extern
unixlib_handle_t
ntdll_unix_handle
;
#define NTDLL_UNIX_CALL( func, params ) __wine_unix_call( ntdll_unix_handle, unix_ ## func, params )
/* increment this when you change the function table */
#define NTDLL_UNIXLIB_VERSION 138
struct
unix_funcs
{
LONGLONG
(
WINAPI
*
RtlGetSystemTimePrecise
)(
void
);
};
#endif
/* __NTDLL_UNIXLIB_H */
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