mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 16:32:39 +00:00
fixed sceNetGetMacAddress for linux/mac
This commit is contained in:
parent
23c4529ee5
commit
17f01ff063
@ -16,6 +16,8 @@
|
|||||||
#include "core/libraries/error_codes.h"
|
#include "core/libraries/error_codes.h"
|
||||||
#include "core/libraries/libs.h"
|
#include "core/libraries/libs.h"
|
||||||
#include "core/libraries/network/net.h"
|
#include "core/libraries/network/net.h"
|
||||||
|
#include "core/libraries/network/netctl.h"
|
||||||
|
#include "core/libraries/network/net_util.h"
|
||||||
|
|
||||||
#include "net_error.h"
|
#include "net_error.h"
|
||||||
#include "netctl.h"
|
#include "netctl.h"
|
||||||
@ -744,18 +746,10 @@ int PS4_SYSV_ABI sceNetGetMacAddress(Libraries::NetCtl::OrbisNetEtherAddr* addr,
|
|||||||
LOG_ERROR(Lib_Net, "addr is null!");
|
LOG_ERROR(Lib_Net, "addr is null!");
|
||||||
return ORBIS_NET_EINVAL;
|
return ORBIS_NET_EINVAL;
|
||||||
}
|
}
|
||||||
#ifdef _WIN32
|
auto* netinfo = Common::Singleton<NetUtil::NetUtilInternal>::Instance();
|
||||||
IP_ADAPTER_INFO AdapterInfo[16];
|
netinfo->RetrieveEthernetAddr();
|
||||||
DWORD dwBufLen = sizeof(AdapterInfo);
|
memcpy(addr->data, netinfo->GetEthernetAddr().data(), 6);
|
||||||
if (GetAdaptersInfo(AdapterInfo, &dwBufLen) != ERROR_SUCCESS) {
|
|
||||||
LOG_ERROR(Lib_Net, "Can't retrieve adapter info");
|
|
||||||
return ORBIS_NET_EINVAL;
|
|
||||||
} else {
|
|
||||||
memcpy(addr->data, AdapterInfo[0].Address, 6);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
LOG_ERROR(Lib_Net, "FixMe no support for MacOS,linux");
|
|
||||||
#endif
|
|
||||||
return ORBIS_OK;
|
return ORBIS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user