clean up and standardize types across the codebase, unify atomic operations, improve UTF-8 handling throughout the system, remove obsolete input and named queue interfaces, redesign process preparation and creation, tighten IPC and service boundaries, improve error handling and reliability, minor documentation cleanup, fix doom surfaces, fix panic in ini parsing.
This commit is contained in:
1 parent
899225f551
commit
c0ad63c27f
226 files changed
+6562
-4147
No files matched your search
@@ -1,5 +1,6 @@
|
||||
// Native console client. RSSRV owns the logical console; this file speaks its Port protocol.
|
||||
|
||||
#include <ntlite/atomic.h>
|
||||
#include <ntlite/console_service.h>
|
||||
#include <ntlite/port.h>
|
||||
#include <ntlite/resource.h>
|
||||
@@ -7,7 +8,7 @@
|
||||
#include <intrin.h>
|
||||
#include <string.h>
|
||||
|
||||
static volatile long gDefaultConsoleSession;
|
||||
static volatile uint32_t gDefaultConsoleSession;
|
||||
static KSTATUS NtlConsoleGetDefaultSession(SYS_HANDLE* sessionOut);
|
||||
|
||||
// Connects to RSSRV's native console service.
|
||||
@@ -40,9 +41,9 @@ KSTATUS NtlConsoleClose(SYS_HANDLE session) {
|
||||
// Returns one process-local cached console session.
|
||||
static KSTATUS NtlConsoleGetDefaultSession(SYS_HANDLE* sessionOut) {
|
||||
if (!sessionOut) return NTLSTATUS_INVALID_PARAMETER;
|
||||
long current = gDefaultConsoleSession;
|
||||
uint32_t current = gDefaultConsoleSession;
|
||||
if (current != 0) {
|
||||
*sessionOut = (SYS_HANDLE)(uint32_t)current;
|
||||
*sessionOut = (SYS_HANDLE)current;
|
||||
return NTLSTATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -50,10 +51,10 @@ static KSTATUS NtlConsoleGetDefaultSession(SYS_HANDLE* sessionOut) {
|
||||
KSTATUS status = NtlConsoleConnect(&created);
|
||||
if (!KSUCCESS(status)) return status;
|
||||
|
||||
long previous = _InterlockedCompareExchange(&gDefaultConsoleSession, (long)created, 0);
|
||||
uint32_t previous = NtlAtomicCompareExchangeU32(&gDefaultConsoleSession, created, 0);
|
||||
if (previous != 0) {
|
||||
(void)NtlConsoleClose(created);
|
||||
created = (SYS_HANDLE)(uint32_t)previous;
|
||||
created = (SYS_HANDLE)previous;
|
||||
}
|
||||
*sessionOut = created;
|
||||
return NTLSTATUS_SUCCESS;
|
||||
@@ -152,7 +153,7 @@ static KSTATUS NtlConsoleSimpleCall(SYS_HANDLE session, NTL_CONSOLE_REQUEST* req
|
||||
}
|
||||
|
||||
// Updates the logical console cursor.
|
||||
KSTATUS NtlConsoleSetCursor(SYS_HANDLE session, int x, int y) {
|
||||
KSTATUS NtlConsoleSetCursor(SYS_HANDLE session, int32_t x, int32_t y) {
|
||||
NTL_CONSOLE_REQUEST request;
|
||||
memset(&request, 0, sizeof(request));
|
||||
request.Size = sizeof(request);
|
||||
@@ -164,7 +165,7 @@ KSTATUS NtlConsoleSetCursor(SYS_HANDLE session, int x, int y) {
|
||||
}
|
||||
|
||||
// Fills console characters over one linear cell range.
|
||||
KSTATUS NtlConsoleFillCharacter(SYS_HANDLE session, char character, int x, int y,
|
||||
KSTATUS NtlConsoleFillCharacter(SYS_HANDLE session, char character, int32_t x, int32_t y,
|
||||
size_t length, size_t* writtenOut) {
|
||||
if (writtenOut) *writtenOut = 0;
|
||||
if (length > UINT32_MAX) return NTLSTATUS_INVALID_PARAMETER;
|
||||
@@ -184,7 +185,7 @@ KSTATUS NtlConsoleFillCharacter(SYS_HANDLE session, char character, int x, int y
|
||||
}
|
||||
|
||||
// Fills console attributes over one linear cell range.
|
||||
KSTATUS NtlConsoleFillAttribute(SYS_HANDLE session, uint16_t attribute, int x, int y,
|
||||
KSTATUS NtlConsoleFillAttribute(SYS_HANDLE session, uint16_t attribute, int32_t x, int32_t y,
|
||||
size_t length, size_t* writtenOut) {
|
||||
if (writtenOut) *writtenOut = 0;
|
||||
if (length > UINT32_MAX) return NTLSTATUS_INVALID_PARAMETER;
|
||||
@@ -204,7 +205,7 @@ KSTATUS NtlConsoleFillAttribute(SYS_HANDLE session, uint16_t attribute, int x, i
|
||||
}
|
||||
|
||||
// Draws one glyph at explicit pixel coordinates without moving console state.
|
||||
KSTATUS NtlConsolePutCharacter(SYS_HANDLE session, char character, int x, int y,
|
||||
KSTATUS NtlConsolePutCharacter(SYS_HANDLE session, char character, int32_t x, int32_t y,
|
||||
uint32_t foreground, uint32_t background) {
|
||||
NTL_CONSOLE_REQUEST request;
|
||||
memset(&request, 0, sizeof(request));
|
||||
|
||||
Reference in new issue
Block a user