mirror of
https://gitea.tendokyu.moe/TeamTofuShop/taitools.git
synced 2026-09-22 22:28:06 +03:00
45 lines
1.3 KiB
C
45 lines
1.3 KiB
C
#include <windows.h>
|
|
|
|
#include <assert.h>
|
|
#include <stdbool.h>
|
|
#include <stddef.h>
|
|
#include <stdlib.h>
|
|
|
|
#include "board/config.h"
|
|
|
|
void io4_config_load(struct io4_config *cfg, const wchar_t *filename)
|
|
{
|
|
assert(cfg != NULL);
|
|
assert(filename != NULL);
|
|
|
|
cfg->enable = GetPrivateProfileIntW(L"io4", L"enable", 1, filename);
|
|
}
|
|
|
|
void k92x0249_config_load(struct k92x0249_config *cfg, const wchar_t *filename)
|
|
{
|
|
assert(cfg != NULL);
|
|
assert(filename != NULL);
|
|
wchar_t wserial[17];
|
|
|
|
cfg->read_button = GetPrivateProfileIntW(L"reader", L"read_button", VK_RETURN, filename);
|
|
GetPrivateProfileStringW(L"reader", L"card_serial", L"7020392000000000", wserial, _countof(wserial), filename);
|
|
|
|
wcstombs_s(NULL, cfg->serial, sizeof(cfg->serial), wserial, sizeof(cfg->serial) - 1);
|
|
}
|
|
|
|
void k9101258_config_load(struct usbio_config *cfg, const wchar_t *filename)
|
|
{
|
|
assert(cfg != NULL);
|
|
assert(filename != NULL);
|
|
wchar_t wserial[17];
|
|
|
|
cfg->enabled = GetPrivateProfileIntW(L"usbio", L"enable", 1, filename);
|
|
}
|
|
|
|
void dongle_config_load(struct dongle_config *cfg, const wchar_t *filename)
|
|
{
|
|
assert(cfg != NULL);
|
|
assert(filename != NULL);
|
|
GetPrivateProfileStringW(L"reader", L"card_serial", L"702039200000000", cfg->serial, _countof(cfg->serial), filename);
|
|
}
|