launcher: Use more descriptive error message for ERROR_MOD_NOT_FOUND
This commit is contained in:
@@ -17,17 +17,23 @@ void module_context_init(struct module_context *module, const char *path)
|
|||||||
|
|
||||||
if (module->dll == NULL) {
|
if (module->dll == NULL) {
|
||||||
LPSTR buffer;
|
LPSTR buffer;
|
||||||
|
DWORD err = GetLastError();
|
||||||
|
|
||||||
FormatMessageA(
|
FormatMessageA(
|
||||||
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
|
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
|
||||||
FORMAT_MESSAGE_IGNORE_INSERTS,
|
FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||||
NULL,
|
NULL,
|
||||||
GetLastError(),
|
err,
|
||||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||||
(LPSTR) &buffer,
|
(LPSTR) &buffer,
|
||||||
0,
|
0,
|
||||||
NULL);
|
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);
|
log_fatal("%s: Failed to load game DLL: %s", path, buffer);
|
||||||
|
|
||||||
LocalFree(buffer);
|
LocalFree(buffer);
|
||||||
|
|||||||
Reference in New Issue
Block a user