isolate POSIX builds from the host UCRT, wire lwext4 and ntfs-3g as ext4.sys and ntfs.sys, split the FAT driver into directory/file/async/driver/mount units, add posixsrv and dwm plus input/console/desktop syscall clients and a pile of new smoke targets, rename serial.sys to cereal.sys, name HDA/USB/lwIP/AHCI workers, harden ATA probing/reset/removal around actual hardware deadlines, absent-channel detection, diagnostics and explicit worker lifetime, redo ACPI S5 shutdown around GAS/MMIO and HW-reduced firmware, scan SSDTs for _S5 and deal with Intel SMI sleep trapping, make serial and SMP timeouts use real monotonic deadlines, add thread names and fix terminal thread teardown, scheduler and APC prepare/commit races, make advisory file locks queryable and preserve split ranges and add mutable file append state, add shared-memory pipes with kernel-assisted wait/wake, introduce capability-scoped input and display managers, split surface map rights into read/write, add explicit unmap and replace present with commit/generation/damage tracking while keeping physical presentation under the display manager, decouple native exception classes from Win32 exception numbers and translate them in kernel32, add opaque process startup data, bump the resource protocol to v3 with namespace directories, symlinks and enumeration and service control to v2 with generic READY handle exports, add the new POSIX errno/status surface and rebuild fds around posixsrv-owned shared open descriptions, descriptor-local flags, exact inheritance snapshots, dup/fcntl/record locks and shared-ring pipes, add waitpid, POSIX credentials/groups/sessions/passwd/group lookups and move sockets onto stable open descriptions, port the shells and apps to the new console/input services and surface commit API, teach init to load services.ini and start/supervise RSSRV, DWM and generic services under restricted capabilities while publishing their endpoints through RSSRV, split RSSRV into namespace, volume, display, session, input, console and resource components and make /SystemRoot a real symlink to the independently published system volume, shift the syscall table again, expand lock/resource/surface/POSIX/service/thread smoke coverage, make docs scream ASK QUESTIONS and DISCUSS at LLMs, replace MIT No Attribution with WTFPL+.

This commit is contained in:
maksw committed 2026-09-16 10:33:20 +02:00
1 parent 3dacbd32c8
commit 73abd6f90d
441 files changed
+187073 -6549

No files matched your search

