15 Commits

Author SHA1 Message Date
f366e77956 Rewrite FindFirstFile/FindNextFile (again), add comprehensive tests 2025-10-06 17:57:54 -06:00
01ed50c4b4 Fix pipe reads; add tests for NtReadFile & pipes 2025-10-05 23:24:50 -06:00
0d76e541c1 Reorg headers, module_registry -> modules, remove ActCtx msvcr80.dll hack 2025-10-05 17:46:16 -06:00
0bc80b6618 Split into HostContextGuard/GuestContextGuard 2025-10-05 14:32:06 -06:00
cd7baffc5e Save/restore fs/gs segments when re-entering host code 2025-10-05 13:58:40 -06:00
705607fcfb Remove now-redundant .dll names from module stubs 2025-09-29 23:35:16 -06:00
9dd65bc70a More msvcrt (WIP quality) and various fixes 2025-09-29 20:07:19 -06:00
c17953b318 Refactor main module resolution & HMODULE handle behavior 2025-09-29 13:50:27 -06:00
8cac50e50e Rewrite BCryptGenRandom and add tests 2025-09-28 17:20:43 -06:00
bc33bae659 Formatting, fixes, deduplication 2025-09-28 17:00:38 -06:00
104e9e869d Add proper testing framework & integrate with CI 2025-09-26 10:39:09 -06:00
c14ad86d72 Implement version.dll properly 2025-09-26 09:49:21 -06:00
836f485d66 Initial external DLL support 2025-09-26 00:55:35 -06:00
c4de05946d
Fix TlsGetValue & more (#48)
`TlsGetValue` disambiguates 0 and an error by relying on `GetLastError`. Depending on the program state, `GetLastError` could be non-0, even though `TlsGetValue` succeeded. Resolve this by always setting `wibo::lastError`. This matches the behavior described by the documentation.

Additionally, when reading resources, later versions of mwcc and mwld call `GetModuleHandleA` with the program path, and then call `LoadStringA` on that handle. Support this behavior by _actually_ loading the PE at the path passed in to `GetModuleHandleA`, instead of assuming it's the current program.

(This is especially useful because sjiswrap relies on overriding `GetModuleFileNameA`, so the wrapped program reads its own resources, rather than sjiswrap's.)

Other small changes:
- Add ms-win-crt `exit` & run atexit funcs
- Implements vcruntime `memmove`
- Implements kernel32 `GetModuleFileNameA`
2023-10-01 23:56:35 -04:00
94b44fd697
Everything needed to run simple Rust programs (#40)
* Everything needed to run simple Rust programs

* Add IsDBCSLeadByte implementation

* Address PR comments
2023-09-10 12:07:23 +09:00