Add country reg hook

This commit is contained in:
Hay1tsme
2026-03-12 12:11:59 -04:00
parent f87881972f
commit 161b0dc004
3 changed files with 16 additions and 1 deletions
+1
View File
@@ -276,6 +276,7 @@ void syscfg_config_load(struct syscfg_config *cfg, const wchar_t *filename)
{
cfg->enable = GetPrivateProfileIntW(L"syscfg", L"enable", 1, filename);
cfg->log_level = GetPrivateProfileIntW(L"syscfg", L"log_level", 1, filename);
cfg->country = GetPrivateProfileIntW(L"syscfg", L"country", 0, filename);
}
void vfs_config_load(struct vfs_config *cfg, const wchar_t *filename)
+14 -1
View File
@@ -20,6 +20,7 @@ static HRESULT syscfg_log_level(void *bytes, uint32_t *nbytes);
static HRESULT syscfg_news_path(void *bytes, uint32_t *nbytes);
static HRESULT syscfg_event_path(void *bytes, uint32_t *nbytes);
static HRESULT syscfg_log_path(void *bytes, uint32_t *nbytes);
static HRESULT syscfg_country(void *bytes, uint32_t *nbytes);
static const struct reg_hook_val fake_com_keys[] = {
{
@@ -54,7 +55,11 @@ static const struct reg_hook_val fake_com_keys[] = {
.name = L"LogPath",
.read = syscfg_log_path,
.type = REG_SZ,
},
},{
.name = L"Country",
.read = syscfg_country,
.type = REG_SZ,
}
};
HRESULT syscfg_hook_init(const struct syscfg_config *cfg, const uint32_t gid)
@@ -116,3 +121,11 @@ static HRESULT syscfg_log_path(void *bytes, uint32_t *nbytes)
{
return reg_hook_read_wstr(bytes, nbytes, L"D:\\");
}
static HRESULT syscfg_country(void *bytes, uint32_t *nbytes)
{
// 0x00000000 jp
// 0x00000001 cn
// 0x00000002 hk (english)
return reg_hook_read_u32(bytes, nbytes, config.country);
}
+1
View File
@@ -7,6 +7,7 @@
struct syscfg_config {
bool enable;
uint32_t log_level;
uint32_t country;
};
HRESULT syscfg_hook_init(const struct syscfg_config *cfg, const uint32_t gid);