I'm trying to edit PluginSysInfo from the Rainmeter API to include IPv6 support. I have modified the code from SysInfo.cpp to do so as far as I know the included link has the edits I've made to SysInfo.cpp.
When I build it in Visual Studio "identifier GetTcp6Table undefined" and "identifier PMIB_IP6TABLE undefined" even though they are in the include file #include <WinSock2.h>.
#include <algorithm>
#include <windows.h>
#include <WinSock2.h>
...
MEASURE_IP6_ADDRESS
...
else if (_wcsicmp(L"IP6_ADDRESS", type) == 0)
{
defaultData = 0;
measure->type = MEASURE_IP6_ADDRESS;
}
...
case MEASURE_IP6_ADDRESS:
if (NO_ERROR == GetTcp6Table((PMIB_IP6TABLE)tmpBuffer, &tmpBufferLen, FALSE))
{
PMIB_IP6TABLE TcpTable = (PMIB_IP6TABLE)tmpBuffer;
if (measure->useBestInterface)
{
for (UINT i = 0; i < TcpTable->dwNumEntries; ++i)
{
if (TcpTable->table[i].dwIndex == measure->data)
{
DWORD ip = TcpTable->table[i].dwAddr;
wsprintf(sBuffer, L"%x:%x:%x:%x"/*:%x:%x:%x:%x"*/, ip % 65535, (ip >> 8) % 65535, (ip >> 16) % 65535, (ip >> 24) % 65535);
return sBuffer;
}
}
}