api: make architecture-dependent wintun.dll selection an explicit select
Suggested-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
8b0409ce2a
commit
44568f81cb
@ -1363,9 +1363,21 @@ ExecuteRunDll32(
|
|||||||
Result = ERROR_BUFFER_OVERFLOW;
|
Result = ERROR_BUFFER_OVERFLOW;
|
||||||
goto cleanupDirectory;
|
goto cleanupDirectory;
|
||||||
}
|
}
|
||||||
if ((Result = ResourceCopyToFile(
|
const WCHAR *WintunDllResourceName;
|
||||||
DllPath, NativeMachine == IMAGE_FILE_MACHINE_ARM64 ? L"wintun-arm64.dll" : L"wintun-amd64.dll")) !=
|
switch (NativeMachine)
|
||||||
ERROR_SUCCESS)
|
{
|
||||||
|
case IMAGE_FILE_MACHINE_AMD64:
|
||||||
|
WintunDllResourceName = L"wintun-amd64.dll";
|
||||||
|
break;
|
||||||
|
case IMAGE_FILE_MACHINE_ARM64:
|
||||||
|
WintunDllResourceName = L"wintun-arm64.dll";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
LOG(WINTUN_LOG_ERR, L"Failed to copy resource");
|
||||||
|
Result = ERROR_NOT_SUPPORTED;
|
||||||
|
goto cleanupDirectory;
|
||||||
|
}
|
||||||
|
if ((Result = ResourceCopyToFile(DllPath, WintunDllResourceName)) != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
LOG(WINTUN_LOG_ERR, L"Failed to copy resource");
|
LOG(WINTUN_LOG_ERR, L"Failed to copy resource");
|
||||||
goto cleanupDelete;
|
goto cleanupDelete;
|
||||||
|
Loading…
Reference in New Issue
Block a user