GH #328: NetworkInterface on Windows XP

This commit is contained in:
Alex Fabijanic
2014-05-10 14:32:45 -05:00
parent 8cbaa4ec4d
commit ceef0c64ad
5 changed files with 178 additions and 18 deletions

View File

@@ -24,31 +24,55 @@
#include "Poco/UnWindows.h"
// determine the real version
#if defined(_WIN32_WINNT_WIN8)
// Determine the real version.
// This setting can be forced from UnWindows.h
#if defined (_WIN32_WINNT_WINBLUE)
//Windows 8.1 _WIN32_WINNT_WINBLUE (0x0602)
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT _WIN32_WINNT_WINBLUE
#ifdef NTDDI_VERSION
#undef NTDDI_VERSION
#endif
#define NTDDI_VERSION NTDDI_WINBLUE
#elif defined (_WIN32_WINNT_WIN8)
//Windows 8 _WIN32_WINNT_WIN8 (0x0602)
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT _WIN32_WINNT_WIN8
#elif defined(_WIN32_WINNT_WIN7)
#ifdef NTDDI_VERSION
#undef NTDDI_VERSION
#endif
#define NTDDI_VERSION NTDDI_WIN8
#elif defined (_WIN32_WINNT_WIN7)
//Windows 7 _WIN32_WINNT_WIN7 (0x0601)
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT _WIN32_WINNT_WIN7
#ifndef NTDDI_VERSION
#define NTDDI_VERSION NTDDI_WIN7
#endif
#elif defined (_WIN32_WINNT_WS08)
//Windows Server 2008 _WIN32_WINNT_WS08 (0x0600)
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT _WIN32_WINNT_WS08
#ifndef NTDDI_VERSION
#define NTDDI_VERSION NTDDI_WS08
#endif
#elif defined (_WIN32_WINNT_VISTA)
//Windows Vista _WIN32_WINNT_VISTA (0x0600)
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT _WIN32_WINNT_VISTA
#ifndef NTDDI_VERSION
#define NTDDI_VERSION NTDDI_VISTA
#endif
#elif defined (_WIN32_WINNT_LONGHORN)
//Windows Vista and server 2008 Development _WIN32_WINNT_LONGHORN (0x0600)
#ifdef _WIN32_WINNT
@@ -62,12 +86,18 @@
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT _WIN32_WINNT_WS03
#ifndef NTDDI_VERSION
#define NTDDI_VERSION NTDDI_WS03
#endif
#elif defined (_WIN32_WINNT_WINXP)
//Windows Server 2003, Windows XP _WIN32_WINNT_WINXP (0x0501)
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT _WIN32_WINNT_WINXP
#ifndef NTDDI_VERSION
#define NTDDI_VERSION NTDDI_WINXP
#endif
#elif defined (_WIN32_WINNT_WIN2K)
//Windows 2000 _WIN32_WINNT_WIN2K (0x0500)
#ifdef _WIN32_WINNT
@@ -75,10 +105,18 @@
#endif
#define _WIN32_WINNT _WIN32_WINNT_WIN2K
#elif defined (WINVER)
// fail back on WINVER
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT WINVER
#elif !defined(_WIN32_WINNT)
// last resort = Win XP, SP1 is minimum supported
#define _WIN32_WINNT 0x0501
#ifdef NTDDI_VERSION
#undef NTDDI_VERSION
#endif
#define NTDDI_VERSION 0x05010100
#endif

View File

@@ -47,11 +47,29 @@
#endif
// Microsoft Visual C++ includes copies of the Windows header files
// that were current at the time Visual C++ was released.
// The Windows header files use macros to indicate which versions
// of Windows support many programming elements. Therefore, you must
// define these macros to use new functionality introduced in each
// major operating system release. (Individual header files may use
// different macros; therefore, if compilation problems occur, check
// the header file that contains the definition for conditional
// definitions.) For more information, see SdkDdkVer.h.
#if defined(_WIN32_WINNT) && (_WIN32_WINNT < 0x0501)
#error Unsupported Windows version.
#elif defined(NTDDI_VERSION) && (NTDDI_VERSION < 0x05010100)
#error Unsupported Windows version.
#elif !defined(_WIN32_WINNT)
// define minimum supported
// Define minimum supported version.
// This can be changed, if needed.
// Otherwise, the Platform_WIN32.h will do
// its best to determine the appropriate values
// and may redefine these. See Platform_WIN32.h
// for details.
#define _WIN32_WINNT 0x0501
#define NTDDI_VERSION 0x05010100
#endif