Commit 40fb7ca1 authored by Alexandre Julliard's avatar Alexandre Julliard

kernel32: Implemented GetTickCount64.

parent 6544d9ee
...@@ -636,6 +636,7 @@ ...@@ -636,6 +636,7 @@
@ stdcall GetThreadSelectorEntry(long long ptr) @ stdcall GetThreadSelectorEntry(long long ptr)
@ stdcall GetThreadTimes(long ptr ptr ptr ptr) @ stdcall GetThreadTimes(long ptr ptr ptr ptr)
@ stdcall GetTickCount() @ stdcall GetTickCount()
@ stdcall -ret64 GetTickCount64()
@ stdcall GetTimeFormatA(long long ptr str ptr long) @ stdcall GetTimeFormatA(long long ptr str ptr long)
@ stdcall GetTimeFormatW(long long ptr wstr ptr long) @ stdcall GetTimeFormatW(long long ptr wstr ptr long)
@ stdcall GetTimeZoneInformation(ptr) @ stdcall GetTimeZoneInformation(ptr)
......
...@@ -46,6 +46,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(process); ...@@ -46,6 +46,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(process);
extern int __wine_set_signal_handler(unsigned, int (*)(unsigned)); extern int __wine_set_signal_handler(unsigned, int (*)(unsigned));
static ULONGLONG server_start_time;
/*********************************************************************** /***********************************************************************
* KERNEL thread initialisation routine * KERNEL thread initialisation routine
*/ */
...@@ -112,12 +114,16 @@ static void set_entry_point( HMODULE module, const char *name, DWORD rva ) ...@@ -112,12 +114,16 @@ static void set_entry_point( HMODULE module, const char *name, DWORD rva )
static BOOL process_attach( HMODULE module ) static BOOL process_attach( HMODULE module )
{ {
SYSTEM_INFO si; SYSTEM_INFO si;
SYSTEM_TIMEOFDAY_INFORMATION ti;
RTL_USER_PROCESS_PARAMETERS *params = NtCurrentTeb()->Peb->ProcessParameters; RTL_USER_PROCESS_PARAMETERS *params = NtCurrentTeb()->Peb->ProcessParameters;
/* FIXME: should probably be done in ntdll */ /* FIXME: should probably be done in ntdll */
GetSystemInfo( &si ); GetSystemInfo( &si );
NtCurrentTeb()->Peb->NumberOfProcessors = si.dwNumberOfProcessors; NtCurrentTeb()->Peb->NumberOfProcessors = si.dwNumberOfProcessors;
NtQuerySystemInformation( SystemTimeOfDayInformation, &ti, sizeof(ti), NULL );
server_start_time = ti.liKeBootTime.QuadPart;
/* Setup registry locale information */ /* Setup registry locale information */
LOCALE_InitRegistry(); LOCALE_InitRegistry();
...@@ -236,6 +242,18 @@ INT WINAPI MulDiv( INT nMultiplicand, INT nMultiplier, INT nDivisor) ...@@ -236,6 +242,18 @@ INT WINAPI MulDiv( INT nMultiplicand, INT nMultiplier, INT nDivisor)
} }
/******************************************************************************
* GetTickCount64 (KERNEL32.@)
*/
ULONGLONG WINAPI GetTickCount64(void)
{
LARGE_INTEGER now;
NtQuerySystemTime( &now );
return (now.QuadPart - server_start_time) / 10000;
}
/*********************************************************************** /***********************************************************************
* GetTickCount (KERNEL32.@) * GetTickCount (KERNEL32.@)
* *
...@@ -254,5 +272,5 @@ INT WINAPI MulDiv( INT nMultiplicand, INT nMultiplier, INT nDivisor) ...@@ -254,5 +272,5 @@ INT WINAPI MulDiv( INT nMultiplicand, INT nMultiplier, INT nDivisor)
*/ */
DWORD WINAPI GetTickCount(void) DWORD WINAPI GetTickCount(void)
{ {
return NtGetTickCount(); return GetTickCount64();
} }
...@@ -1679,6 +1679,7 @@ DWORD WINAPI GetTempPathA(DWORD,LPSTR); ...@@ -1679,6 +1679,7 @@ DWORD WINAPI GetTempPathA(DWORD,LPSTR);
DWORD WINAPI GetTempPathW(DWORD,LPWSTR); DWORD WINAPI GetTempPathW(DWORD,LPWSTR);
#define GetTempPath WINELIB_NAME_AW(GetTempPath) #define GetTempPath WINELIB_NAME_AW(GetTempPath)
DWORD WINAPI GetTickCount(void); DWORD WINAPI GetTickCount(void);
ULONGLONG WINAPI GetTickCount64(void);
DWORD WINAPI GetTimeZoneInformation(LPTIME_ZONE_INFORMATION); DWORD WINAPI GetTimeZoneInformation(LPTIME_ZONE_INFORMATION);
BOOL WINAPI GetThreadContext(HANDLE,CONTEXT *); BOOL WINAPI GetThreadContext(HANDLE,CONTEXT *);
INT WINAPI GetThreadPriority(HANDLE); INT WINAPI GetThreadPriority(HANDLE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment