mirror of
https://gitea.tendokyu.moe/TeamTofuShop/taitools.git
synced 2026-09-22 22:28:06 +03:00
Add country reg hook
This commit is contained in:
@@ -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
@@ -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);
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user