From 33a005c8019a1e56e606694979912c407270c81c Mon Sep 17 00:00:00 2001 From: NeoBrainX Date: Mon, 5 Apr 2010 20:25:00 +0000 Subject: [PATCH] Partially implement NCDGetWirelessMacAddress on Windows as well git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5285 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp | 20 +++++++++++++++++-- Source/Core/DolphinWX/DolphinWX.vcproj | 12 +++++------ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp index dda36fcede..07c18d373d 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp @@ -51,6 +51,7 @@ it failed) #include #ifdef _WIN32 #include +#include #elif defined(__linux__) #include #include @@ -311,9 +312,24 @@ bool CWII_IPC_HLE_Device_net_ncd_manage::IOCtlV(u32 _CommandAddress) } close(fd); -//#elif defined(WIN32) -// TODO +#elif defined(WIN32) + IP_ADAPTER_INFO *adapter_info = NULL; + DWORD len = 0; + DWORD ret = GetAdaptersInfo(adapter_info, &len); + if (ret != ERROR_BUFFER_OVERFLOW || !len) + { + Memory::WriteBigEData(default_address, CommandBuffer.PayloadBuffer.at(1).m_Address, 4); + break; + } + + adapter_info = new IP_ADAPTER_INFO[len / sizeof(IP_ADAPTER_INFO)]; + ret = GetAdaptersInfo(adapter_info, &len); + + if (SUCCEEDED(ret)) Memory::WriteBigEData(adapter_info->Address, CommandBuffer.PayloadBuffer.at(1).m_Address, 4); + else Memory::WriteBigEData(default_address, CommandBuffer.PayloadBuffer.at(1).m_Address, 4); + + delete[] adapter_info; #else Memory::WriteBigEData(default_address, CommandBuffer.PayloadBuffer.at(1).m_Address, 4); #endif diff --git a/Source/Core/DolphinWX/DolphinWX.vcproj b/Source/Core/DolphinWX/DolphinWX.vcproj index 7f008945ca..5701b05a83 100644 --- a/Source/Core/DolphinWX/DolphinWX.vcproj +++ b/Source/Core/DolphinWX/DolphinWX.vcproj @@ -90,7 +90,7 @@ />