sysdeps/win32.c: Drop manual WTSAPI definitions, they are part of MinGW w32api 3.14 and newer

sysdeps/win32.c: Silence compiler warnings (unsigned char vs. char in sensors code)
This commit is contained in:
Stefan Gehn 2009-12-30 14:56:17 +00:00
parent 25076e8a0f
commit 7db73ae16d
1 changed files with 9 additions and 22 deletions

View File

@ -54,6 +54,10 @@
#include <ntdef.h> #include <ntdef.h>
#include <ntsecapi.h> #include <ntsecapi.h>
#if _WIN32_WINNT >= 0x501 // Windows XP or newer
#include <wtsapi32.h>
#endif // _WIN32_WINNT >= 0x501
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Needed to determine pagefile usage // Needed to determine pagefile usage
@ -678,7 +682,7 @@ gkrellm_sys_sensors_mbm_init(void)
gkrellm_sensors_add_sensor(SENSOR_TEMPERATURE, /*sensor_path*/NULL, gkrellm_sensors_add_sensor(SENSOR_TEMPERATURE, /*sensor_path*/NULL,
/*id_name*/id_name, /*id*/i, /*iodev*/0, /*id_name*/id_name, /*id*/i, /*iodev*/0,
/*inter*/MBM_INTERFACE, /*factor*/1, /*offset*/0, /*inter*/MBM_INTERFACE, /*factor*/1, /*offset*/0,
/*vref*/NULL, /*default_label*/pSensor->ssName); /*vref*/NULL, /*default_label*/(gchar *)pSensor->ssName);
g_free(id_name); g_free(id_name);
++tempCount; ++tempCount;
@ -689,7 +693,7 @@ gkrellm_sys_sensors_mbm_init(void)
gkrellm_sensors_add_sensor(SENSOR_VOLTAGE, /*sensor_path*/NULL, gkrellm_sensors_add_sensor(SENSOR_VOLTAGE, /*sensor_path*/NULL,
/*id_name*/id_name, /*id*/i, /*iodev*/0, /*id_name*/id_name, /*id*/i, /*iodev*/0,
/*inter*/MBM_INTERFACE, /*factor*/1, /*offset*/0, /*inter*/MBM_INTERFACE, /*factor*/1, /*offset*/0,
/*vref*/NULL, /*default_label*/pSensor->ssName); /*vref*/NULL, /*default_label*/(gchar *)pSensor->ssName);
g_free(id_name); g_free(id_name);
++voltCount; ++voltCount;
@ -700,7 +704,7 @@ gkrellm_sys_sensors_mbm_init(void)
gkrellm_sensors_add_sensor(SENSOR_FAN, /*sensor_path*/NULL, gkrellm_sensors_add_sensor(SENSOR_FAN, /*sensor_path*/NULL,
/*id_name*/id_name, /*id*/i, /*iodev*/0, /*id_name*/id_name, /*id*/i, /*iodev*/0,
/*inter*/MBM_INTERFACE, /*factor*/1, /*offset*/0, /*inter*/MBM_INTERFACE, /*factor*/1, /*offset*/0,
/*vref*/NULL, /*default_label*/pSensor->ssName); /*vref*/NULL, /*default_label*/(gchar *)pSensor->ssName);
g_free(id_name); g_free(id_name);
fanCount++; fanCount++;
@ -1483,23 +1487,6 @@ gkrellm_sys_proc_read_data(void)
} }
#if _WIN32_WINNT >= 0x501 // Windows XP or newer
#include <wtsapi32.h>
typedef struct _WTS_SESSION_INFO {
DWORD SessionId;
LPTSTR pWinStationName;
WTS_CONNECTSTATE_CLASS State;
} WTS_SESSION_INFO, *PWTS_SESSION_INFO;
BOOL WINAPI WTSEnumerateSessionsW(
HANDLE hServer,
DWORD Reserved,
DWORD Version,
PWTS_SESSION_INFO *ppSessionInfo,
DWORD *pCount);
#endif // _WIN32_WINNT >= 0x501
void void
gkrellm_sys_proc_read_users(void) gkrellm_sys_proc_read_users(void)
{ {
@ -1509,9 +1496,9 @@ gkrellm_sys_proc_read_users(void)
#if _WIN32_WINNT >= 0x501 // Windows XP or newer #if _WIN32_WINNT >= 0x501 // Windows XP or newer
BOOL ret; BOOL ret;
WTS_SESSION_INFO *pSessionList = NULL; WTS_SESSION_INFOW *pSessionList = NULL;
DWORD sessionListCount = 0; DWORD sessionListCount = 0;
WTS_SESSION_INFO *pSession = NULL; WTS_SESSION_INFOW *pSession = NULL;
gkrellm_debug(DEBUG_SYSDEP, "Enumerating terminal sessions...\n"); gkrellm_debug(DEBUG_SYSDEP, "Enumerating terminal sessions...\n");
// Returns list of terminal sessions in pSessionInfo[] // Returns list of terminal sessions in pSessionInfo[]