add a realtime scheduler class and priority-inheritance mutexes with timeouts and abandonment, add an HDA audio driver and a SYS_AUDIO_* syscall family, flesh out kernel32 with Win32 threads, events, mutexes, critical sections, and condition variables, add SYS_RESUME_THREAD for suspended thread creation, add KeInitializeMemoryTypes to reprogram MTRRs and install a canonical PAT for WB/WC/UC control, rework the display pipeline with a pitched present path and console output flush, bring back disk.vhd with mtools since vvfat fucking sucks, harden AHCI with serialized cache flush, USB mass storage with SCSI sense-data decoding, and xHCI with cleaner DMA teardown, fix the last stray for(;;) in HalStopProcessor to while(true), pile on smoke tests for audio, win32 sync primitives, and thread suspend, implement AHCI timeout, kill readahead since it was desperetaly trying to murder me, fix doom sound x2.
This commit is contained in:
1 parent
8b254f84f4
commit
4add6789ba
177 files changed
+22565
-3070
No files matched your search
@@ -0,0 +1,51 @@
|
||||
// Win32 process-local module lookup smoke test.
|
||||
|
||||
#include <stdint.h>
|
||||
#include <ntlite/syscall.h>
|
||||
|
||||
typedef void* HANDLE;
|
||||
typedef int BOOL;
|
||||
|
||||
typedef BOOL (__stdcall *IS_DEBUGGER_PRESENT_ROUTINE)(void);
|
||||
|
||||
__declspec(dllimport) HANDLE GetModuleHandleA(const char* moduleName);
|
||||
__declspec(dllimport) void* GetProcAddress(HANDLE module, const char* procedureName);
|
||||
|
||||
// Writes one test message to the native console.
|
||||
static void print(const char* text) {
|
||||
SYS_WRITE_CONSOLE_REQUEST request = { SysSvFromCstr(text) };
|
||||
(void)SysWriteConsole(&request);
|
||||
}
|
||||
|
||||
// Terminates the test after one contract failure.
|
||||
static void fail(const char* message) {
|
||||
print("win32_module_lookup_smoke: ");
|
||||
print(message);
|
||||
print("\n");
|
||||
while (true)
|
||||
(void)SysExitProcess(1);
|
||||
}
|
||||
|
||||
// Verifies extensionless system-module lookup and dynamic debugger probing.
|
||||
int main(void) {
|
||||
print("win32_module_lookup_smoke: begin\n");
|
||||
|
||||
HANDLE fullName = GetModuleHandleA("kernel32.dll");
|
||||
HANDLE baseName = GetModuleHandleA("KERNEL32");
|
||||
if (!fullName || !baseName || fullName != baseName)
|
||||
fail("extensionless KERNEL32 lookup failed");
|
||||
|
||||
if (GetModuleHandleA("kernel32.invalid"))
|
||||
fail("invalid module suffix was accepted");
|
||||
|
||||
IS_DEBUGGER_PRESENT_ROUTINE isDebuggerPresent =
|
||||
(IS_DEBUGGER_PRESENT_ROUTINE)GetProcAddress(baseName, "IsDebuggerPresent");
|
||||
if (!isDebuggerPresent)
|
||||
fail("IsDebuggerPresent was absent from GetProcAddress");
|
||||
if (isDebuggerPresent())
|
||||
fail("IsDebuggerPresent reported a debugger");
|
||||
|
||||
print("win32_module_lookup_smoke: PASS\n");
|
||||
while (true)
|
||||
(void)SysExitProcess(0);
|
||||
}
|
||||
Reference in new issue
Block a user