static DWORD (__stdcall *zbx_GetGuiResources)(HANDLE, DWORD) = NULL;
static BOOL (__stdcall *zbx_GetProcessIoCounters)(HANDLE, PIO_COUNTERS) = NULL;
static BOOL (__stdcall *zbx_GetPerformanceInfo)(PPERFORMANCE_INFORMATION, DWORD) = NULL;
static BOOL (__stdcall *zbx_GlobalMemoryStatusEx)(LPMEMORYSTATUSEX) = NULL;
static BOOL (__stdcall *zbx_GetFileInformationByHandleEx)(HANDLE, zbx_file_info_by_handle_class_t, LPVOID, DWORD) =
GetGuiResources_t zbx_get_GetGuiResources(void)
return zbx_GetGuiResources;
GetProcessIoCounters_t zbx_get_GetProcessIoCounters(void)
return zbx_GetProcessIoCounters;
GetPerformanceInfo_t zbx_get_GetPerformanceInfo(void)
return zbx_GetPerformanceInfo;
GlobalMemoryStatusEx_t zbx_get_GlobalMemoryStatusEx(void)
return zbx_GlobalMemoryStatusEx;
GetFileInformationByHandleEx_t zbx_get_GetFileInformationByHandleEx(void)
return zbx_GetFileInformationByHandleEx;
static FARPROC GetProcAddressAndLog(HMODULE hModule, const char *procName)
if (NULL == (ptr = GetProcAddress(hModule, procName)))
zabbix_log(LOG_LEVEL_DEBUG, "unable to resolve symbol '%s'", procName);
void zbx_import_symbols(void)
if (NULL != (hModule = GetModuleHandle(TEXT("USER32.DLL"))))
zbx_GetGuiResources = (DWORD (__stdcall *)(HANDLE, DWORD))GetProcAddressAndLog(hModule, "GetGuiResources");
zabbix_log(LOG_LEVEL_DEBUG, "unable to get handle to USER32.DLL");
if (NULL != (hModule = GetModuleHandle(TEXT("KERNEL32.DLL"))))
zbx_GetProcessIoCounters = (BOOL (__stdcall *)(HANDLE, PIO_COUNTERS))GetProcAddressAndLog(hModule,
zbx_GlobalMemoryStatusEx = (BOOL (__stdcall *)(LPMEMORYSTATUSEX))GetProcAddressAndLog(hModule,
zbx_GetFileInformationByHandleEx = (BOOL (__stdcall *)(HANDLE, zbx_file_info_by_handle_class_t, LPVOID,
DWORD))GetProcAddressAndLog(hModule, "GetFileInformationByHandleEx");
zabbix_log(LOG_LEVEL_DEBUG, "unable to get handle to KERNEL32.DLL");
if (NULL != (hModule = GetModuleHandle(TEXT("PSAPI.DLL"))))
zbx_GetPerformanceInfo = (BOOL (__stdcall *)(PPERFORMANCE_INFORMATION, DWORD))
GetProcAddressAndLog(hModule, "GetPerformanceInfo");
zabbix_log(LOG_LEVEL_DEBUG, "unable to get handle to PSAPI.DLL");