server: Convert the server start time to the abs_time_t type.
This commit is contained in:
parent
3095a48d6f
commit
c627601c3b
|
@ -683,7 +683,7 @@ NTSTATUS WINAPI NtQuerySystemInformation(
|
|||
memset(&sti, 0 , sizeof(sti));
|
||||
|
||||
/* liKeSystemTime, liExpTimeZoneBias, uCurrentTimeZoneId */
|
||||
RtlSecondsSince1970ToTime( server_start_time, &sti.liKeBootTime );
|
||||
NTDLL_from_server_abstime( &sti.liKeBootTime, &server_start_time );
|
||||
|
||||
if (Length <= sizeof(sti))
|
||||
{
|
||||
|
|
|
@ -54,7 +54,7 @@ extern void virtual_init(void);
|
|||
extern void virtual_init_threading(void);
|
||||
|
||||
/* server support */
|
||||
extern time_t server_start_time;
|
||||
extern abs_time_t server_start_time;
|
||||
extern void server_init_process(void);
|
||||
extern size_t server_init_thread( int unix_pid, int unix_tid, void *entry_point );
|
||||
extern void DECLSPEC_NORETURN server_protocol_error( const char *err, ... );
|
||||
|
|
|
@ -85,7 +85,7 @@ struct cmsg_fd
|
|||
};
|
||||
#endif /* HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS */
|
||||
|
||||
time_t server_start_time = 0; /* time of server startup */
|
||||
abs_time_t server_start_time = { 0, 0 }; /* time of server startup */
|
||||
|
||||
extern struct wine_pthread_functions pthread_functions;
|
||||
|
||||
|
|
|
@ -874,7 +874,8 @@ NTSTATUS WINAPI NtQueryPerformanceCounter( PLARGE_INTEGER Counter, PLARGE_INTEGE
|
|||
* to one of 1.193182 MHz, with some care for arithmetic
|
||||
* overflow ( will not overflow for 5000 years ) and
|
||||
* good accuracy ( 105/88 = 1.19318182) */
|
||||
Counter->QuadPart = (((now.tv_sec - server_start_time) * (ULONGLONG)1000000 + now.tv_usec) * 105) / 88;
|
||||
Counter->QuadPart = (((now.tv_sec - server_start_time.sec) * (ULONGLONG)1000000 +
|
||||
(now.tv_usec - server_start_time.usec)) * 105) / 88;
|
||||
if (Frequency) Frequency->QuadPart = 1193182;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
@ -889,7 +890,8 @@ ULONG WINAPI NtGetTickCount(void)
|
|||
struct timeval current_time;
|
||||
|
||||
gettimeofday(¤t_time, NULL);
|
||||
return (current_time.tv_sec - server_start_time)*1000 + current_time.tv_usec/1000;
|
||||
return (current_time.tv_sec - server_start_time.sec) * 1000 +
|
||||
(current_time.tv_usec - server_start_time.usec) / 1000;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -299,7 +299,7 @@ struct init_thread_reply
|
|||
process_id_t pid;
|
||||
thread_id_t tid;
|
||||
data_size_t info_size;
|
||||
time_t server_start;
|
||||
abs_time_t server_start;
|
||||
int version;
|
||||
};
|
||||
|
||||
|
@ -4385,6 +4385,6 @@ union generic_reply
|
|||
struct query_symlink_reply query_symlink_reply;
|
||||
};
|
||||
|
||||
#define SERVER_PROTOCOL_VERSION 242
|
||||
#define SERVER_PROTOCOL_VERSION 243
|
||||
|
||||
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */
|
||||
|
|
|
@ -213,6 +213,6 @@ extern int foreground;
|
|||
extern const char *server_argv0;
|
||||
|
||||
/* server start time used for GetTickCount() */
|
||||
extern time_t server_start_time;
|
||||
extern struct timeval server_start_time;
|
||||
|
||||
#endif /* __WINE_SERVER_OBJECT_H */
|
||||
|
|
|
@ -284,7 +284,7 @@ struct token_groups
|
|||
process_id_t pid; /* process id of the new thread's process */
|
||||
thread_id_t tid; /* thread id of the new thread */
|
||||
data_size_t info_size; /* total size of startup info */
|
||||
time_t server_start; /* server start time */
|
||||
abs_time_t server_start; /* server start time */
|
||||
int version; /* protocol version */
|
||||
@END
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ static const struct fd_ops master_socket_fd_ops =
|
|||
|
||||
struct thread *current = NULL; /* thread handling the current request */
|
||||
unsigned int global_error = 0; /* global error code for when no thread is current */
|
||||
time_t server_start_time = 0; /* server startup time */
|
||||
struct timeval server_start_time = { 0, 0 }; /* server startup time */
|
||||
|
||||
static struct master_socket *master_socket; /* the master socket object */
|
||||
|
||||
|
@ -465,7 +465,8 @@ unsigned int get_tick_count(void)
|
|||
{
|
||||
struct timeval t;
|
||||
gettimeofday( &t, NULL );
|
||||
return ((t.tv_sec - server_start_time) * 1000) + (t.tv_usec / 1000);
|
||||
return ((t.tv_sec - server_start_time.tv_sec) * 1000) +
|
||||
((t.tv_usec - server_start_time.tv_usec) / 1000);
|
||||
}
|
||||
|
||||
static void master_socket_dump( struct object *obj, int verbose )
|
||||
|
@ -798,7 +799,7 @@ void open_master_socket(void)
|
|||
msghdr.msg_iovlen = 1;
|
||||
|
||||
/* init startup time */
|
||||
server_start_time = time(NULL);
|
||||
gettimeofday( &server_start_time, NULL );
|
||||
}
|
||||
|
||||
/* master socket timer expiration handler */
|
||||
|
|
|
@ -889,7 +889,8 @@ DECL_HANDLER(init_thread)
|
|||
reply->pid = get_process_id( process );
|
||||
reply->tid = get_thread_id( current );
|
||||
reply->version = SERVER_PROTOCOL_VERSION;
|
||||
reply->server_start = server_start_time;
|
||||
reply->server_start.sec = server_start_time.tv_sec;
|
||||
reply->server_start.usec = server_start_time.tv_usec;
|
||||
return;
|
||||
|
||||
error:
|
||||
|
|
|
@ -697,7 +697,9 @@ static void dump_init_thread_reply( const struct init_thread_reply *req )
|
|||
fprintf( stderr, " pid=%04x,", req->pid );
|
||||
fprintf( stderr, " tid=%04x,", req->tid );
|
||||
fprintf( stderr, " info_size=%u,", req->info_size );
|
||||
fprintf( stderr, " server_start=%ld,", (long)req->server_start );
|
||||
fprintf( stderr, " server_start=" );
|
||||
dump_abs_time( &req->server_start );
|
||||
fprintf( stderr, "," );
|
||||
fprintf( stderr, " version=%d", req->version );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue