summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <remko@synopsys.com>2011-09-30 17:10:20 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-09-30 17:15:59 (GMT)
commit75818abb4baa26649baf8d3bf6709aefcda7195f (patch)
tree25cf8cc224100688d813ab57f3ccf32771f1bdf1 /Swiften/Network/WindowsNetworkEnvironment.cpp
parenta98f648f5cfbf474c566bd63193047e5381e7d5e (diff)
downloadswift-contrib-75818abb4baa26649baf8d3bf6709aefcda7195f.zip
swift-contrib-75818abb4baa26649baf8d3bf6709aefcda7195f.tar.bz2
Fixed some Windows issues with FT.
Diffstat (limited to 'Swiften/Network/WindowsNetworkEnvironment.cpp')
-rw-r--r--Swiften/Network/WindowsNetworkEnvironment.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Swiften/Network/WindowsNetworkEnvironment.cpp b/Swiften/Network/WindowsNetworkEnvironment.cpp
index a202015..20f559d 100644
--- a/Swiften/Network/WindowsNetworkEnvironment.cpp
+++ b/Swiften/Network/WindowsNetworkEnvironment.cpp
@@ -23,19 +23,19 @@ namespace Swift {
std::vector<NetworkInterface> WindowsNetworkEnvironment::getNetworkInterfaces() const {
std::vector<NetworkInterface> result;
- std::vector<IP_ADAPTER_ADDRESSES> adapters;
+ ByteArray adapters;
ULONG bufferSize = 0;
ULONG ret;
ULONG flags = GAA_FLAG_INCLUDE_ALL_INTERFACES | GAA_FLAG_INCLUDE_PREFIX | GAA_FLAG_SKIP_MULTICAST | GAA_FLAG_SKIP_DNS_SERVER;
- while ((ret = GetAdaptersAddresses(AF_UNSPEC, flags, NULL, vecptr(adapters), &bufferSize)) == ERROR_BUFFER_OVERFLOW) {
- adapters.resize(bufferSize / sizeof(IP_ADAPTER_ADDRESSES));
+ while ((ret = GetAdaptersAddresses(AF_UNSPEC, flags, NULL, reinterpret_cast<IP_ADAPTER_ADDRESSES*>(vecptr(adapters)), &bufferSize)) == ERROR_BUFFER_OVERFLOW) {
+ adapters.resize(bufferSize);
};
if (ret != ERROR_SUCCESS) {
return result;
}
std::map<std::string,NetworkInterface> interfaces;
- for (IP_ADAPTER_ADDRESSES* adapter = vecptr(adapters); adapter; adapter = adapter->Next) {
+ for (IP_ADAPTER_ADDRESSES* adapter = reinterpret_cast<IP_ADAPTER_ADDRESSES*>(vecptr(adapters)); adapter; adapter = adapter->Next) {
std::string name(adapter->AdapterName);
if (adapter->OperStatus != IfOperStatusUp) {
continue;