launcher: prevent early hook from launching in standalone configurator (#678)

## Description of change
Seems to be an oversight when it was initially implemented; hooks should
not load when launching `spicecfg` (or `spice -cfg` or `spice64 -cfg`).
This commit is contained in:
bicarus
2026-05-07 00:26:18 -07:00
committed by GitHub
parent cd0ba51b5a
commit b9ccddf47d
+12 -10
View File
@@ -1532,16 +1532,18 @@ int main_implementation(int argc, char *argv[]) {
} }
// early hooks // early hooks
for (auto &hook : early_hooks) { if (!cfg_run) {
log_info("launcher", "loading early hook DLL {}", hook); for (auto &hook : early_hooks) {
libutils::print_dll_info(hook); log_info("launcher", "loading early hook DLL {}", hook);
HMODULE module; libutils::print_dll_info(hook);
if (!(module = libutils::try_library(hook))) { HMODULE module;
log_warning("launcher", "failed to load early hook {}: {}", hook, get_last_error_string()); if (!(module = libutils::try_library(hook))) {
deferredlogs::defer_error_messages({ log_warning("launcher", "failed to load early hook {}: {}", hook, get_last_error_string());
fmt::format("failed to load early hook {}:", hook), deferredlogs::defer_error_messages({
fmt::format(" {}", get_last_error_string()) fmt::format("failed to load early hook {}:", hook),
}); fmt::format(" {}", get_last_error_string())
});
}
} }
} }