Handle the WSL optional component not being present in Spring Creators Update where wslapi.dll is always present (#26)
This commit is contained in:
Родитель
e9a4504514
Коммит
5bd3f2fc97
|
@ -198,7 +198,13 @@ int wmain(int argc, wchar_t const *argv[])
|
|||
|
||||
// If an error was encountered, print an error message.
|
||||
if (FAILED(hr)) {
|
||||
Helpers::PrintErrorMessage(hr);
|
||||
if (hr == HRESULT_FROM_WIN32(ERROR_LINUX_SUBSYSTEM_NOT_PRESENT)) {
|
||||
Helpers::PrintMessage(MSG_MISSING_OPTIONAL_COMPONENT);
|
||||
|
||||
} else {
|
||||
Helpers::PrintErrorMessage(hr);
|
||||
}
|
||||
|
||||
if (prompt) {
|
||||
Helpers::PromptForInput();
|
||||
}
|
||||
|
|
|
@ -6,6 +6,11 @@
|
|||
#pragma once
|
||||
#include <wslapi.h>
|
||||
|
||||
// This error definition is present in the Spring Creators Update SDK.
|
||||
#ifndef ERROR_LINUX_SUBSYSTEM_NOT_PRESENT
|
||||
#define ERROR_LINUX_SUBSYSTEM_NOT_PRESENT 414L
|
||||
#endif // !ERROR_LINUX_SUBSYSTEM_NOT_PRESENT
|
||||
|
||||
typedef BOOL (STDAPICALLTYPE* WSL_IS_DISTRIBUTION_REGISTERED)(PCWSTR);
|
||||
typedef HRESULT (STDAPICALLTYPE* WSL_REGISTER_DISTRIBUTION)(PCWSTR, PCWSTR);
|
||||
typedef HRESULT (STDAPICALLTYPE* WSL_CONFIGURE_DISTRIBUTION)(PCWSTR, ULONG, WSL_DISTRIBUTION_FLAGS);
|
||||
|
|
Загрузка…
Ссылка в новой задаче