|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
index 83548d1..d9f80eb 100644
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
--- a/src/CMakeLists.txt
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+++ b/src/CMakeLists.txt
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
@@ -4,6 +4,29 @@ MESSAGE(STATUS "CMAKE_SYSTEM_NAME is ${CMAKE_SYSTEM_NAME}")
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
INCLUDE_DIRECTORIES(../include/)
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+INCLUDE(CheckCSourceCompiles)
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+MACRO (CHECK_STRUCT_MEMBER _STRUCT _MEMBER _HEADER _RESULT)
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+ SET(_INCLUDE_FILES)
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+ FOREACH (it ${_HEADER})
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+ SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+ ENDFOREACH (it)
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+ SET(_CHECK_STRUCT_MEMBER_SOURCE_CODE "
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+${_INCLUDE_FILES}
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+int main()
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+{
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+ static ${_STRUCT} tmp;
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+ if (sizeof(tmp.${_MEMBER}))
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+ return 0;
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+ return 0;
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+}
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+")
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+ CHECK_C_SOURCE_COMPILES("${_CHECK_STRUCT_MEMBER_SOURCE_CODE}" ${_RESULT})
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+ENDMACRO (CHECK_STRUCT_MEMBER)
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
## linux
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
SET(SIGAR_SRC os/linux/linux_sigar.c)
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
@@ -60,6 +83,8 @@ IF(WIN32)
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
ADD_DEFINITIONS(-DSIGAR_SHARED)
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
SET(SIGAR_SRC os/win32/peb.c os/win32/win32_sigar.c)
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
INCLUDE_DIRECTORIES(os/win32)
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+ CHECK_STRUCT_MEMBER(MIB_IPADDRROW wType "windows.h;iphlpapi.h" wType_in_MIB_IPADDRROW)
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+ add_definitions(-DHAVE_MIB_IPADDRROW_WTYPE=${wType_in_MIB_IPADDRROW})
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
ENDIF(WIN32)
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
SET(SIGAR_SRC ${SIGAR_SRC}
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
diff --git a/src/os/win32/sigar_os.h b/src/os/win32/sigar_os.h
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
index ff2de7c..cd3c7e8 100755
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
--- a/src/os/win32/sigar_os.h
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+++ b/src/os/win32/sigar_os.h
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
@@ -19,11 +19,15 @@
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#ifndef SIGAR_OS_H
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#define SIGAR_OS_H
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+#ifdef MSVC
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#if _MSC_VER <= 1200
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#define SIGAR_USING_MSC6 /* Visual Studio version 6 */
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#endif
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+#else
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+/* Cross compiling */
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+#define _WIN32_WINNT 0x0501
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+#endif
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
-#define WIN32_LEAN_AND_MEAN
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#include <windows.h>
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#include <winreg.h>
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#include <winperf.h>
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
@@ -38,7 +42,22 @@
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#include "sigar_util.h"
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
-#define INT64_C(val) val##i64
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+#ifdef MSVC
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+# define INT64_C(val) val##i64
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+# define SIGAR_DLLFUNC(api, name) \
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+ struct { \
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+ const char *name; \
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+ ##api##_##name func; \
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+ } ##name
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+#else
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+/* The GCC compiler doesn't require/accept the ## prefix */
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+# define INT64_C(val) val##L
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+# define SIGAR_DLLFUNC(api, name) \
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+ struct { \
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+ const char *name; \
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+ api##_##name func; \
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+ } name
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+#endif
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
/* see apr/include/arch/win32/atime.h */
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#define EPOCH_DELTA INT64_C(11644473600000000)
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
@@ -457,12 +476,6 @@ typedef BOOL (CALLBACK *mpr_get_net_connection)(LPCTSTR,
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
LPTSTR,
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
LPDWORD);
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
-#define SIGAR_DLLFUNC(api, name) \
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
- struct { \
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
- const char *name; \
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
- ##api##_##name func; \
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
- } ##name
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
-
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
typedef struct {
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
sigar_dll_handle_t handle;
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
diff --git a/src/os/win32/win32_sigar.c b/src/os/win32/win32_sigar.c
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
index b9a5669..74bf874 100755
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
--- a/src/os/win32/win32_sigar.c
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+++ b/src/os/win32/win32_sigar.c
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
@@ -23,6 +23,7 @@
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#include "sigar_util.h"
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#include "sigar_format.h"
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#include <shellapi.h>
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+#include <iphlpapi.h>
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#define USING_WIDE_S(s) (s)->using_wide
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#define USING_WIDE() USING_WIDE_S(sigar)
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
@@ -124,6 +125,9 @@ typedef enum {
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#define MS_LOOPBACK_ADAPTER "Microsoft Loopback Adapter"
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#define NETIF_LA "la"
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+static int get_proc_info(sigar_t *sigar, sigar_pid_t pid);
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+static int netif_hash(char *s);
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
sigar_uint64_t sigar_FileTimeToTime(FILETIME *ft)
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
{
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
sigar_uint64_t time;
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
@@ -374,6 +378,7 @@ static sigar_mpr_t sigar_mpr = {
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
{ NULL, NULL }
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
};
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+#ifdef MSVC
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#define DLLMOD_COPY(name) \
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
memcpy(&(sigar->##name), &sigar_##name, sizeof(sigar_##name))
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
@@ -382,6 +387,18 @@ static sigar_mpr_t sigar_mpr = {
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#define DLLMOD_FREE(name) \
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
sigar_dllmod_free((sigar_dll_module_t *)&(sigar->##name))
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+#else
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+/* The GCC compiler doesn't require/accept the ## prefix */
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+#define DLLMOD_COPY(name) \
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+ memcpy(&(sigar->name), &sigar_##name, sizeof(sigar_##name))
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+#define DLLMOD_INIT(name, all) \
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+ sigar_dllmod_init(sigar, (sigar_dll_module_t *)&(sigar->name), all)
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+#define DLLMOD_FREE(name) \
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+ sigar_dllmod_free((sigar_dll_module_t *)&(sigar->name))
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+#endif
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
static void sigar_dllmod_free(sigar_dll_module_t *module)
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
{
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
@@ -1470,7 +1487,9 @@ static int sigar_remote_proc_args_get(sigar_t *sigar, sigar_pid_t pid,
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
}
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
/* likely we are 32-bit, pid process is 64-bit */
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+#ifdef MSVC
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
status = sigar_proc_args_wmi_get(sigar, pid, procargs);
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+#endif
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
if (status == ERROR_NOT_FOUND) {
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
status = SIGAR_NO_SUCH_PROCESS;
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
}
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
@@ -1507,7 +1526,7 @@ static int sigar_proc_env_parse(UCHAR *ptr, sigar_proc_env_t *procenv,
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
break; /*XXX*/
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
}
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
- klen = val - ptr;
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+ klen = val - (char*)ptr;
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
SIGAR_SSTRCPY(key, ptr);
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
key[klen] = '\0';
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
++val;
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
@@ -1640,6 +1659,7 @@ SIGAR_DECLARE(int) sigar_proc_exe_get(sigar_t *sigar, sigar_pid_t pid,
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
}
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
status = sigar_proc_exe_peb_get(sigar, proc, procexe);
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+#ifdef MSVC
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
if (procexe->name[0] == '\0') {
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
/* likely we are 32-bit, pid process is 64-bit */
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
/* procexe->cwd[0] = XXX where else can we try? */
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
@@ -1648,7 +1668,7 @@ SIGAR_DECLARE(int) sigar_proc_exe_get(sigar_t *sigar, sigar_pid_t pid,
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
status = SIGAR_NO_SUCH_PROCESS;
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
}
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
}
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
-
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+#endif
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
if (procexe->cwd[0] != '\0') {
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
/* strip trailing '\' */
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
int len = strlen(procexe->cwd);
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
@@ -2394,10 +2414,10 @@ static int sigar_get_netif_ipaddr(sigar_t *sigar,
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
MIB_IPADDRROW *row = &mib->table[i];
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
short type;
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
-#ifdef SIGAR_USING_MSC6
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
- type = row->unused2;
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
-#else
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+#if HAVE_MIB_IPADDRROW_WTYPE
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
type = row->wType;
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+#else
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+ type = row->unused2;
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#endif
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
if (!(type & MIB_IPADDR_PRIMARY)) {
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
continue;
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
diff --git a/tests/t_sigar_fs.c b/tests/t_sigar_fs.c
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
index f298a08..7a554de 100644
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
--- a/tests/t_sigar_fs.c
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+++ b/tests/t_sigar_fs.c
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
@@ -39,7 +39,7 @@
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#include <stdio.h>
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#include <string.h>
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#include <errno.h>
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
-#if defined(_WIN32)
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+#if defined(MSVC)
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#include <WinError.h>
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#endif
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
@@ -85,7 +85,7 @@ TEST(test_sigar_file_system_list_get) {
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
} else {
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
switch (ret) {
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
/* track the expected error code */
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
-#if defined(_WIN32)
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+#if defined(MSVC)
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
case ERROR_NOT_READY:
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
break;
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#endif
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
diff --git a/tests/t_sigar_proc.c b/tests/t_sigar_proc.c
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
index 88a9ac7..334bae3 100644
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
--- a/tests/t_sigar_proc.c
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+++ b/tests/t_sigar_proc.c
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
@@ -39,7 +39,7 @@
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#include <stdio.h>
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#include <string.h>
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#include <errno.h>
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
-#if defined(_WIN32)
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+#if defined(MSVC)
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#include <WinError.h>
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#endif
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
@@ -127,7 +127,7 @@ TEST(test_sigar_proc_list_get) {
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
switch (ret) {
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
case EPERM:
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
case ESRCH:
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
-#if (defined(_WIN32))
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
+#if (defined(MSVC))
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
/* OpenProcess() may return ERROR_ACCESS_DENIED */
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
case ERROR_ACCESS_DENIED:
|
|
![](https://seccdn.libravatar.org/avatar/b281c3a5a9608f2c28e8f19c1e6a879358ffc8a2f8010375ead79f10f0a844a4?s=16&d=retro) |
fb9ae34 |
#endif
|