76 lines
1.3 KiB
C
76 lines
1.3 KiB
C
#include <windows.h>
|
|
|
|
#include <assert.h>
|
|
|
|
#include "platform/cert.h"
|
|
#include "platform/clock.h"
|
|
#include "platform/dns.h"
|
|
#include "platform/misc.h"
|
|
#include "platform/netenv.h"
|
|
#include "platform/ttxsec.h"
|
|
#include "platform/platform.h"
|
|
#include "platform/vfs.h"
|
|
#include "platform/syscfg.h"
|
|
|
|
HRESULT platform_hook_init(
|
|
const struct platform_config *cfg,
|
|
const uint32_t game_id,
|
|
HMODULE redir_mod)
|
|
{
|
|
HRESULT hr;
|
|
|
|
assert(cfg != NULL);
|
|
assert(game_id != 0);
|
|
assert(redir_mod != NULL);
|
|
|
|
hr = cert_hook_init(&cfg->cert);
|
|
|
|
if (FAILED(hr)) {
|
|
return hr;
|
|
}
|
|
|
|
hr = clock_hook_init(&cfg->clock);
|
|
|
|
if (FAILED(hr)) {
|
|
return hr;
|
|
}
|
|
|
|
hr = dns_platform_hook_init(&cfg->dns);
|
|
|
|
if (FAILED(hr)) {
|
|
return hr;
|
|
}
|
|
|
|
hr = misc_hook_init(&cfg->misc);
|
|
|
|
if (FAILED(hr)) {
|
|
return hr;
|
|
}
|
|
|
|
hr = netenv_hook_init(&cfg->netenv, &cfg->ttxsec);
|
|
|
|
if (FAILED(hr)) {
|
|
return hr;
|
|
}
|
|
|
|
hr = ttxsec_hook_init(&cfg->ttxsec, game_id);
|
|
|
|
if (FAILED(hr)) {
|
|
return hr;
|
|
}
|
|
|
|
hr = vfs_hook_init(&cfg->vfs);
|
|
|
|
if (FAILED(hr)) {
|
|
return hr;
|
|
}
|
|
|
|
hr = syscfg_hook_init(&cfg->syscfg, game_id);
|
|
|
|
if (FAILED(hr)) {
|
|
return hr;
|
|
}
|
|
|
|
return S_OK;
|
|
}
|