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,6 +1,7 @@
|
||||
// Native file metadata smoke test.
|
||||
// Verifies path stat, handle stat, directory metadata, missing paths, and invalid handles without mutating the filesystem.
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
@@ -49,7 +50,7 @@ static void fail(const char* msg) {
|
||||
}
|
||||
|
||||
// Fails the test with one status value.
|
||||
static void fail_status(const char* what, uint32_t status) {
|
||||
static void fail_status(const char* what, KSTATUS status) {
|
||||
print("file_stat_smoke: ");
|
||||
print(what);
|
||||
print(" failed status=");
|
||||
@@ -59,12 +60,12 @@ static void fail_status(const char* what, uint32_t status) {
|
||||
}
|
||||
|
||||
// Copies one string view into a fixed NUL-terminated buffer.
|
||||
static int copy_view(char* out, size_t outSize, SYS_STRING_VIEW view) {
|
||||
static bool copy_view(char* out, size_t outSize, SYS_STRING_VIEW view) {
|
||||
if (!out || outSize == 0 || !view.Data || view.Length + 1 > outSize)
|
||||
return 0;
|
||||
return false;
|
||||
memcpy(out, view.Data, view.Length);
|
||||
out[view.Length] = '\0';
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Builds the containing directory path for one process image path.
|
||||
@@ -97,7 +98,7 @@ static void build_parent_dir(char* out, size_t outSize, const char* path) {
|
||||
}
|
||||
|
||||
// Opens this process image for read/query metadata checks.
|
||||
static uint32_t open_self_image(uint32_t* fileOut, uint64_t* sizeOut) {
|
||||
static KSTATUS open_self_image(uint32_t* fileOut, uint64_t* sizeOut) {
|
||||
SYS_PEB* peb = SysGetPeb();
|
||||
if (!peb || peb->Magic != SYS_PEB_MAGIC || peb->Version != SYS_ENV_VERSION)
|
||||
return NTLSTATUS_INVALID_PARAMETER;
|
||||
@@ -106,7 +107,7 @@ static uint32_t open_self_image(uint32_t* fileOut, uint64_t* sizeOut) {
|
||||
build_parent_dir(gSelfDir, sizeof(gSelfDir), gSelfPath);
|
||||
|
||||
uint32_t h = 0;
|
||||
uint32_t s = NtlOpenFile(SysSvFromCstr(gSelfPath),
|
||||
KSTATUS s = NtlOpenFile(SysSvFromCstr(gSelfPath),
|
||||
SYS_FILE_ACCESS_READ | SYS_FILE_ACCESS_QUERY,
|
||||
SYS_FILE_OPEN_EXISTING,
|
||||
SYS_FILE_FLAG_NONE,
|
||||
@@ -167,7 +168,7 @@ static void check_directory_stat(const SYS_FILE_STAT* stat) {
|
||||
static void test_file_stat(uint32_t file, uint64_t expectedSize) {
|
||||
SYS_FILE_STAT byHandle;
|
||||
memset(&byHandle, 0xA5, sizeof(byHandle));
|
||||
uint32_t s = SysGetFileStat(file, &byHandle);
|
||||
KSTATUS s = SysGetFileStat(file, &byHandle);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("get file stat", s);
|
||||
check_regular_stat(&byHandle, expectedSize, "handle stat");
|
||||
|
||||
@@ -192,7 +193,7 @@ static void test_file_stat(uint32_t file, uint64_t expectedSize) {
|
||||
static void test_directory_stat(void) {
|
||||
SYS_FILE_STAT stat;
|
||||
memset(&stat, 0xCC, sizeof(stat));
|
||||
uint32_t s = NtlStatPath(SysSvFromCstr(gSelfDir), &stat);
|
||||
KSTATUS s = NtlStatPath(SysSvFromCstr(gSelfDir), &stat);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("directory stat", s);
|
||||
check_directory_stat(&stat);
|
||||
}
|
||||
@@ -200,7 +201,7 @@ static void test_directory_stat(void) {
|
||||
// Checks failure status paths that stat callers depend on.
|
||||
static void test_failure_paths(void) {
|
||||
SYS_FILE_STAT stat;
|
||||
uint32_t s = NtlStatPath(SYS_SV_LITERAL("file_stat_smoke_missing.nope"), &stat);
|
||||
KSTATUS s = NtlStatPath(SYS_SV_LITERAL("file_stat_smoke_missing.nope"), &stat);
|
||||
if (s != NTLSTATUS_NOT_FOUND) fail_status("missing path status", s);
|
||||
|
||||
s = SysGetFileStat(0xFFFFFFFFu, &stat);
|
||||
|
||||
Reference in new issue
Block a user