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 thread-description smoke test.
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
@@ -59,6 +60,27 @@ int main(void) {
|
||||
if (set_name(SYS_HANDLE_INVALID, TEST_NAME_MAIN) != NTLSTATUS_SUCCESS)
|
||||
fail("set current name failed");
|
||||
|
||||
// Native thread descriptions accept well-formed UTF-8 and reject malformed bytes.
|
||||
static const char unicodeName[] = "thread-\xC3\xA9";
|
||||
if (set_name(SYS_HANDLE_INVALID, unicodeName) != NTLSTATUS_SUCCESS)
|
||||
fail("valid UTF-8 thread name rejected");
|
||||
|
||||
static const char invalidName[] = { 'b', (char)0xC0, (char)0xAF, 0 };
|
||||
if (set_name(SYS_HANDLE_INVALID, invalidName) != NTLSTATUS_INVALID_PARAMETER)
|
||||
fail("overlong UTF-8 thread name accepted");
|
||||
|
||||
SYS_SET_THREAD_NAME_REQUEST nulRequest;
|
||||
memset(&nulRequest, 0, sizeof(nulRequest));
|
||||
nulRequest.Size = sizeof(nulRequest);
|
||||
nulRequest.ThreadHandle = SYS_HANDLE_INVALID;
|
||||
static const char nulName[] = { 'a', 0, 'b' };
|
||||
nulRequest.Name = SysSvFromParts(nulName, sizeof(nulName));
|
||||
if (SysSetThreadName(&nulRequest) != NTLSTATUS_INVALID_PARAMETER)
|
||||
fail("embedded NUL thread name accepted");
|
||||
|
||||
if (set_name(SYS_HANDLE_INVALID, TEST_NAME_MAIN) != NTLSTATUS_SUCCESS)
|
||||
fail("restore current thread name failed");
|
||||
|
||||
char name[SYS_THREAD_NAME_MAX];
|
||||
size_t length = 0;
|
||||
KSTATUS status = SysQueryThreadName(SYS_HANDLE_INVALID, name, sizeof(name), &length);
|
||||
@@ -102,13 +124,13 @@ int main(void) {
|
||||
if (status != NTLSTATUS_SUCCESS)
|
||||
fail("thread enumeration failed");
|
||||
|
||||
int foundWorker = 0;
|
||||
bool foundWorker = false;
|
||||
size_t visible = threadCount < TEST_MAX_THREADS ? threadCount : TEST_MAX_THREADS;
|
||||
for (size_t i = 0; i < visible; ++i) {
|
||||
if (threads[i].ThreadId == tid) {
|
||||
if (strcmp(threads[i].Name, TEST_NAME_WORKER) != 0)
|
||||
fail("thread-list name mismatch");
|
||||
foundWorker = 1;
|
||||
foundWorker = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user