+138
View File
@@ -0,0 +1,138 @@
// Native desktop/window protocol and client helpers. DWM owns window policy while RSSRV retains Session 0 routing authority.
#pragma once
#include <stdint.h>
#include <ntlite/display.h>
#include <ntlite/handle.h>
#include <ntlite/input.h>
#include <ntlite/status.h>
#define NTL_DESKTOP_PROTOCOL_VERSION 1u
#define NTL_DESKTOP_SERVICE_PATH "/Sessions/0/Desktop"
#define NTL_DESKTOP_FLAG_NONE 0x00000000u
#define NTL_DESKTOP_OP_CREATE_WINDOW 1u
#define NTL_DESKTOP_OP_DESTROY_WINDOW 2u
#define NTL_DESKTOP_OP_SET_BOUNDS 3u
#define NTL_DESKTOP_OP_SET_VISIBLE 4u
#define NTL_DESKTOP_OP_RAISE_WINDOW 5u
#define NTL_DESKTOP_OP_LOWER_WINDOW 6u
#define NTL_DESKTOP_OP_REQUEST_FOCUS 7u
#define NTL_DESKTOP_OP_REQUEST_CAPTURE 8u
#define NTL_DESKTOP_OP_RELEASE_CAPTURE 9u
#define NTL_DESKTOP_OP_SET_POINTER_MODE 10u
#define NTL_DESKTOP_OP_ATTACH_SURFACE 11u
#define NTL_DESKTOP_OP_DETACH_SURFACE 12u
#define NTL_DESKTOP_OP_QUERY_WINDOW 13u
#define NTL_DESKTOP_EVENT_KEY 1u
#define NTL_DESKTOP_EVENT_MOUSE 2u
#define NTL_DESKTOP_POINTER_FREE 0u
#define NTL_DESKTOP_POINTER_CONFINED 1u
#define NTL_DESKTOP_POINTER_RELATIVE_LOCKED 2u
typedef uint64_t NTL_WINDOW_ID;
// One fixed desktop request. ATTACH_SURFACE carries exactly one surface capability.
typedef struct NTL_DESKTOP_REQUEST {
uint32_t Size;
uint32_t Version;
uint32_t Operation;
uint32_t Flags;
NTL_WINDOW_ID WindowId;
DISPLAY_RECT Bounds;
uint32_t Value;
uint32_t Reserved;
} NTL_DESKTOP_REQUEST;
// One fixed desktop reply. Query fields are meaningful after CREATE_WINDOW or QUERY_WINDOW.
typedef struct NTL_DESKTOP_REPLY {
uint32_t Size;
uint32_t Version;
uint32_t Operation;
uint32_t Flags;
KSTATUS Status;
uint32_t Reserved;
NTL_WINDOW_ID WindowId;
DISPLAY_RECT Bounds;
uint32_t Visible;
uint32_t Focused;
uint32_t Captured;
uint32_t HasSurface;
uint32_t SurfaceWidth;
uint32_t SurfaceHeight;
} NTL_DESKTOP_REPLY;
// One asynchronous input notification delivered to the owning window connection.
typedef struct NTL_DESKTOP_EVENT {
uint32_t Size;
uint32_t Version;
uint32_t Type;
uint32_t Flags;
NTL_WINDOW_ID WindowId;
int32_t PointerX;
int32_t PointerY;
INPUT_KEY_RECORD Key;
INPUT_MOUSE_EVENT Mouse;
} NTL_DESKTOP_EVENT;
#if defined(NTL_SYSCALL_STATIC)
#define NTL_DESKTOP_API
#elif defined(NTL_SYSCALL_BUILD)
#define NTL_DESKTOP_API __declspec(dllexport)
#else
#define NTL_DESKTOP_API
#endif
// Connects to the active Session 0 desktop endpoint through RSSRV.
NTL_DESKTOP_API KSTATUS NtlDesktopConnect(SYS_HANDLE* sessionOut);
// Creates one hidden client-owned top-level window.
NTL_DESKTOP_API KSTATUS NtlDesktopCreateWindow(SYS_HANDLE session, const DISPLAY_RECT* bounds, NTL_WINDOW_ID* windowOut);
// Destroys one window owned by this connection.
NTL_DESKTOP_API KSTATUS NtlDesktopDestroyWindow(SYS_HANDLE session, NTL_WINDOW_ID window);
// Changes one window's screen-space bounds.
NTL_DESKTOP_API KSTATUS NtlDesktopSetBounds(SYS_HANDLE session, NTL_WINDOW_ID window, const DISPLAY_RECT* bounds);
// Shows or hides one window without changing its z-order.
NTL_DESKTOP_API KSTATUS NtlDesktopSetVisible(SYS_HANDLE session, NTL_WINDOW_ID window, uint32_t visible);
// Moves one window to the top of the z-order.
NTL_DESKTOP_API KSTATUS NtlDesktopRaiseWindow(SYS_HANDLE session, NTL_WINDOW_ID window);
// Moves one window to the bottom of the z-order.
NTL_DESKTOP_API KSTATUS NtlDesktopLowerWindow(SYS_HANDLE session, NTL_WINDOW_ID window);
// Requests Session 0 keyboard focus for one visible window.
NTL_DESKTOP_API KSTATUS NtlDesktopRequestFocus(SYS_HANDLE session, NTL_WINDOW_ID window);
// Requests Session 0 pointer capture for one visible window.
NTL_DESKTOP_API KSTATUS NtlDesktopRequestCapture(SYS_HANDLE session, NTL_WINDOW_ID window);
// Releases pointer capture only when this window currently owns it.
NTL_DESKTOP_API KSTATUS NtlDesktopReleaseCapture(SYS_HANDLE session, NTL_WINDOW_ID window);
// Sets visible cursor policy for the focused/captured window.
NTL_DESKTOP_API KSTATUS NtlDesktopSetPointerMode(SYS_HANDLE session, NTL_WINDOW_ID window, uint32_t mode);
// Attaches a shared surface. DWM receives only QUERY, WAIT, and MAP_READ rights.
NTL_DESKTOP_API KSTATUS NtlDesktopAttachSurface(SYS_HANDLE session, NTL_WINDOW_ID window, SYS_HANDLE surface);
// Detaches the current shared surface from one window.
NTL_DESKTOP_API KSTATUS NtlDesktopDetachSurface(SYS_HANDLE session, NTL_WINDOW_ID window);
// Queries one connection-owned window.
NTL_DESKTOP_API KSTATUS NtlDesktopQueryWindow(SYS_HANDLE session, NTL_WINDOW_ID window, NTL_DESKTOP_REPLY* replyOut);
// Receives one asynchronous key or mouse event from DWM.
NTL_DESKTOP_API KSTATUS NtlDesktopReceiveEvent(SYS_HANDLE session, uint64_t timeoutMilliseconds, NTL_DESKTOP_EVENT* eventOut);
// Disconnects and closes one desktop session endpoint.
NTL_DESKTOP_API KSTATUS NtlDesktopClose(SYS_HANDLE session);
#undef NTL_DESKTOP_API