From 866e1275101386faf7dcb156156f5fe083f810ba Mon Sep 17 00:00:00 2001 From: LPFaint99 Date: Wed, 19 May 2010 03:23:01 +0000 Subject: [PATCH] Fixes wiimenu on 32bit caused by not allocating enough memory for GetAdaptersInfo. Fixes issue 2672. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5459 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 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 36d2bde4e9..72d64c9987 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 @@ -312,7 +312,7 @@ bool CWII_IPC_HLE_Device_net_ncd_manage::IOCtlV(u32 _CommandAddress) } close(fd); -#elif defined(WIN32) +#elif defined(_WIN32) IP_ADAPTER_INFO *adapter_info = NULL; DWORD len = 0; @@ -323,7 +323,8 @@ bool CWII_IPC_HLE_Device_net_ncd_manage::IOCtlV(u32 _CommandAddress) break; } - adapter_info = new IP_ADAPTER_INFO[len / sizeof(IP_ADAPTER_INFO)]; + // LPFaint99: len is sizeof(IP_ADAPTER_INFO) * nics - 0x20 + adapter_info = new IP_ADAPTER_INFO[(len / sizeof(IP_ADAPTER_INFO)) + 1]; ret = GetAdaptersInfo(adapter_info, &len); if (SUCCEEDED(ret)) Memory::WriteBigEData(adapter_info->Address, CommandBuffer.PayloadBuffer.at(1).m_Address, 4);