58 lines
1.3 KiB
C
58 lines
1.3 KiB
C
#include <assert.h>
|
|
#include <stddef.h>
|
|
|
|
#include "ferrumhook/config.h"
|
|
|
|
#include "platform/config.h"
|
|
|
|
void ferrum_dll_config_load(
|
|
struct ferrum_dll_config *cfg,
|
|
const wchar_t *filename)
|
|
{
|
|
assert(cfg != NULL);
|
|
assert(filename != NULL);
|
|
|
|
GetPrivateProfileStringW(
|
|
L"ferrumio",
|
|
L"path",
|
|
L"",
|
|
cfg->path,
|
|
_countof(cfg->path),
|
|
filename);
|
|
}
|
|
|
|
void ferrum_xinput_config_load(
|
|
struct ferrum_xinput_config *cfg,
|
|
const wchar_t *filename)
|
|
{
|
|
assert(cfg != NULL);
|
|
assert(filename != NULL);
|
|
|
|
cfg->enable = GetPrivateProfileIntW(L"xinput", L"enable", 1, filename);
|
|
}
|
|
|
|
void ferrum_network_config_load(
|
|
struct ferrum_network_config *cfg,
|
|
const wchar_t *filename)
|
|
{
|
|
assert(cfg != NULL);
|
|
assert(filename != NULL);
|
|
|
|
cfg->enable = GetPrivateProfileIntW(L"network", L"enable", 1, filename);
|
|
}
|
|
|
|
|
|
void ferrum_hook_config_load(
|
|
struct ferrum_hook_config *cfg,
|
|
const wchar_t *filename)
|
|
{
|
|
assert(cfg != NULL);
|
|
assert(filename != NULL);
|
|
|
|
platform_config_load(&cfg->platform, filename);
|
|
ferrum_dll_config_load(&cfg->dll, filename);
|
|
ferrum_xinput_config_load(&cfg->xinput, filename);
|
|
gfx_config_load(&cfg->gfx, filename);
|
|
ferrum_network_config_load(&cfg->network, filename);
|
|
}
|