wibo/dll
Luke Street 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
..
advapi32.cpp Everything needed to run simple Rust programs (#40) 2023-09-10 12:07:23 +09:00
bcrypt.cpp Everything needed to run simple Rust programs (#40) 2023-09-10 12:07:23 +09:00
crt.cpp Fix `TlsGetValue` & more (#48) 2023-10-01 23:56:35 -04:00
kernel32.cpp Fix `TlsGetValue` & more (#48) 2023-10-01 23:56:35 -04:00
lmgr.cpp Everything needed to run simple Rust programs (#40) 2023-09-10 12:07:23 +09:00
mscoree.cpp CorExitProcess for armcc_41_1440 (#44) 2023-09-12 22:44:56 +09:00
msvcrt.cpp CorExitProcess for armcc_41_1440 (#44) 2023-09-12 22:44:56 +09:00
ntdll.cpp Everything needed to run simple Rust programs (#40) 2023-09-10 12:07:23 +09:00
ole32.cpp Everything needed to run simple Rust programs (#40) 2023-09-10 12:07:23 +09:00
user32.cpp Fix `TlsGetValue` & more (#48) 2023-10-01 23:56:35 -04:00
vcruntime.cpp Fix `TlsGetValue` & more (#48) 2023-10-01 23:56:35 -04:00
version.cpp Everything needed to run simple Rust programs (#40) 2023-09-10 12:07:23 +09:00