Partially implement NCDGetWirelessMacAddress on Windows as well

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5285 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
NeoBrainX 2010-04-05 20:25:00 +00:00
parent 8549b30170
commit 33a005c801
2 changed files with 24 additions and 8 deletions

View File

@ -51,6 +51,7 @@ it failed)
#include <string>
#ifdef _WIN32
#include <ws2tcpip.h>
#include <iphlpapi.h>
#elif defined(__linux__)
#include <sys/types.h>
#include <sys/socket.h>
@ -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

View File

@ -90,7 +90,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="comctl32.lib rpcrt4.lib winmm.lib wxbase28u.lib wxmsw28u_core.lib wxmsw28u_adv.lib wxmsw28u_aui.lib Bochs_disasm.lib LZO.lib SFML_Network.lib zlib.lib"
AdditionalDependencies="Iphlpapi.lib comctl32.lib rpcrt4.lib winmm.lib wxbase28u.lib wxmsw28u_core.lib wxmsw28u_adv.lib wxmsw28u_aui.lib Bochs_disasm.lib LZO.lib SFML_Network.lib zlib.lib"
OutputFile="../../../Binary/Win32/Dolphin.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
@ -207,7 +207,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="comctl32.lib rpcrt4.lib wxbase28u.lib wxmsw28u_core.lib wxmsw28u_adv.lib wxmsw28u_aui.lib"
AdditionalDependencies="Iphlpapi.lib comctl32.lib rpcrt4.lib wxbase28u.lib wxmsw28u_core.lib wxmsw28u_adv.lib wxmsw28u_aui.lib"
OutputFile="../../../Binary/x64/Dolphin.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
@ -320,7 +320,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/TLBID:1"
AdditionalDependencies="comctl32.lib rpcrt4.lib winmm.lib wxbase28ud.lib wxmsw28ud_core.lib wxmsw28ud_adv.lib wxmsw28ud_aui.lib Bochs_disasm.lib LZO.lib SFML_Network.lib zlib.lib"
AdditionalDependencies="Iphlpapi.lib comctl32.lib rpcrt4.lib winmm.lib wxbase28ud.lib wxmsw28ud_core.lib wxmsw28ud_adv.lib wxmsw28ud_aui.lib Bochs_disasm.lib LZO.lib SFML_Network.lib zlib.lib"
OutputFile="../../../Binary/Win32/DolphinD.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
@ -431,7 +431,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/TLBID:1"
AdditionalDependencies="comctl32.lib rpcrt4.lib winmm.lib wxbase28ud.lib wxmsw28ud_core.lib wxmsw28ud_adv.lib wxmsw28ud_aui.lib"
AdditionalDependencies="Iphlpapi.lib comctl32.lib rpcrt4.lib winmm.lib wxbase28ud.lib wxmsw28ud_core.lib wxmsw28ud_adv.lib wxmsw28ud_aui.lib"
OutputFile="../../../Binary/x64/DolphinD.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
@ -545,7 +545,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/NODEFAULTLIB:msvcrt.lib&#x0D;&#x0A;/NODEFAULTLIB:libcmtd.lib"
AdditionalDependencies="comctl32.lib rpcrt4.lib winmm.lib wxbase28u.lib wxmsw28u_core.lib wxmsw28u_adv.lib wxmsw28u_aui.lib Bochs_disasm.lib LZO.lib SFML_Network.lib zlib.lib"
AdditionalDependencies="Iphlpapi.lib comctl32.lib rpcrt4.lib winmm.lib wxbase28u.lib wxmsw28u_core.lib wxmsw28u_adv.lib wxmsw28u_aui.lib Bochs_disasm.lib LZO.lib SFML_Network.lib zlib.lib"
OutputFile="../../../Binary/Win32/DolphinDF.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
@ -658,7 +658,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="comctl32.lib rpcrt4.lib winmm.lib wxbase28u.lib wxmsw28u_core.lib wxmsw28u_adv.lib wxmsw28u_aui.lib Bochs_disasm.lib LZO.lib SFML_Network.lib zlib.lib"
AdditionalDependencies="Iphlpapi.lib comctl32.lib rpcrt4.lib winmm.lib wxbase28u.lib wxmsw28u_core.lib wxmsw28u_adv.lib wxmsw28u_aui.lib Bochs_disasm.lib LZO.lib SFML_Network.lib zlib.lib"
OutputFile="../../../Binary/x64/DolphinDF.exe"
LinkIncremental="1"
SuppressStartupBanner="true"