[feat] expose system controls and verify remote unlock completion

This commit is contained in:
dijunkun
2026-11-06 20:46:11 +08:00
parent 6bfcd5cf3d
commit dd4baf2fc4
16 changed files with 222 additions and 15 deletions
@@ -5,6 +5,7 @@
*/
#include "screen_lock.h"
#include "service/interactive_desktop.h"
#include <windows.h>
@@ -12,6 +13,13 @@
namespace crossdesk {
ScreenLockState QueryScreenLock() {
std::string reason;
if (IsCurrentSessionUnlocked(&reason)) return ScreenLockState::unlocked;
return reason.rfind("session_not_unlocked", 0) == 0 ? ScreenLockState::locked
: ScreenLockState::unknown;
}
bool LockScreen() {
if (LockWorkStation()) return true;
LOG_WARN("LockWorkStation failed: {}", GetLastError());