platform/vfs.c: Abort if VFS is misconfigured

This commit is contained in:
Tau 2019-11-05 20:44:00 -05:00
parent a94772b0c4
commit 48721f5418
2 changed files with 14 additions and 2 deletions

View File

@ -283,7 +283,7 @@ void vfs_config_load(struct vfs_config *cfg, const wchar_t *filename)
GetPrivateProfileStringW( GetPrivateProfileStringW(
L"vfs", L"vfs",
L"amfs", L"amfs",
L"E:\\", L"",
cfg->amfs, cfg->amfs,
_countof(cfg->amfs), _countof(cfg->amfs),
filename); filename);
@ -291,7 +291,7 @@ void vfs_config_load(struct vfs_config *cfg, const wchar_t *filename)
GetPrivateProfileStringW( GetPrivateProfileStringW(
L"vfs", L"vfs",
L"appdata", L"appdata",
L"Y:\\", L"",
cfg->appdata, cfg->appdata,
_countof(cfg->appdata), _countof(cfg->appdata),
filename); filename);

View File

@ -53,6 +53,18 @@ HRESULT vfs_hook_init(const struct vfs_config *config)
return S_FALSE; return S_FALSE;
} }
if (config->amfs[0] == L'\0') {
dprintf("Vfs: FATAL: AMFS path not specified in INI file\n");
return E_FAIL;
}
if (config->appdata[0] == L'\0') {
dprintf("Vfs: FATAL: APPDATA path not specified in INI file\n");
return E_FAIL;
}
home_ok = GetEnvironmentVariableW( home_ok = GetEnvironmentVariableW(
L"USERPROFILE", L"USERPROFILE",
vfs_nthome_real, vfs_nthome_real,