2006-07-16 01:46:36 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) [2004, 2005, 2006], Hyperic, Inc.
|
|
|
|
* This file is part of SIGAR.
|
|
|
|
*
|
|
|
|
* SIGAR is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms version 2 of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation. This program is distributed
|
|
|
|
* in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
|
|
|
|
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
|
|
* PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
|
|
* details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
* USA.
|
|
|
|
*/
|
|
|
|
|
2004-06-22 06:37:04 +08:00
|
|
|
#ifndef SIGAR_OS_H
|
|
|
|
#define SIGAR_OS_H
|
|
|
|
|
|
|
|
#define WIN32_LEAN_AND_MEAN
|
|
|
|
#include <windows.h>
|
|
|
|
#include <winreg.h>
|
|
|
|
#include <winperf.h>
|
|
|
|
#include <winsock2.h>
|
|
|
|
#include <ws2tcpip.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <malloc.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <errno.h>
|
2004-06-22 14:12:51 +08:00
|
|
|
#include <tlhelp32.h>
|
2004-06-22 06:37:04 +08:00
|
|
|
|
2006-11-03 15:31:53 +08:00
|
|
|
#include "sigar_util.h"
|
|
|
|
|
2004-06-22 06:37:04 +08:00
|
|
|
#define INT64_C(val) val##i64
|
|
|
|
|
|
|
|
/* see apr/include/arch/win32/atime.h */
|
|
|
|
#define EPOCH_DELTA INT64_C(11644473600000000)
|
|
|
|
|
2004-08-04 13:18:05 +08:00
|
|
|
#define SIGAR_CMDLINE_MAX 4096
|
2004-08-03 10:45:26 +08:00
|
|
|
|
2004-06-22 06:37:04 +08:00
|
|
|
static __inline sigar_uint64_t FileTimeToTime(FILETIME *ft)
|
|
|
|
{
|
|
|
|
sigar_uint64_t time;
|
|
|
|
time = ft->dwHighDateTime;
|
|
|
|
time = time << 32;
|
|
|
|
time |= ft->dwLowDateTime;
|
|
|
|
time /= 10;
|
|
|
|
time -= EPOCH_DELTA;
|
|
|
|
return time;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* XXX: support CP_UTF8 ? */
|
|
|
|
|
|
|
|
#define SIGAR_A2W(lpa, lpw, bytes) \
|
|
|
|
(lpw[0] = 0, MultiByteToWideChar(CP_ACP, 0, \
|
|
|
|
lpa, -1, lpw, (bytes/sizeof(WCHAR))))
|
|
|
|
|
|
|
|
#define SIGAR_W2A(lpw, lpa, chars) \
|
|
|
|
(lpa[0] = '\0', WideCharToMultiByte(CP_ACP, 0, \
|
|
|
|
lpw, -1, (LPSTR)lpa, chars, \
|
|
|
|
NULL, NULL))
|
|
|
|
|
2006-11-06 04:08:23 +08:00
|
|
|
/* iptypes.h from vc7, not available in vc6 */
|
|
|
|
#include "msvc_iptypes.h"
|
2005-07-12 06:40:31 +08:00
|
|
|
|
2005-09-27 09:18:54 +08:00
|
|
|
/* from wtsapi32.h not in vs6.0 */
|
|
|
|
typedef enum {
|
|
|
|
WTSInitialProgram,
|
|
|
|
WTSApplicationName,
|
|
|
|
WTSWorkingDirectory,
|
|
|
|
WTSOEMId,
|
|
|
|
WTSSessionId,
|
|
|
|
WTSUserName,
|
|
|
|
WTSWinStationName,
|
|
|
|
WTSDomainName,
|
|
|
|
WTSConnectState,
|
|
|
|
WTSClientBuildNumber,
|
|
|
|
WTSClientName,
|
|
|
|
WTSClientDirectory,
|
|
|
|
WTSClientProductId,
|
|
|
|
WTSClientHardwareId,
|
|
|
|
WTSClientAddress,
|
|
|
|
WTSClientDisplay,
|
|
|
|
WTSClientProtocolType,
|
|
|
|
} WTS_INFO_CLASS;
|
|
|
|
|
|
|
|
typedef enum _WTS_CONNECTSTATE_CLASS {
|
|
|
|
WTSActive,
|
|
|
|
WTSConnected,
|
|
|
|
WTSConnectQuery,
|
|
|
|
WTSShadow,
|
|
|
|
WTSDisconnected,
|
|
|
|
WTSIdle,
|
|
|
|
WTSListen,
|
|
|
|
WTSReset,
|
|
|
|
WTSDown,
|
|
|
|
WTSInit
|
|
|
|
} WTS_CONNECTSTATE_CLASS;
|
|
|
|
|
|
|
|
#define WTS_PROTOCOL_TYPE_CONSOLE 0
|
|
|
|
#define WTS_PROTOCOL_TYPE_ICA 1
|
|
|
|
#define WTS_PROTOCOL_TYPE_RDP 2
|
|
|
|
|
|
|
|
typedef struct _WTS_SESSION_INFO {
|
|
|
|
DWORD SessionId;
|
|
|
|
LPTSTR pWinStationName;
|
|
|
|
DWORD State;
|
|
|
|
} WTS_SESSION_INFO, *PWTS_SESSION_INFO;
|
|
|
|
|
|
|
|
typedef struct _WTS_PROCESS_INFO {
|
|
|
|
DWORD SessionId;
|
|
|
|
DWORD ProcessId;
|
|
|
|
LPSTR pProcessName;
|
|
|
|
PSID pUserSid;
|
|
|
|
} WTS_PROCESS_INFO, *PWTS_PROCESS_INFO;
|
|
|
|
|
|
|
|
typedef struct _WTS_CLIENT_ADDRESS {
|
|
|
|
DWORD AddressFamily;
|
|
|
|
BYTE Address[20];
|
|
|
|
} WTS_CLIENT_ADDRESS, *PWTS_CLIENT_ADDRESS;
|
|
|
|
|
|
|
|
/* the WINSTATION_INFO stuff here is undocumented
|
|
|
|
* got the howto from google groups:
|
|
|
|
* http://redirx.com/?31gy
|
|
|
|
*/
|
|
|
|
typedef enum _WINSTATION_INFO_CLASS {
|
|
|
|
WinStationInformation = 8
|
|
|
|
} WINSTATION_INFO_CLASS;
|
|
|
|
|
|
|
|
typedef struct _WINSTATION_INFO {
|
|
|
|
BYTE Reserved1[72];
|
|
|
|
ULONG SessionId;
|
|
|
|
BYTE Reserved2[4];
|
|
|
|
FILETIME ConnectTime;
|
|
|
|
FILETIME DisconnectTime;
|
|
|
|
FILETIME LastInputTime;
|
|
|
|
FILETIME LoginTime;
|
|
|
|
BYTE Reserved3[1096];
|
|
|
|
FILETIME CurrentTime;
|
|
|
|
} WINSTATION_INFO, *PWINSTATION_INFO;
|
|
|
|
|
|
|
|
/* end wtsapi32.h */
|
|
|
|
|
2006-10-20 05:30:57 +08:00
|
|
|
#if _MSC_VER <= 1200
|
|
|
|
|
2006-07-08 04:29:22 +08:00
|
|
|
/* from winbase.h not in vs6.0 */
|
|
|
|
typedef struct {
|
|
|
|
DWORD dwLength;
|
|
|
|
DWORD dwMemoryLoad;
|
|
|
|
DWORDLONG ullTotalPhys;
|
|
|
|
DWORDLONG ullAvailPhys;
|
|
|
|
DWORDLONG ullTotalPageFile;
|
|
|
|
DWORDLONG ullAvailPageFile;
|
|
|
|
DWORDLONG ullTotalVirtual;
|
|
|
|
DWORDLONG ullAvailVirtual;
|
|
|
|
DWORDLONG ullAvailExtendedVirtual;
|
|
|
|
} MEMORYSTATUSEX;
|
|
|
|
|
2006-10-20 05:30:57 +08:00
|
|
|
/* service manager stuff not in vs6.0 */
|
|
|
|
typedef struct _SERVICE_STATUS_PROCESS {
|
|
|
|
DWORD dwServiceType;
|
|
|
|
DWORD dwCurrentState;
|
|
|
|
DWORD dwControlsAccepted;
|
|
|
|
DWORD dwWin32ExitCode;
|
|
|
|
DWORD dwServiceSpecificExitCode;
|
|
|
|
DWORD dwCheckPoint;
|
|
|
|
DWORD dwWaitHint;
|
|
|
|
DWORD dwProcessId;
|
|
|
|
DWORD dwServiceFlags;
|
|
|
|
} SERVICE_STATUS_PROCESS;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
SC_STATUS_PROCESS_INFO = 0
|
|
|
|
} SC_STATUS_TYPE;
|
|
|
|
|
|
|
|
#endif /* _MSC_VER */
|
|
|
|
|
2004-06-22 06:37:04 +08:00
|
|
|
#include <iprtrmib.h>
|
|
|
|
|
|
|
|
/* undocumented structures */
|
|
|
|
typedef struct {
|
|
|
|
DWORD dwState;
|
|
|
|
DWORD dwLocalAddr;
|
|
|
|
DWORD dwLocalPort;
|
|
|
|
DWORD dwRemoteAddr;
|
|
|
|
DWORD dwRemotePort;
|
|
|
|
DWORD dwProcessId;
|
|
|
|
} MIB_TCPEXROW, *PMIB_TCPEXROW;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
DWORD dwNumEntries;
|
|
|
|
MIB_TCPEXROW table[ANY_SIZE];
|
|
|
|
} MIB_TCPEXTABLE, *PMIB_TCPEXTABLE;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
DWORD dwLocalAddr;
|
|
|
|
DWORD dwLocalPort;
|
|
|
|
DWORD dwProcessId;
|
|
|
|
} MIB_UDPEXROW, *PMIB_UDPEXROW;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
DWORD dwNumEntries;
|
|
|
|
MIB_UDPEXROW table[ANY_SIZE];
|
|
|
|
} MIB_UDPEXTABLE, *PMIB_UDPEXTABLE;
|
|
|
|
|
|
|
|
/* end undocumented structures */
|
2005-10-03 05:13:26 +08:00
|
|
|
|
2004-11-03 07:17:18 +08:00
|
|
|
/* no longer in the standard header files */
|
|
|
|
typedef struct {
|
|
|
|
LARGE_INTEGER IdleTime;
|
|
|
|
LARGE_INTEGER KernelTime;
|
|
|
|
LARGE_INTEGER UserTime;
|
|
|
|
LARGE_INTEGER Reserved1[2];
|
|
|
|
ULONG Reserved2;
|
|
|
|
} SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
|
|
|
|
|
|
|
|
#define SystemProcessorPerformanceInformation 8
|
|
|
|
|
2004-06-22 06:37:04 +08:00
|
|
|
typedef struct {
|
|
|
|
sigar_pid_t pid;
|
|
|
|
int ppid;
|
|
|
|
int priority;
|
|
|
|
time_t mtime;
|
|
|
|
sigar_uint64_t size;
|
2005-11-02 02:48:33 +08:00
|
|
|
sigar_uint64_t resident;
|
2004-06-22 06:37:04 +08:00
|
|
|
char name[SIGAR_PROC_NAME_LEN];
|
|
|
|
char state;
|
|
|
|
sigar_uint64_t handles;
|
2005-11-23 05:48:52 +08:00
|
|
|
sigar_uint64_t threads;
|
2005-11-24 01:51:19 +08:00
|
|
|
sigar_uint64_t page_faults;
|
2004-06-22 06:37:04 +08:00
|
|
|
} sigar_win32_pinfo_t;
|
|
|
|
|
2005-12-21 07:09:34 +08:00
|
|
|
typedef struct {
|
|
|
|
const char *name;
|
|
|
|
HINSTANCE handle;
|
|
|
|
} sigar_dll_handle_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
const char *name;
|
|
|
|
FARPROC func;
|
|
|
|
} sigar_dll_func_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
const char *name;
|
|
|
|
HINSTANCE handle;
|
|
|
|
sigar_dll_func_t funcs[12];
|
|
|
|
} sigar_dll_module_t;
|
|
|
|
|
|
|
|
/* wtsapi.dll */
|
|
|
|
typedef BOOL (CALLBACK *wtsapi_enum_sessions)(HANDLE,
|
|
|
|
DWORD,
|
|
|
|
DWORD,
|
|
|
|
PWTS_SESSION_INFO *,
|
|
|
|
DWORD *);
|
|
|
|
|
|
|
|
typedef void (CALLBACK *wtsapi_free_mem)(PVOID);
|
|
|
|
|
|
|
|
typedef BOOL (CALLBACK *wtsapi_query_session)(HANDLE,
|
|
|
|
DWORD,
|
|
|
|
WTS_INFO_CLASS,
|
|
|
|
LPSTR *, DWORD *);
|
|
|
|
/* iphlpapi.dll */
|
|
|
|
|
|
|
|
typedef DWORD (CALLBACK *iphlpapi_get_ipforward_table)(PMIB_IPFORWARDTABLE,
|
|
|
|
PULONG,
|
|
|
|
BOOL);
|
|
|
|
|
2006-11-05 09:36:40 +08:00
|
|
|
typedef DWORD (CALLBACK *iphlpapi_get_ipaddr_table)(PMIB_IPADDRTABLE,
|
|
|
|
PULONG,
|
|
|
|
BOOL);
|
|
|
|
|
2005-12-21 07:09:34 +08:00
|
|
|
typedef DWORD (CALLBACK *iphlpapi_get_if_table)(PMIB_IFTABLE,
|
|
|
|
PULONG,
|
|
|
|
BOOL);
|
|
|
|
|
|
|
|
typedef DWORD (CALLBACK *iphlpapi_get_if_entry)(PMIB_IFROW);
|
|
|
|
|
2006-11-06 03:57:51 +08:00
|
|
|
typedef DWORD (CALLBACK *iphlpapi_get_num_if)(PDWORD);
|
|
|
|
|
2005-12-21 07:09:34 +08:00
|
|
|
typedef DWORD (CALLBACK *iphlpapi_get_tcp_table)(PMIB_TCPTABLE,
|
|
|
|
PDWORD,
|
|
|
|
BOOL);
|
|
|
|
|
|
|
|
typedef DWORD (CALLBACK *iphlpapi_get_udp_table)(PMIB_UDPTABLE,
|
|
|
|
PDWORD,
|
|
|
|
BOOL);
|
|
|
|
|
|
|
|
typedef DWORD (CALLBACK *iphlpapi_get_tcpx_table)(PMIB_TCPEXTABLE *,
|
|
|
|
BOOL,
|
|
|
|
HANDLE,
|
|
|
|
DWORD,
|
|
|
|
DWORD);
|
|
|
|
|
|
|
|
typedef DWORD (CALLBACK *iphlpapi_get_udpx_table)(PMIB_UDPEXTABLE *,
|
|
|
|
BOOL,
|
|
|
|
HANDLE,
|
|
|
|
DWORD,
|
|
|
|
DWORD);
|
|
|
|
|
|
|
|
typedef DWORD (CALLBACK *iphlpapi_get_net_params)(PFIXED_INFO,
|
|
|
|
PULONG);
|
|
|
|
|
|
|
|
typedef DWORD (CALLBACK *iphlpapi_get_adapters_info)(PIP_ADAPTER_INFO,
|
|
|
|
PULONG);
|
|
|
|
|
2006-11-06 06:41:11 +08:00
|
|
|
typedef ULONG (CALLBACK *iphlpapi_get_adapters_addrs)(ULONG,
|
|
|
|
ULONG,
|
|
|
|
PVOID,
|
|
|
|
PIP_ADAPTER_ADDRESSES,
|
|
|
|
PULONG);
|
|
|
|
|
2005-12-21 07:09:34 +08:00
|
|
|
/* advapi32.dll */
|
|
|
|
typedef BOOL (CALLBACK *advapi_convert_string_sid)(LPCSTR,
|
|
|
|
PSID *);
|
|
|
|
|
|
|
|
typedef BOOL (CALLBACK *advapi_query_service_status)(SC_HANDLE,
|
|
|
|
SC_STATUS_TYPE,
|
|
|
|
LPBYTE,
|
|
|
|
DWORD,
|
|
|
|
LPDWORD);
|
|
|
|
|
|
|
|
/* ntdll.dll */
|
|
|
|
typedef DWORD (CALLBACK *ntdll_query_sys_info)(DWORD,
|
|
|
|
PVOID,
|
|
|
|
ULONG,
|
|
|
|
PULONG);
|
|
|
|
|
|
|
|
/* psapi.dll */
|
|
|
|
typedef BOOL (CALLBACK *psapi_enum_modules)(HANDLE,
|
|
|
|
HMODULE *,
|
|
|
|
DWORD,
|
|
|
|
LPDWORD);
|
|
|
|
|
|
|
|
typedef DWORD (CALLBACK *psapi_get_module_name)(HANDLE,
|
|
|
|
HMODULE,
|
|
|
|
LPTSTR,
|
|
|
|
DWORD);
|
|
|
|
|
2006-09-09 01:04:10 +08:00
|
|
|
typedef BOOL (CALLBACK *psapi_enum_processes)(DWORD *,
|
|
|
|
DWORD,
|
|
|
|
DWORD *);
|
|
|
|
|
2005-12-21 07:09:34 +08:00
|
|
|
/* winsta.dll */
|
|
|
|
typedef BOOLEAN (CALLBACK *winsta_query_info)(HANDLE,
|
|
|
|
ULONG,
|
|
|
|
WINSTATION_INFO_CLASS,
|
|
|
|
PVOID,
|
|
|
|
ULONG,
|
|
|
|
PULONG);
|
|
|
|
|
2006-07-08 04:29:22 +08:00
|
|
|
/* kernel32.dll */
|
|
|
|
typedef BOOL (CALLBACK *kernel_memory_status)(MEMORYSTATUSEX *);
|
|
|
|
|
2005-12-21 07:09:34 +08:00
|
|
|
#define SIGAR_DLLFUNC(api, name) \
|
|
|
|
struct { \
|
|
|
|
const char *name; \
|
|
|
|
##api##_##name func; \
|
|
|
|
} ##name
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
sigar_dll_handle_t handle;
|
|
|
|
|
|
|
|
SIGAR_DLLFUNC(wtsapi, enum_sessions);
|
|
|
|
SIGAR_DLLFUNC(wtsapi, free_mem);
|
|
|
|
SIGAR_DLLFUNC(wtsapi, query_session);
|
|
|
|
|
|
|
|
sigar_dll_func_t end;
|
|
|
|
} sigar_wtsapi_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
sigar_dll_handle_t handle;
|
|
|
|
|
|
|
|
SIGAR_DLLFUNC(iphlpapi, get_ipforward_table);
|
2006-11-05 09:36:40 +08:00
|
|
|
SIGAR_DLLFUNC(iphlpapi, get_ipaddr_table);
|
2005-12-21 07:09:34 +08:00
|
|
|
SIGAR_DLLFUNC(iphlpapi, get_if_table);
|
|
|
|
SIGAR_DLLFUNC(iphlpapi, get_if_entry);
|
2006-11-06 03:57:51 +08:00
|
|
|
SIGAR_DLLFUNC(iphlpapi, get_num_if);
|
2005-12-21 07:09:34 +08:00
|
|
|
SIGAR_DLLFUNC(iphlpapi, get_tcp_table);
|
|
|
|
SIGAR_DLLFUNC(iphlpapi, get_udp_table);
|
|
|
|
SIGAR_DLLFUNC(iphlpapi, get_tcpx_table);
|
|
|
|
SIGAR_DLLFUNC(iphlpapi, get_udpx_table);
|
|
|
|
SIGAR_DLLFUNC(iphlpapi, get_net_params);
|
|
|
|
SIGAR_DLLFUNC(iphlpapi, get_adapters_info);
|
2006-11-06 06:41:11 +08:00
|
|
|
SIGAR_DLLFUNC(iphlpapi, get_adapters_addrs);
|
2005-12-21 07:09:34 +08:00
|
|
|
|
|
|
|
sigar_dll_func_t end;
|
|
|
|
} sigar_iphlpapi_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
sigar_dll_handle_t handle;
|
|
|
|
|
|
|
|
SIGAR_DLLFUNC(advapi, convert_string_sid);
|
|
|
|
SIGAR_DLLFUNC(advapi, query_service_status);
|
|
|
|
|
|
|
|
sigar_dll_func_t end;
|
|
|
|
} sigar_advapi_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
sigar_dll_handle_t handle;
|
|
|
|
|
|
|
|
SIGAR_DLLFUNC(ntdll, query_sys_info);
|
|
|
|
|
|
|
|
sigar_dll_func_t end;
|
|
|
|
} sigar_ntdll_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
sigar_dll_handle_t handle;
|
|
|
|
|
|
|
|
SIGAR_DLLFUNC(psapi, enum_modules);
|
2006-09-09 01:04:10 +08:00
|
|
|
SIGAR_DLLFUNC(psapi, enum_processes);
|
2005-12-21 07:09:34 +08:00
|
|
|
SIGAR_DLLFUNC(psapi, get_module_name);
|
|
|
|
|
|
|
|
sigar_dll_func_t end;
|
|
|
|
} sigar_psapi_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
sigar_dll_handle_t handle;
|
|
|
|
|
|
|
|
SIGAR_DLLFUNC(winsta, query_info);
|
|
|
|
|
|
|
|
sigar_dll_func_t end;
|
|
|
|
} sigar_winsta_t;
|
|
|
|
|
2006-07-08 04:29:22 +08:00
|
|
|
typedef struct {
|
|
|
|
sigar_dll_handle_t handle;
|
|
|
|
|
|
|
|
SIGAR_DLLFUNC(kernel, memory_status);
|
|
|
|
|
|
|
|
sigar_dll_func_t end;
|
|
|
|
} sigar_kernel_t;
|
|
|
|
|
2004-06-22 06:37:04 +08:00
|
|
|
struct sigar_t {
|
|
|
|
SIGAR_T_BASE;
|
|
|
|
char *machine;
|
|
|
|
int using_wide;
|
|
|
|
long pagesize;
|
|
|
|
HKEY handle;
|
|
|
|
char *perfbuf;
|
|
|
|
DWORD perfbuf_size;
|
2005-12-21 07:09:34 +08:00
|
|
|
sigar_wtsapi_t wtsapi;
|
|
|
|
sigar_iphlpapi_t iphlpapi;
|
|
|
|
sigar_advapi_t advapi;
|
|
|
|
sigar_ntdll_t ntdll;
|
|
|
|
sigar_psapi_t psapi;
|
|
|
|
sigar_winsta_t winsta;
|
2006-07-08 04:29:22 +08:00
|
|
|
sigar_kernel_t kernel;
|
2004-06-22 06:37:04 +08:00
|
|
|
sigar_win32_pinfo_t pinfo;
|
2006-11-03 15:31:53 +08:00
|
|
|
sigar_cache_t *netif_adapters;
|
|
|
|
sigar_cache_t *netif_mib_rows;
|
2006-11-05 10:26:03 +08:00
|
|
|
sigar_cache_t *netif_addr_rows;
|
2006-11-03 15:31:53 +08:00
|
|
|
|
2004-06-22 06:37:04 +08:00
|
|
|
WORD ws_version;
|
|
|
|
int ws_error;
|
|
|
|
LPBYTE peb; //scratch pad for getting peb info
|
|
|
|
int ht_enabled;
|
2004-06-23 03:22:50 +08:00
|
|
|
int lcpu; //number of logical cpus
|
2004-06-23 01:15:10 +08:00
|
|
|
int winnt;
|
2004-06-22 06:37:04 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
int sigar_wsa_init(sigar_t *sigar);
|
|
|
|
|
2004-08-02 04:31:42 +08:00
|
|
|
int sigar_proc_exe_peb_get(sigar_t *sigar, HANDLE proc,
|
|
|
|
sigar_proc_exe_t *procexe);
|
2004-06-22 06:37:04 +08:00
|
|
|
|
2004-08-03 11:06:25 +08:00
|
|
|
int sigar_proc_args_peb_get(sigar_t *sigar, HANDLE proc,
|
|
|
|
sigar_proc_args_t *procargs);
|
2004-07-29 05:47:14 +08:00
|
|
|
|
2004-08-03 11:25:17 +08:00
|
|
|
int sigar_parse_proc_args(sigar_t *sigar, WCHAR *buf,
|
|
|
|
sigar_proc_args_t *procargs);
|
|
|
|
|
2004-06-22 06:37:04 +08:00
|
|
|
unsigned int sigar_cpu_count(sigar_t *sigar);
|
|
|
|
|
|
|
|
int sigar_cpu_info_get(sigar_t *sigar, sigar_cpu_info_t *info);
|
|
|
|
|
2004-08-11 06:24:12 +08:00
|
|
|
#define SIGAR_NO_SUCH_PROCESS (SIGAR_OS_START_ERROR+1)
|
|
|
|
|
2004-06-22 06:37:04 +08:00
|
|
|
#endif /* SIGAR_OS_H */
|