Bug 1697282 - Make the repo buildable without MOZ_LAUNCHER_PROCESS. r=aklotz

This patch makes sure the repo can be built without `MOZ_LAUNCHER_PROCESS`.

- Compile WinTokenUtils.cpp under winlaucher regardless of `MOZ_LAUNCHER_PROCESS`
  because we still need `IsAdminWithoutUac`.
- Skip TestDllBlocklist.NoOpEntryPoint GTest because the `RedirectToNoOpEntryPoint`
  feature is only available with the new blocklist with the launcher process.

Differential Revision: https://phabricator.services.mozilla.com/D108142
This commit is contained in:
Toshihito Kikuchi 2021-03-12 23:38:01 +00:00
Родитель fdbb88c4cf
Коммит 2279f22a3f
2 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -10,6 +10,7 @@ FORCE_STATIC_LIB = True
UNIFIED_SOURCES += [
"/ipc/mscom/ProcessRuntime.cpp",
"/toolkit/xre/WinTokenUtils.cpp",
"/widget/windows/WindowsConsole.cpp",
"DllBlocklistInit.cpp",
"ErrorHandler.cpp",
@ -40,7 +41,6 @@ TEST_DIRS += [
if CONFIG["MOZ_LAUNCHER_PROCESS"]:
UNIFIED_SOURCES += [
"/toolkit/xre/LauncherRegistryInfo.cpp",
"/toolkit/xre/WinTokenUtils.cpp",
]
for var in ("MOZ_APP_BASENAME", "MOZ_APP_VENDOR"):
DEFINES[var] = '"%s"' % CONFIG[var]

Просмотреть файл

@ -70,6 +70,8 @@ TEST(TestDllBlocklist, AllowDllByVersion)
EXPECT_TRUE(!!::GetModuleHandleW(kLeafName.get()));
}
// RedirectToNoOpEntryPoint needs the launcher process.
#if defined(MOZ_LAUNCHER_PROCESS)
TEST(TestDllBlocklist, NoOpEntryPoint)
{
// DllMain of this dll has MOZ_RELEASE_ASSERT. This test makes sure we load
@ -79,17 +81,18 @@ TEST(TestDllBlocklist, NoOpEntryPoint)
nsModuleHandle hDll(::LoadLibraryW(dllPath.get()));
#if defined(MOZ_ASAN)
# if defined(MOZ_ASAN)
// With ASAN, the test uses mozglue's blocklist where
// REDIRECT_TO_NOOP_ENTRYPOINT is ignored. So LoadLibraryW
// is expected to fail.
EXPECT_TRUE(!hDll);
EXPECT_TRUE(!::GetModuleHandleW(kLeafName.get()));
#else
# else
EXPECT_TRUE(!!hDll);
EXPECT_TRUE(!!::GetModuleHandleW(kLeafName.get()));
#endif
# endif
}
#endif // defined(MOZ_LAUNCHER_PROCESS)
#define DLL_BLOCKLIST_ENTRY(name, ...) {name, __VA_ARGS__},
#define DLL_BLOCKLIST_STRING_TYPE const char*