2 * Win32 kernel functions
4 * Copyright 1995 Martin von Loewis
19 #include "debugtools.h"
21 DEFAULT_DEBUG_CHANNEL(win32
)
24 /**********************************************************************
25 * ContinueDebugEvent [KERNEL32.146]
27 BOOL WINAPI
ContinueDebugEvent(DWORD pid
,DWORD tid
,DWORD contstatus
) {
28 FIXME("(0x%lx,%ld,%ld): stub\n",pid
,tid
,contstatus
);
32 /*********************************************************************
33 * Process_ClockTimeToFileTime
34 * (olorin@fandra.org, 20-Sep-1998)
35 * Converts clock_t into FILETIME.
36 * Used by GetProcessTime.
37 * Differences to UnixTimeToFileTime:
38 * 1) Divided by CLK_TCK
39 * 2) Time is relative. There is no 'starting date', so there is
40 * no need in offset correction, like in UnixTimeToFileTime
41 * FIXME: This function should be moved to a more appropriate .c file
42 * FIXME: On floating point operations, it is assumed that
43 * floating values are truncated on convertion to integer.
45 void Process_ClockTimeToFileTime( clock_t unix_time
, LPFILETIME filetime
)
47 double td
= (unix_time
*10000000.0)/CLK_TCK
;
48 /* Yes, double, because long int might overflow here. */
49 #if (SIZEOF_LONG_LONG >= 8)
50 unsigned long long t
= td
;
51 filetime
->dwLowDateTime
= (UINT
) t
;
52 filetime
->dwHighDateTime
= (UINT
) (t
>> 32);
54 double divider
= 1. * (1 << 16) * (1 << 16);
55 filetime
->dwHighDateTime
= (UINT
) (td
/ divider
);
56 filetime
->dwLowDateTime
= (UINT
) (td
- filetime
->dwHighDateTime
*divider
);
57 /* using floor() produces wierd results, better leave this as it is
58 * ( with (UINT32) convertion )
63 /*********************************************************************
64 * GetProcessTimes [KERNEL32.262]
66 * FIXME: lpCreationTime, lpExitTime are NOT INITIALIZED.
67 * olorin@fandra.org: Would be nice to substract the cpu time,
68 * used by Wine at startup.
69 * Also, there is a need to separate times
70 * used by different applications.
72 BOOL WINAPI
GetProcessTimes(
73 HANDLE hprocess
,LPFILETIME lpCreationTime
,LPFILETIME lpExitTime
,
74 LPFILETIME lpKernelTime
, LPFILETIME lpUserTime
79 Process_ClockTimeToFileTime(tms
.tms_utime
,lpUserTime
);
80 Process_ClockTimeToFileTime(tms
.tms_stime
,lpKernelTime
);