Add support for SN compilers (#4)

* More kernel32 functions implemented poorly

* fix a smattering of issues to make cc1n64 work

* fix issues breaking psyq aspsx

* Return lowercase Windows paths if uppercase path doesnt exist

* Add SetStdHandle

* Add super naive FormatMessageA

* Case insensitive file matching

* PR comments

* Adding CompareString* + SetEnvironmentVariableA functions

Co-authored-by: Ash Wolf <ninji@wuffs.org>
Co-authored-by: Simon Lindholm <simon.lindholm10@gmail.com>
This commit is contained in:
Mark Street
2022-07-03 15:27:48 +01:00
committed by GitHub
parent 5c1f8ca7c8
commit b9f6c4c64e
4 changed files with 379 additions and 28 deletions

View File

@@ -47,27 +47,27 @@ DEFINE_STUBS(3, 0) DEFINE_STUBS(3, 1) DEFINE_STUBS(3, 2) DEFINE_STUBS(3, 3)
#undef DEFINE_STUBS
void *wibo::resolveStubByName(const char *dllName, const char *funcName) {
if (strcmp(dllName, "KERNEL32.dll") == 0) {
if (strcasecmp(dllName, "KERNEL32.dll") == 0) {
void *func = wibo::resolveKernel32(funcName);
if (func)
return func;
}
if (strcmp(dllName, "USER32.dll") == 0) {
if (strcasecmp(dllName, "USER32.dll") == 0) {
void *func = wibo::resolveUser32(funcName);
if (func)
return func;
}
if (strcmp(dllName, "ADVAPI32.dll") == 0) {
if (strcasecmp(dllName, "ADVAPI32.dll") == 0) {
void *func = wibo::resolveAdvApi32(funcName);
if (func)
return func;
}
if (strcmp(dllName, "VERSION.dll") == 0) {
if (strcasecmp(dllName, "VERSION.dll") == 0) {
void *func = wibo::resolveVersion(funcName);
if (func)
return func;
}
if (strcmp(dllName, "ole32.dll") == 0) {
if (strcasecmp(dllName, "ole32.dll") == 0) {
void *func = wibo::resolveOle32(funcName);
if (func)
return func;