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

+92
View File
@@ -0,0 +1,92 @@
// Native logical-input service protocol and client helpers.
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include <ntlite/handle.h>
#include <ntlite/input.h>
#include <ntlite/status.h>
#define NTL_INPUT_PROTOCOL_VERSION 1u
#define NTL_INPUT_SERVICE_PATH "/Services/Input"
#define NTL_INPUT_FLAG_NONE 0x00000000u
#define NTL_INPUT_OP_READ_KEY 1u
#define NTL_INPUT_OP_PEEK_KEY 2u
#define NTL_INPUT_OP_READ_MOUSE 3u
#define NTL_INPUT_OP_PEEK_MOUSE 4u
#define NTL_INPUT_OP_QUERY_STATE 5u
#define NTL_INPUT_STATE_FLAG_NONE 0x00000000u
#define NTL_INPUT_KEY_BYTES 32u
// RSSRV-owned logical input state. This is distinct from the legacy kernel-global input snapshot.
typedef struct NTL_INPUT_STATE {
uint32_t Size;
uint32_t Flags;
uint64_t Generation;
uint32_t Modifiers;
uint8_t KeyDown[NTL_INPUT_KEY_BYTES];
int32_t MouseX;
int32_t MouseY;
int32_t MouseWheel;
uint32_t MouseButtons;
} NTL_INPUT_STATE;
// Request header for all logical-input service operations.
typedef struct NTL_INPUT_REQUEST {
uint32_t Size;
uint32_t Version;
uint32_t Operation;
uint32_t Flags;
uint64_t TimeoutMilliseconds;
} NTL_INPUT_REQUEST;
// Fixed reply. Only the field associated with Operation is meaningful on success.
typedef struct NTL_INPUT_REPLY {
uint32_t Size;
uint32_t Version;
uint32_t Operation;
uint32_t Flags;
KSTATUS Status;
uint32_t Reserved;
INPUT_KEY_RECORD Key;
INPUT_MOUSE_EVENT Mouse;
NTL_INPUT_STATE State;
} NTL_INPUT_REPLY;
#if defined(NTL_SYSCALL_STATIC)
#define NTL_INPUT_API
#elif defined(NTL_SYSCALL_BUILD)
#define NTL_INPUT_API __declspec(dllexport)
#else
#define NTL_INPUT_API
#endif
// Opens one session to RSSRV's logical-input service.
NTL_INPUT_API KSTATUS NtlInputConnect(SYS_HANDLE* sessionOut);
NTL_INPUT_API KSTATUS NtlInputClose(SYS_HANDLE session);
// Reads or peeks one logical keyboard record. SYS_HANDLE_INVALID selects the process-default session; a zero timeout is nonblocking.
NTL_INPUT_API KSTATUS NtlInputReadEvent(SYS_HANDLE session, uint64_t timeoutMilliseconds, INPUT_KEY_RECORD* recordOut);
NTL_INPUT_API KSTATUS NtlInputPeekEvent(SYS_HANDLE session, uint64_t timeoutMilliseconds, INPUT_KEY_RECORD* recordOut);
// Reads or peeks one logical mouse event. SYS_HANDLE_INVALID selects the process-default session; a zero timeout is nonblocking.
NTL_INPUT_API KSTATUS NtlInputReadMouse(SYS_HANDLE session, uint64_t timeoutMilliseconds, INPUT_MOUSE_EVENT* eventOut);
NTL_INPUT_API KSTATUS NtlInputPeekMouse(SYS_HANDLE session, uint64_t timeoutMilliseconds, INPUT_MOUSE_EVENT* eventOut);
// Snapshots RSSRV's logical key/modifier/pointer state.
NTL_INPUT_API KSTATUS NtlInputQueryState(SYS_HANDLE session, NTL_INPUT_STATE* stateOut);
// Process-local convenience wrappers backed by a lazily connected RSSRV session.
NTL_INPUT_API KSTATUS NtlInputPollKeyboard(INPUT_KEY* keyOut);
NTL_INPUT_API KSTATUS NtlInputIsKeyDown(INPUT_KEY key, bool* downOut);
NTL_INPUT_API KSTATUS NtlInputReadKeyboardChar(char* charOut);
NTL_INPUT_API KSTATUS NtlInputReadKey(INPUT_KEY* keyOut);
NTL_INPUT_API uint32_t NtlInputGetKeyModifiers(void);
NTL_INPUT_API KSTATUS NtlInputQueryDefaultState(NTL_INPUT_STATE* stateOut);
NTL_INPUT_API KSTATUS NtlInputGetMousePos(int* xOut, int* yOut);
#undef NTL_INPUT_API