View Javadoc
1   /**
2    * Oshi (https://github.com/dblock/oshi)
3    * 
4    * Copyright (c) 2010 - 2015 The Oshi Project Team
5    * 
6    * All rights reserved. This program and the accompanying materials
7    * are made available under the terms of the Eclipse Public License v1.0
8    * which accompanies this distribution, and is available at
9    * http://www.eclipse.org/legal/epl-v10.html
10   * 
11   * Contributors:
12   * dblock[at]dblock[dot]org
13   * alessandro[at]perucchi[dot]org
14   * widdis[at]gmail[dot]com
15   * https://github.com/dblock/oshi/graphs/contributors
16   */
17  package oshi.software.os.windows.nt;
18  
19  import com.sun.jna.Native;
20  import com.sun.jna.platform.win32.WinBase;
21  
22  /**
23   * Windows Kernel32
24   * 
25   * @author widdis[at]gmail[dot]com
26   */
27  public interface Kernel32 extends com.sun.jna.platform.win32.Kernel32 {
28  	Kernel32 INSTANCE = (Kernel32) Native.loadLibrary("Kernel32",
29  			Kernel32.class);
30  
31  	public static final long WIN32_TIME_OFFSET = (369L * 365L + 89L) * 24L * 3600L * 1000L;
32  
33  	// TODO: Submit this change to JNA Kernel32 class
34  	/**
35  	 * Retrieves system timing information. On a multiprocessor system, the
36  	 * values returned are the sum of the designated times across all
37  	 * processors.
38  	 * 
39  	 * Times are offset by {@value #WIN32_TIME_OFFSET}.
40  	 * 
41  	 * @param lpIdleTime
42  	 *            A pointer to a FILETIME structure that receives the amount of
43  	 *            time that the system has been idle.
44  	 * @param lpKernelTime
45  	 *            A pointer to a FILETIME structure that receives the amount of
46  	 *            time that the system has spent executing in Kernel mode
47  	 *            (including all threads in all processes, on all processors).
48  	 *            This time value also includes the amount of time the system
49  	 *            has been idle.
50  	 * @param lpUserTime
51  	 *            A pointer to a FILETIME structure that receives the amount of
52  	 *            time that the system has spent executing in User mode
53  	 *            (including all threads in all processes, on all processors).
54  	 * @return If the function succeeds, the return value is nonzero. If the
55  	 *         function fails, the return value is zero and errno is set.
56  	 */
57  	public int GetSystemTimes(WinBase.FILETIME lpIdleTime,
58  			WinBase.FILETIME lpKernelTime, WinBase.FILETIME lpUserTime);
59  
60  }