Refactor main module resolution & HMODULE handle behavior

This commit is contained in:
2025-09-29 13:50:27 -06:00
parent 4a2ba45620
commit c17953b318
13 changed files with 355 additions and 224 deletions

View File

@@ -122,6 +122,8 @@ int WIN_ENTRY strcmp(const char *lhs, const char *rhs) { return ::strcmp(lhs, rh
int WIN_ENTRY strncmp(const char *lhs, const char *rhs, size_t count) { return ::strncmp(lhs, rhs, count); }
char *WIN_ENTRY strcpy(char *dest, const char *src) { return ::strcpy(dest, src); }
void *WIN_ENTRY malloc(size_t size) { return ::malloc(size); }
void *WIN_ENTRY calloc(size_t count, size_t size) { return ::calloc(count, size); }
@@ -262,6 +264,8 @@ static void *resolveByName(const char *name) {
return (void *)crt::strcmp;
if (strcmp(name, "strncmp") == 0)
return (void *)crt::strncmp;
if (strcmp(name, "strcpy") == 0)
return (void *)crt::strcpy;
if (strcmp(name, "malloc") == 0)
return (void *)crt::malloc;
if (strcmp(name, "calloc") == 0)