Thin Windows shell access and bundle quiet validation

This commit is contained in:
2026-06-17 09:41:51 +02:00
parent 6d906f6288
commit 10a3c0498e
8 changed files with 104 additions and 50 deletions

View File

@@ -1,10 +1,10 @@
#include "pch.h"
#include "platform_windows/windows_bootstrap_helpers.h"
#include "platform_windows/windows_runtime_shell.h"
#include "platform_windows/windows_window_shell.h"
#include "app.h"
#include "canvas.h"
#include "legacy_gl_runtime_dispatch.h"
#include "legacy_preference_storage.h"
#include "log.h"
@@ -162,7 +162,8 @@ void setup_exception_handler(const App& app)
BT_SetPreErrHandler([](INT_PTR nErrHandlerParam){
const auto* app = reinterpret_cast<const App*>(nErrHandlerParam);
if (Canvas::I && Canvas::I->m_unsaved)
auto* canvas_document = app && app->canvas ? app->canvas->m_canvas.get() : nullptr;
if (canvas_document && canvas_document->m_unsaved)
{
auto t = std::time(nullptr);
auto tm = *std::localtime(&t);
@@ -170,12 +171,12 @@ void setup_exception_handler(const App& app)
oss << std::put_time(&tm, "%d-%m-%Y %H-%M-%S");
auto path = app->data_path + "/" + app->doc_name + "-recovery (" + oss.str() + ").ppi";
Canvas::I->project_save_thread(path, false);
canvas_document->project_save_thread(path, false);
static char abspath[MAX_PATH];
GetFullPathNameA(path.c_str(), MAX_PATH, abspath, NULL);
static char message[4096];
snprintf(message, sizeof(message), "File recovered in: %s", abspath);
MessageBoxA(retained_state().hWnd, message, "File Recovery", MB_OK | MB_ICONWARNING);
MessageBoxA(main_window_handle(), message, "File Recovery", MB_OK | MB_ICONWARNING);
}
LogRemote::I.file_close();
}, reinterpret_cast<INT_PTR>(&app));
@@ -337,7 +338,7 @@ int read_WMI_info()
if (get_int(clsObj, L"CodeIntegrityPolicyEnforcementStatus") > 0)
{
LOG("SANDBOX DETECTED");
retained_state().sandboxed = true;
set_main_window_sandboxed(true);
}
SAFEARRAY *psaNames = NULL;