mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-07-25 00:38:41 +08:00
[refactor] organize GUI code by responsibility
This commit is contained in:
@@ -10,7 +10,8 @@ std::filesystem::path FindRepoRoot() {
|
||||
std::filesystem::path current = std::filesystem::current_path();
|
||||
while (!current.empty()) {
|
||||
if (std::filesystem::exists(current / "xmake.lua") &&
|
||||
std::filesystem::exists(current / "submodules/minirtc/src/api/minirtc.h")) {
|
||||
std::filesystem::exists(current /
|
||||
"submodules/minirtc/src/api/minirtc.h")) {
|
||||
return current;
|
||||
}
|
||||
current = current.parent_path();
|
||||
@@ -18,7 +19,7 @@ std::filesystem::path FindRepoRoot() {
|
||||
return {};
|
||||
}
|
||||
|
||||
std::string ReadFile(const std::filesystem::path& path) {
|
||||
std::string ReadFile(const std::filesystem::path &path) {
|
||||
std::ifstream file(path, std::ios::binary);
|
||||
if (!file) {
|
||||
return {};
|
||||
@@ -29,8 +30,8 @@ std::string ReadFile(const std::filesystem::path& path) {
|
||||
return stream.str();
|
||||
}
|
||||
|
||||
bool ExpectContains(const char* name, const std::string& value,
|
||||
const std::string& expected) {
|
||||
bool ExpectContains(const char *name, const std::string &value,
|
||||
const std::string &expected) {
|
||||
if (value.find(expected) != std::string::npos) {
|
||||
return true;
|
||||
}
|
||||
@@ -39,8 +40,8 @@ bool ExpectContains(const char* name, const std::string& value,
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ExpectNotContains(const char* name, const std::string& value,
|
||||
const std::string& unexpected) {
|
||||
bool ExpectNotContains(const char *name, const std::string &value,
|
||||
const std::string &unexpected) {
|
||||
if (value.find(unexpected) == std::string::npos) {
|
||||
return true;
|
||||
}
|
||||
@@ -62,12 +63,14 @@ int main() {
|
||||
ReadFile(repo_root / "submodules/minirtc/src/api/minirtc.h");
|
||||
const std::string peer_connection =
|
||||
ReadFile(repo_root / "submodules/minirtc/src/pc/peer_connection.cpp");
|
||||
const std::string connection_status_window =
|
||||
ReadFile(repo_root / "src/gui/windows/connection_status_window.cpp");
|
||||
const std::string render_h = ReadFile(repo_root / "src/gui/render.h");
|
||||
const std::string render_cpp = ReadFile(repo_root / "src/gui/render.cpp");
|
||||
const std::string remote_peer_panel =
|
||||
ReadFile(repo_root / "src/gui/panels/remote_peer_panel.cpp");
|
||||
const std::string connection_status_window = ReadFile(
|
||||
repo_root / "src/gui/views/windows/connection_status_window.cpp");
|
||||
const std::string runtime_state_h =
|
||||
ReadFile(repo_root / "src/gui/runtime/runtime_state.h");
|
||||
const std::string remote_session_h =
|
||||
ReadFile(repo_root / "src/gui/runtime/remote_session.h");
|
||||
const std::string connection_runtime_cpp =
|
||||
ReadFile(repo_root / "src/gui/runtime/connection_runtime.cpp");
|
||||
|
||||
bool ok = true;
|
||||
ok &= ExpectContains("minirtc.h", minirtc_api, "RemoteUnavailable");
|
||||
@@ -80,20 +83,19 @@ int main() {
|
||||
"\"Device offline\"");
|
||||
ok &= ExpectNotContains("peer_connection.cpp", peer_connection,
|
||||
"ConnectionStatus::DeviceOffline");
|
||||
ok &= ExpectContains("connection_status_window.cpp",
|
||||
connection_status_window,
|
||||
ok &= ExpectContains("connection_status_window.cpp", connection_status_window,
|
||||
"localization::device_offline");
|
||||
ok &= ExpectContains("render.h", render_h,
|
||||
ok &= ExpectContains("runtime_state.h", runtime_state_h,
|
||||
"pending_presence_probe_started_at_");
|
||||
ok &= ExpectContains("render.h", render_h,
|
||||
ok &= ExpectContains("remote_session.h", remote_session_h,
|
||||
"connection_attempt_started_at_");
|
||||
ok &= ExpectContains("render.cpp", render_cpp,
|
||||
ok &= ExpectContains("connection_runtime.cpp", connection_runtime_cpp,
|
||||
"HandleConnectionTimeouts");
|
||||
ok &= ExpectContains("render.cpp", render_cpp,
|
||||
ok &= ExpectContains("connection_runtime.cpp", connection_runtime_cpp,
|
||||
"kPresenceProbeTimeout");
|
||||
ok &= ExpectContains("render.cpp", render_cpp,
|
||||
ok &= ExpectContains("connection_runtime.cpp", connection_runtime_cpp,
|
||||
"kConnectionAttemptTimeout");
|
||||
ok &= ExpectContains("remote_peer_panel.cpp", remote_peer_panel,
|
||||
ok &= ExpectContains("connection_runtime.cpp", connection_runtime_cpp,
|
||||
"connection_attempt_started_at_");
|
||||
|
||||
return ok ? 0 : 1;
|
||||
|
||||
@@ -10,7 +10,8 @@ std::filesystem::path FindRepoRoot() {
|
||||
std::filesystem::path current = std::filesystem::current_path();
|
||||
while (!current.empty()) {
|
||||
if (std::filesystem::exists(current / "xmake.lua") &&
|
||||
std::filesystem::exists(current / "src/gui/toolbars/control_bar.cpp")) {
|
||||
std::filesystem::exists(current /
|
||||
"src/gui/views/toolbars/control_bar.cpp")) {
|
||||
return current;
|
||||
}
|
||||
current = current.parent_path();
|
||||
@@ -63,8 +64,7 @@ bool ExpectContainsAtLeast(const char* name, const std::string& value,
|
||||
}
|
||||
|
||||
std::cerr << name << " expected at least " << min_count
|
||||
<< " occurrences of: " << expected << ", found " << count
|
||||
<< "\n";
|
||||
<< " occurrences of: " << expected << ", found " << count << "\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ int main() {
|
||||
}
|
||||
|
||||
const std::string control_bar =
|
||||
ReadFile(repo_root / "src/gui/toolbars/control_bar.cpp");
|
||||
ReadFile(repo_root / "src/gui/views/toolbars/control_bar.cpp");
|
||||
|
||||
bool ok = true;
|
||||
ok &= ExpectContains("control_bar.cpp", control_bar,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "device_controller.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "device_controller.h"
|
||||
|
||||
namespace {
|
||||
|
||||
bool ExpectEqual(const char* name, size_t actual, size_t expected) {
|
||||
@@ -60,10 +60,8 @@ int main() {
|
||||
ok &= ExpectEqual("parsed pressed_count", parsed.ks.pressed_count, 2);
|
||||
ok &= ExpectEqual("parsed key 0", parsed.ks.pressed_keys[0].key_value, 65);
|
||||
ok &= ExpectEqual("parsed scan 0", parsed.ks.pressed_keys[0].scan_code, 30);
|
||||
ok &= ExpectTrue("parsed extended 0",
|
||||
!parsed.ks.pressed_keys[0].extended);
|
||||
ok &= ExpectEqual("parsed key 1", parsed.ks.pressed_keys[1].key_value,
|
||||
0xA3);
|
||||
ok &= ExpectTrue("parsed extended 0", !parsed.ks.pressed_keys[0].extended);
|
||||
ok &= ExpectEqual("parsed key 1", parsed.ks.pressed_keys[1].key_value, 0xA3);
|
||||
ok &= ExpectEqual("parsed scan 1", parsed.ks.pressed_keys[1].scan_code, 29);
|
||||
ok &= ExpectTrue("parsed extended 1", parsed.ks.pressed_keys[1].extended);
|
||||
|
||||
|
||||
@@ -25,18 +25,17 @@ int main() {
|
||||
ok &= ExpectEqual("initial flags", state.flags(), 0);
|
||||
ok &= ExpectEqual("left shift down", state.Update(0xA0, true),
|
||||
crossdesk::kMacInjectedModifierShift);
|
||||
ok &= ExpectEqual("shifted semicolon keeps shift",
|
||||
state.Update(0xBA, true),
|
||||
ok &= ExpectEqual("shifted semicolon keeps shift", state.Update(0xBA, true),
|
||||
crossdesk::kMacInjectedModifierShift);
|
||||
ok &= ExpectEqual("semicolon up keeps shift", state.Update(0xBA, false),
|
||||
crossdesk::kMacInjectedModifierShift);
|
||||
ok &= ExpectEqual("right shift down while left held",
|
||||
state.Update(0xA1, true),
|
||||
crossdesk::kMacInjectedModifierShift);
|
||||
ok &=
|
||||
ExpectEqual("right shift down while left held", state.Update(0xA1, true),
|
||||
crossdesk::kMacInjectedModifierShift);
|
||||
ok &= ExpectEqual("left shift up while right held", state.Update(0xA0, false),
|
||||
crossdesk::kMacInjectedModifierShift);
|
||||
ok &= ExpectEqual("right shift up clears shift", state.Update(0xA1, false),
|
||||
0);
|
||||
ok &=
|
||||
ExpectEqual("right shift up clears shift", state.Update(0xA1, false), 0);
|
||||
|
||||
ok &= ExpectEqual("left control down", state.Update(0xA2, true),
|
||||
crossdesk::kMacInjectedModifierControl);
|
||||
@@ -53,8 +52,7 @@ int main() {
|
||||
crossdesk::kMacInjectedModifierCommand);
|
||||
ok &= ExpectEqual("right alt up leaves command", state.Update(0xA5, false),
|
||||
crossdesk::kMacInjectedModifierCommand);
|
||||
ok &= ExpectEqual("left command up clears all", state.Update(0x5B, false),
|
||||
0);
|
||||
ok &= ExpectEqual("left command up clears all", state.Update(0x5B, false), 0);
|
||||
|
||||
return ok ? 0 : 1;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
#include "path_manager.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <filesystem>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "path_manager.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#elif defined(__APPLE__)
|
||||
#include <mach-o/dyld.h>
|
||||
#include <limits.h>
|
||||
#include <mach-o/dyld.h>
|
||||
#else
|
||||
#include <limits.h>
|
||||
#include <unistd.h>
|
||||
@@ -43,8 +43,7 @@ std::filesystem::path GetExecutableDirectory() {
|
||||
#endif
|
||||
}
|
||||
|
||||
bool ExpectEqual(const char* name,
|
||||
const std::filesystem::path& actual,
|
||||
bool ExpectEqual(const char* name, const std::filesystem::path& actual,
|
||||
const std::filesystem::path& expected) {
|
||||
if (actual.lexically_normal() == expected.lexically_normal()) {
|
||||
return true;
|
||||
|
||||
@@ -130,11 +130,12 @@ int main() {
|
||||
ok &= ExpectNotContains("crossdesk_portable.manifest", portable_manifest,
|
||||
"processorArchitecture=\"*\"");
|
||||
#ifdef _WIN32
|
||||
ok &= ExpectActivationContext(repo_root / "scripts/windows/crossdesk.manifest");
|
||||
ok &= ExpectActivationContext(
|
||||
repo_root / "scripts/windows/crossdesk_debug.manifest");
|
||||
ok &= ExpectActivationContext(
|
||||
repo_root / "scripts/windows/crossdesk_portable.manifest");
|
||||
ok &=
|
||||
ExpectActivationContext(repo_root / "scripts/windows/crossdesk.manifest");
|
||||
ok &= ExpectActivationContext(repo_root /
|
||||
"scripts/windows/crossdesk_debug.manifest");
|
||||
ok &= ExpectActivationContext(repo_root /
|
||||
"scripts/windows/crossdesk_portable.manifest");
|
||||
#endif
|
||||
return ok ? 0 : 1;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,8 @@ std::filesystem::path FindRepoRoot() {
|
||||
while (!current.empty()) {
|
||||
if (std::filesystem::exists(current / "xmake.lua") &&
|
||||
std::filesystem::exists(
|
||||
current / "src/device_controller/mouse/windows/mouse_controller.cpp")) {
|
||||
current /
|
||||
"src/device_controller/mouse/windows/mouse_controller.cpp")) {
|
||||
return current;
|
||||
}
|
||||
current = current.parent_path();
|
||||
|
||||
@@ -12,8 +12,8 @@ std::filesystem::path FindRepoRoot() {
|
||||
std::filesystem::path current = std::filesystem::current_path();
|
||||
while (!current.empty()) {
|
||||
if (std::filesystem::exists(current / "xmake.lua") &&
|
||||
std::filesystem::exists(
|
||||
current / "src/service/windows/service_host.cpp")) {
|
||||
std::filesystem::exists(current /
|
||||
"src/service/windows/service_host.cpp")) {
|
||||
return current;
|
||||
}
|
||||
current = current.parent_path();
|
||||
@@ -21,7 +21,7 @@ std::filesystem::path FindRepoRoot() {
|
||||
return {};
|
||||
}
|
||||
|
||||
std::string ReadFile(const std::filesystem::path& path) {
|
||||
std::string ReadFile(const std::filesystem::path &path) {
|
||||
std::ifstream file(path, std::ios::binary);
|
||||
if (!file) {
|
||||
return {};
|
||||
@@ -32,8 +32,8 @@ std::string ReadFile(const std::filesystem::path& path) {
|
||||
return stream.str();
|
||||
}
|
||||
|
||||
bool ExpectContains(const char* name, const std::string& value,
|
||||
const std::string& expected) {
|
||||
bool ExpectContains(const char *name, const std::string &value,
|
||||
const std::string &expected) {
|
||||
if (value.find(expected) != std::string::npos) {
|
||||
return true;
|
||||
}
|
||||
@@ -42,8 +42,8 @@ bool ExpectContains(const char* name, const std::string& value,
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ExpectNotContains(const char* name, const std::string& value,
|
||||
const std::string& unexpected) {
|
||||
bool ExpectNotContains(const char *name, const std::string &value,
|
||||
const std::string &unexpected) {
|
||||
if (value.find(unexpected) == std::string::npos) {
|
||||
return true;
|
||||
}
|
||||
@@ -52,7 +52,7 @@ bool ExpectNotContains(const char* name, const std::string& value,
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ExpectTrue(const char* name, bool value) {
|
||||
bool ExpectTrue(const char *name, bool value) {
|
||||
if (value) {
|
||||
return true;
|
||||
}
|
||||
@@ -71,9 +71,11 @@ int main() {
|
||||
}
|
||||
|
||||
const std::string control_bar =
|
||||
ReadFile(repo_root / "src/gui/toolbars/control_bar.cpp");
|
||||
const std::string render = ReadFile(repo_root / "src/gui/render.cpp");
|
||||
const std::string render_h = ReadFile(repo_root / "src/gui/render.h");
|
||||
ReadFile(repo_root / "src/gui/views/toolbars/control_bar.cpp");
|
||||
const std::string windows_service_runtime =
|
||||
ReadFile(repo_root / "src/gui/runtime/windows_service_runtime.cpp");
|
||||
const std::string runtime_state_h =
|
||||
ReadFile(repo_root / "src/gui/runtime/runtime_state.h");
|
||||
const std::string service_host =
|
||||
ReadFile(repo_root / "src/service/windows/service_host.cpp");
|
||||
const std::string service_host_h =
|
||||
@@ -82,9 +84,9 @@ int main() {
|
||||
ReadFile(repo_root / "src/service/windows/session_helper_main.cpp");
|
||||
|
||||
bool ok = true;
|
||||
ok &= ExpectTrue("secure desktop input routing",
|
||||
crossdesk::IsSecureDesktopInteractionRequired(
|
||||
"secure-desktop"));
|
||||
ok &= ExpectTrue(
|
||||
"secure desktop input routing",
|
||||
crossdesk::IsSecureDesktopInteractionRequired("secure-desktop"));
|
||||
ok &= ExpectNotContains("control_bar.cpp", control_bar,
|
||||
"CanSendSecureAttentionSequence("
|
||||
"props->remote_interactive_stage_)");
|
||||
@@ -92,18 +94,20 @@ int main() {
|
||||
"ImGui::BeginDisabled();\n"
|
||||
" }\n"
|
||||
" if (ImGui::Selectable(sas_label.c_str()))");
|
||||
ok &= ExpectNotContains("render.cpp", render, "sas_requires_lock_screen");
|
||||
ok &= ExpectContains("render.h", render_h,
|
||||
ok &= ExpectNotContains("windows_service_runtime.cpp",
|
||||
windows_service_runtime, "sas_requires_lock_screen");
|
||||
ok &= ExpectContains("runtime_state.h", runtime_state_h,
|
||||
"optimistic_windows_secure_desktop_until_tick_");
|
||||
ok &= ExpectContains("render.cpp", render,
|
||||
ok &= ExpectContains("windows_service_runtime.cpp", windows_service_runtime,
|
||||
"kWindowsServiceSasSecureDesktopGraceMs");
|
||||
ok &= ExpectContains("render.cpp", render,
|
||||
ok &= ExpectContains("windows_service_runtime.cpp", windows_service_runtime,
|
||||
"status->sas_secure_desktop_grace_active");
|
||||
ok &= ExpectContains("render.cpp", render,
|
||||
"json.value(\"sas_secure_desktop_grace_active\", false)");
|
||||
ok &= ExpectContains("render.cpp", render,
|
||||
ok &=
|
||||
ExpectContains("windows_service_runtime.cpp", windows_service_runtime,
|
||||
"json.value(\"sas_secure_desktop_grace_active\", false)");
|
||||
ok &= ExpectContains("windows_service_runtime.cpp", windows_service_runtime,
|
||||
"status.sas_secure_desktop_grace_active");
|
||||
ok &= ExpectContains("render.cpp", render,
|
||||
ok &= ExpectContains("windows_service_runtime.cpp", windows_service_runtime,
|
||||
"local_interactive_stage_ = \"secure-desktop\"");
|
||||
ok &= ExpectContains("service_host.h", service_host_h,
|
||||
"sas_secure_desktop_until_tick_");
|
||||
@@ -126,8 +130,9 @@ int main() {
|
||||
"now + kSasSecureDesktopGraceMs");
|
||||
ok &= ExpectContains("service_host.cpp", service_host,
|
||||
"\\\"sas_secure_desktop_grace_active\\\"");
|
||||
ok &= ExpectContains("service_host.cpp", service_host,
|
||||
"raw_interactive_stage = ResolveInteractiveStageLocked()");
|
||||
ok &=
|
||||
ExpectContains("service_host.cpp", service_host,
|
||||
"raw_interactive_stage = ResolveInteractiveStageLocked()");
|
||||
ok &= ExpectContains("session_helper_main.cpp", session_helper,
|
||||
"kSessionHelperStatePollMs = 1000");
|
||||
ok &= ExpectContains("session_helper_main.cpp", session_helper,
|
||||
|
||||
@@ -10,7 +10,8 @@ std::filesystem::path FindRepoRoot() {
|
||||
std::filesystem::path current = std::filesystem::current_path();
|
||||
while (!current.empty()) {
|
||||
if (std::filesystem::exists(current / "xmake.lua") &&
|
||||
std::filesystem::exists(current / "src/service/windows/service_host.cpp")) {
|
||||
std::filesystem::exists(current /
|
||||
"src/service/windows/service_host.cpp")) {
|
||||
return current;
|
||||
}
|
||||
current = current.parent_path();
|
||||
@@ -18,7 +19,7 @@ std::filesystem::path FindRepoRoot() {
|
||||
return {};
|
||||
}
|
||||
|
||||
std::string ReadFile(const std::filesystem::path& path) {
|
||||
std::string ReadFile(const std::filesystem::path &path) {
|
||||
std::ifstream file(path, std::ios::binary);
|
||||
if (!file) {
|
||||
return {};
|
||||
@@ -29,8 +30,8 @@ std::string ReadFile(const std::filesystem::path& path) {
|
||||
return stream.str();
|
||||
}
|
||||
|
||||
bool ExpectContains(const char* name, const std::string& value,
|
||||
const std::string& expected) {
|
||||
bool ExpectContains(const char *name, const std::string &value,
|
||||
const std::string &expected) {
|
||||
if (value.find(expected) != std::string::npos) {
|
||||
return true;
|
||||
}
|
||||
@@ -39,8 +40,8 @@ bool ExpectContains(const char* name, const std::string& value,
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ExpectNotContains(const char* name, const std::string& value,
|
||||
const std::string& unexpected) {
|
||||
bool ExpectNotContains(const char *name, const std::string &value,
|
||||
const std::string &unexpected) {
|
||||
if (value.find(unexpected) == std::string::npos) {
|
||||
return true;
|
||||
}
|
||||
@@ -64,17 +65,18 @@ int main() {
|
||||
ReadFile(repo_root / "src/service/windows/service_host.h");
|
||||
const std::string session_helper =
|
||||
ReadFile(repo_root / "src/service/windows/session_helper_main.cpp");
|
||||
const std::string targets =
|
||||
ReadFile(repo_root / "xmake/targets.lua");
|
||||
const std::string targets = ReadFile(repo_root / "xmake/targets.lua");
|
||||
const std::string interactive_state =
|
||||
ReadFile(repo_root / "src/service/windows/interactive_state.h");
|
||||
const std::string render_callback =
|
||||
ReadFile(repo_root / "src/gui/render_callback.cpp");
|
||||
const std::string render = ReadFile(repo_root / "src/gui/render.cpp");
|
||||
const std::string gui_input_sources =
|
||||
ReadFile(repo_root / "src/gui/runtime/peer_data_callbacks.cpp") + "\n" +
|
||||
ReadFile(repo_root / "src/gui/features/input/keyboard_controller.cpp");
|
||||
const std::string windows_service_runtime =
|
||||
ReadFile(repo_root / "src/gui/runtime/windows_service_runtime.cpp");
|
||||
const std::string screen_capturer_h =
|
||||
ReadFile(repo_root / "src/screen_capturer/windows/screen_capturer_win.h");
|
||||
const std::string screen_capturer_cpp =
|
||||
ReadFile(repo_root / "src/screen_capturer/windows/screen_capturer_win.cpp");
|
||||
const std::string screen_capturer_cpp = ReadFile(
|
||||
repo_root / "src/screen_capturer/windows/screen_capturer_win.cpp");
|
||||
|
||||
bool ok = true;
|
||||
ok &= ExpectContains("service_host.cpp", service_host,
|
||||
@@ -93,8 +95,9 @@ int main() {
|
||||
ok &= ExpectContains("session_helper_main.cpp", session_helper,
|
||||
"EnablePerMonitorDpiAwareness();\n\n"
|
||||
" InitializeHelperLogger();");
|
||||
ok &= ExpectContains("service_host.cpp", service_host,
|
||||
"const ULONGLONG deadline_tick = GetTickCount64() + timeout_ms");
|
||||
ok &= ExpectContains(
|
||||
"service_host.cpp", service_host,
|
||||
"const ULONGLONG deadline_tick = GetTickCount64() + timeout_ms");
|
||||
ok &= ExpectContains("service_host.cpp", service_host,
|
||||
"while (GetTickCount64() <= deadline_tick)");
|
||||
ok &= ExpectNotContains("service_host.cpp", service_host,
|
||||
@@ -103,18 +106,18 @@ int main() {
|
||||
"BuildSecureInputHelperKeyboardCommand(");
|
||||
ok &= ExpectContains("service_host.cpp", service_host,
|
||||
"const std::string& interactive_stage");
|
||||
ok &= ExpectContains("service_host.h", service_host_h,
|
||||
"bool LaunchSecureInputHelper(DWORD session_id,\n"
|
||||
" const std::string& interactive_stage,\n"
|
||||
" const std::string& interactive_desktop)");
|
||||
ok &= ExpectContains(
|
||||
"service_host.h", service_host_h,
|
||||
"bool LaunchSecureInputHelper(DWORD session_id,\n"
|
||||
" const std::string& interactive_stage,\n"
|
||||
" const std::string& interactive_desktop)");
|
||||
ok &= ExpectContains("service_host.h", service_host_h,
|
||||
"std::string secure_input_helper_interactive_stage_");
|
||||
ok &= ExpectContains("service_host.cpp", service_host,
|
||||
"SecureInputHelperDesktopForStage");
|
||||
ok &= ExpectContains("service_host.cpp", service_host,
|
||||
"IsConsentUiRunningInSession");
|
||||
ok &= ExpectContains("service_host.cpp", service_host,
|
||||
"L\"Consent.exe\"");
|
||||
ok &= ExpectContains("service_host.cpp", service_host, "L\"Consent.exe\"");
|
||||
ok &= ExpectContains("session_helper_main.cpp", session_helper,
|
||||
"IsConsentUiRunningInCurrentSession");
|
||||
ok &= ExpectContains("session_helper_main.cpp", session_helper,
|
||||
@@ -136,41 +139,47 @@ int main() {
|
||||
"return L\"winsta0\\\\Winlogon\"");
|
||||
ok &= ExpectContains("service_host.cpp", service_host,
|
||||
"return L\"winsta0\\\\default\"");
|
||||
ok &= ExpectContains("service_host.cpp", service_host,
|
||||
"secure_input_helper_interactive_stage_ == interactive_stage");
|
||||
ok &= ExpectContains("service_host.cpp", service_host,
|
||||
"secure_input_helper_interactive_stage_ = interactive_stage");
|
||||
ok &= ExpectContains(
|
||||
"service_host.cpp", service_host,
|
||||
"secure_input_helper_interactive_stage_ == interactive_stage");
|
||||
ok &= ExpectContains(
|
||||
"service_host.cpp", service_host,
|
||||
"secure_input_helper_interactive_stage_ = interactive_stage");
|
||||
ok &= ExpectContains("service_host.cpp", service_host,
|
||||
"secure_input_helper_interactive_stage_.clear()");
|
||||
ok &= ExpectContains("service_host.cpp", service_host,
|
||||
"LaunchSecureInputHelper(target_session_id, interactive_stage,\n"
|
||||
" interactive_desktop)");
|
||||
ok &= ExpectContains(
|
||||
"service_host.cpp", service_host,
|
||||
"LaunchSecureInputHelper(target_session_id, interactive_stage,\n"
|
||||
" interactive_desktop)");
|
||||
ok &= ExpectContains("service_host.cpp", service_host,
|
||||
"\\\"secure_input_helper_stage\\\":\\\"");
|
||||
ok &= ExpectContains("service_host.cpp", service_host,
|
||||
"session_helper_report_interactive_stage_");
|
||||
ok &= ExpectContains("service_host.cpp", service_host,
|
||||
"return SendSecureDesktopMouseInput");
|
||||
ok &= ExpectContains("render.cpp", render,
|
||||
ok &= ExpectContains("windows_service_runtime.cpp", windows_service_runtime,
|
||||
"constexpr DWORD kWindowsServiceQueryTimeoutMs = 500");
|
||||
ok &= ExpectContains("screen_capturer_win.cpp", screen_capturer_cpp,
|
||||
"constexpr DWORD kSecureDesktopStatusPipeTimeoutMs = 500");
|
||||
ok &= ExpectContains("render.cpp", render,
|
||||
ok &=
|
||||
ExpectContains("screen_capturer_win.cpp", screen_capturer_cpp,
|
||||
"constexpr DWORD kSecureDesktopStatusPipeTimeoutMs = 500");
|
||||
ok &= ExpectContains("windows_service_runtime.cpp", windows_service_runtime,
|
||||
"IsTransientWindowsServiceStatusError(status.error)");
|
||||
ok &= ExpectContains("screen_capturer_win.cpp", screen_capturer_cpp,
|
||||
"IsTransientWindowsServiceStatusError(status.error)");
|
||||
ok &= ExpectContains("render.cpp", render,
|
||||
ok &= ExpectContains("windows_service_runtime.cpp", windows_service_runtime,
|
||||
"Local Windows service temporarily unavailable");
|
||||
ok &= ExpectContains("screen_capturer_win.cpp", screen_capturer_cpp,
|
||||
"Windows capturer secure desktop service temporarily unavailable");
|
||||
ok &= ExpectContains("screen_capturer_win.cpp", screen_capturer_cpp,
|
||||
"Windows capturer secure desktop transient frame query failed");
|
||||
ok &= ExpectContains(
|
||||
"screen_capturer_win.cpp", screen_capturer_cpp,
|
||||
"Windows capturer secure desktop service temporarily unavailable");
|
||||
ok &= ExpectContains(
|
||||
"screen_capturer_win.cpp", screen_capturer_cpp,
|
||||
"Windows capturer secure desktop transient frame query failed");
|
||||
ok &= ExpectContains("screen_capturer_win.cpp", screen_capturer_cpp,
|
||||
"if (transient_error) {\n"
|
||||
" LOG_INFO(");
|
||||
ok &= ExpectContains("render_callback.cpp", render_callback,
|
||||
ok &= ExpectContains("gui_input_sources.cpp", gui_input_sources,
|
||||
"IsTransientSecureDesktopInputFailure");
|
||||
ok &= ExpectContains("render_callback.cpp", render_callback,
|
||||
ok &= ExpectContains("gui_input_sources.cpp", gui_input_sources,
|
||||
"Secure desktop keyboard injection transient failure");
|
||||
ok &= ExpectContains("session_helper_main.cpp", session_helper,
|
||||
"MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE");
|
||||
@@ -210,31 +219,36 @@ int main() {
|
||||
"json[\"current_desktop\"]");
|
||||
ok &= ExpectContains("session_helper_main.cpp", session_helper,
|
||||
"json[\"stage\"]");
|
||||
ok &= ExpectContains("session_helper_main.cpp", session_helper,
|
||||
"ParseSecureInputKeyboardCommand(command, &key_code, &is_down, &scan_code,\n"
|
||||
" &extended, &interactive_stage,\n"
|
||||
" &interactive_desktop)");
|
||||
ok &= ExpectContains("session_helper_main.cpp", session_helper,
|
||||
"InjectKeyboardInput(key_code, is_down, scan_code, extended,\n"
|
||||
" interactive_stage, interactive_desktop)");
|
||||
ok &= ExpectContains(
|
||||
"session_helper_main.cpp", session_helper,
|
||||
"ParseSecureInputKeyboardCommand(command, &key_code, &is_down, "
|
||||
"&scan_code,\n"
|
||||
" &extended, &interactive_stage,\n"
|
||||
" &interactive_desktop)");
|
||||
ok &= ExpectContains(
|
||||
"session_helper_main.cpp", session_helper,
|
||||
"InjectKeyboardInput(key_code, is_down, scan_code, extended,\n"
|
||||
" interactive_stage, interactive_desktop)");
|
||||
ok &= ExpectContains("session_helper_main.cpp", session_helper,
|
||||
"InjectMouseInput(mouse_request)");
|
||||
ok &= ExpectNotContains("session_helper_main.cpp", session_helper,
|
||||
"EnsureThreadDesktop(L\"Winlogon\", &secure_desktop)");
|
||||
ok &= ExpectContains("service_host.cpp", service_host,
|
||||
"winsta0\\\\default");
|
||||
ok &= ExpectNotContains("service_host.cpp", service_host,
|
||||
"startup_info.lpDesktop = const_cast<LPWSTR>(L\"winsta0\\\\Winlogon\")");
|
||||
ok &=
|
||||
ExpectNotContains("session_helper_main.cpp", session_helper,
|
||||
"EnsureThreadDesktop(L\"Winlogon\", &secure_desktop)");
|
||||
ok &= ExpectContains("service_host.cpp", service_host, "winsta0\\\\default");
|
||||
ok &= ExpectNotContains(
|
||||
"service_host.cpp", service_host,
|
||||
"startup_info.lpDesktop = const_cast<LPWSTR>(L\"winsta0\\\\Winlogon\")");
|
||||
ok &= ExpectContains("interactive_state.h", interactive_state,
|
||||
"interactive_stage == \"lock-screen\"");
|
||||
ok &= ExpectContains("render_callback.cpp", render_callback,
|
||||
ok &= ExpectContains("gui_input_sources.cpp", gui_input_sources,
|
||||
"RemoteAction remote_action{};");
|
||||
ok &= ExpectContains("render.cpp", render,
|
||||
ok &= ExpectContains("windows_service_runtime.cpp", windows_service_runtime,
|
||||
"previous_secure_desktop_interaction");
|
||||
ok &= ExpectNotContains(
|
||||
"render_callback.cpp", render_callback,
|
||||
"render->local_service_available_ &&\n"
|
||||
" IsSecureDesktopInteractionRequired(render->local_interactive_stage_)");
|
||||
"gui_input_sources.cpp", gui_input_sources,
|
||||
"runtime->local_service_available_ &&\n"
|
||||
" "
|
||||
"IsSecureDesktopInteractionRequired(runtime->local_interactive_stage_)");
|
||||
ok &= ExpectContains("screen_capturer_win.h", screen_capturer_h,
|
||||
"std::string secure_shared_stage_;");
|
||||
ok &= ExpectContains("screen_capturer_win.cpp", screen_capturer_cpp,
|
||||
|
||||
Reference in New Issue
Block a user