major restructuring, prepare for smp
This commit is contained in:
1 parent
b3569a2b90
commit
6bff37746d
229 files changed
+1617
-1489
No files matched your search
@@ -0,0 +1,76 @@
|
||||
// user32.c - Win32 User Interface
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <ntlite/syscall.h>
|
||||
|
||||
typedef void* HWND;
|
||||
typedef void* HDC;
|
||||
typedef long LONG;
|
||||
typedef int BOOL;
|
||||
|
||||
typedef struct _RECT { LONG left, top, right, bottom; } RECT;
|
||||
typedef struct tagPAINTSTRUCT {
|
||||
HDC hdc; BOOL fErase; RECT rcPaint; BOOL fRestore; BOOL fIncUpdate; char res[32];
|
||||
} PAINTSTRUCT;
|
||||
|
||||
|
||||
static void User32DebugPrintA(const char* s) {
|
||||
if (!s) return;
|
||||
SYS_DEBUG_PRINT_REQUEST req = { SysSvFromCstr(s) };
|
||||
SysDebugPrint(&req);
|
||||
}
|
||||
|
||||
// --- Painting Functions ---
|
||||
__declspec(dllexport) HDC BeginPaint(HWND hwnd, PAINTSTRUCT* lpPaint) {
|
||||
(void)hwnd;
|
||||
if (lpPaint) {
|
||||
lpPaint->hdc = (HDC)1;
|
||||
lpPaint->rcPaint.right = 1920; lpPaint->rcPaint.bottom = 1080;
|
||||
}
|
||||
return (HDC)1;
|
||||
}
|
||||
|
||||
__declspec(dllexport) BOOL EndPaint(HWND hwnd, const PAINTSTRUCT* lp) { (void)hwnd; (void)lp; return 1; }
|
||||
|
||||
// --- Message Loop Stubs ---
|
||||
__declspec(dllexport) int GetMessage(void* m, HWND h, uint32_t f, uint32_t l) {
|
||||
(void)m; (void)h; (void)f; (void)l; SysYield(); return 0;
|
||||
}
|
||||
__declspec(dllexport) int PeekMessage(void* m, HWND h, uint32_t f, uint32_t l, uint32_t r) {
|
||||
(void)m; (void)h; (void)f; (void)l; (void)r;
|
||||
return 0;
|
||||
}
|
||||
__declspec(dllexport) int DispatchMessage(const void* m) { (void)m; return 0; }
|
||||
__declspec(dllexport) int TranslateMessage(const void* m) { (void)m; return 0; }
|
||||
|
||||
// --- Dialogs & UI ---
|
||||
__declspec(dllexport) int MessageBoxA(HWND h, const char* txt, const char* cap, uint32_t type) {
|
||||
(void)h; (void)cap; (void)type;
|
||||
User32DebugPrintA("USER32: MessageBoxA: ");
|
||||
User32DebugPrintA(txt);
|
||||
User32DebugPrintA("\n");
|
||||
return 1; // IDOK
|
||||
}
|
||||
|
||||
// --- Window Queries ---
|
||||
__declspec(dllexport) HWND GetDesktopWindow(void) { return (HWND)0; }
|
||||
__declspec(dllexport) HWND GetActiveWindow(void) { return (HWND)0; }
|
||||
__declspec(dllexport) HWND GetTopWindow(HWND hwnd){ (void)hwnd; return (HWND)0; }
|
||||
|
||||
__declspec(dllexport) HWND GetWindow(HWND hwnd, unsigned int cmd) {
|
||||
(void)hwnd; (void)cmd; return (HWND)0;
|
||||
}
|
||||
|
||||
__declspec(dllexport) long GetWindowLongA(HWND hwnd, int index) {
|
||||
(void)hwnd; (void)index; return 0;
|
||||
}
|
||||
|
||||
__declspec(dllexport) intptr_t GetWindowLongPtrA(HWND hwnd, int index) {
|
||||
(void)hwnd; (void)index; return 0;
|
||||
}
|
||||
|
||||
__declspec(dllexport) unsigned long GetWindowThreadProcessId(HWND hwnd, unsigned long* pid) {
|
||||
(void)hwnd;
|
||||
if (pid) *pid = 1;
|
||||
return 1; // Thread ID
|
||||
}
|
||||
Reference in new issue
Block a user