1
0
mirror of https://github.com/djhackersdev/bemanitools.git synced 2025-02-01 04:15:46 +01:00

launcher: Use more descriptive error message for ERROR_MOD_NOT_FOUND

This commit is contained in:
Will Xyen 2020-07-05 18:46:06 -07:00 committed by adfe3beeadc615e0fa48b493761cc42aae47d399
parent 2a2c77f255
commit 4816fb809d

View File

@ -17,17 +17,23 @@ void module_context_init(struct module_context *module, const char *path)
if (module->dll == NULL) {
LPSTR buffer;
DWORD err = GetLastError();
FormatMessageA(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
err,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPSTR) &buffer,
0,
NULL);
if (err == ERROR_MOD_NOT_FOUND) {
log_warning("%s is likely missing dependencies", path);
log_warning("Do you have vcredist/directx runtimes installed?");
}
log_fatal("%s: Failed to load game DLL: %s", path, buffer);
LocalFree(buffer);