2019-05-18 05:10:09 +02:00
|
|
|
#include <windows.h>
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
|
|
|
|
#include "platform/amvideo.h"
|
2019-10-15 05:18:18 +02:00
|
|
|
#include "platform/clock.h"
|
2019-09-04 19:43:47 +02:00
|
|
|
#include "platform/dns.h"
|
2023-09-15 07:35:33 +02:00
|
|
|
#include "platform/epay.h"
|
2019-05-18 05:10:09 +02:00
|
|
|
#include "platform/hwmon.h"
|
2019-05-18 05:14:08 +02:00
|
|
|
#include "platform/misc.h"
|
2019-11-02 18:28:55 +01:00
|
|
|
#include "platform/netenv.h"
|
2019-05-18 05:10:09 +02:00
|
|
|
#include "platform/nusec.h"
|
2019-08-31 00:46:57 +02:00
|
|
|
#include "platform/pcbid.h"
|
2019-05-18 05:10:09 +02:00
|
|
|
#include "platform/platform.h"
|
2019-05-18 05:11:51 +02:00
|
|
|
#include "platform/vfs.h"
|
2019-05-18 05:10:09 +02:00
|
|
|
|
2019-11-03 15:52:33 +01:00
|
|
|
HRESULT platform_hook_init(
|
|
|
|
const struct platform_config *cfg,
|
2019-08-31 00:46:57 +02:00
|
|
|
const char *game_id,
|
|
|
|
const char *platform_id,
|
|
|
|
HMODULE redir_mod)
|
|
|
|
{
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
assert(cfg != NULL);
|
|
|
|
assert(game_id != NULL);
|
|
|
|
assert(platform_id != NULL);
|
|
|
|
assert(redir_mod != NULL);
|
|
|
|
|
|
|
|
hr = amvideo_hook_init(&cfg->amvideo, redir_mod);
|
|
|
|
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2019-10-15 05:18:18 +02:00
|
|
|
hr = clock_hook_init(&cfg->clock);
|
|
|
|
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2019-09-04 19:43:47 +02:00
|
|
|
hr = dns_platform_hook_init(&cfg->dns);
|
|
|
|
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2019-08-31 00:46:57 +02:00
|
|
|
hr = hwmon_hook_init(&cfg->hwmon);
|
|
|
|
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
hr = misc_hook_init(&cfg->misc, platform_id);
|
|
|
|
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2019-11-02 18:28:55 +01:00
|
|
|
hr = netenv_hook_init(&cfg->netenv, &cfg->nusec);
|
|
|
|
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2019-08-31 00:46:57 +02:00
|
|
|
hr = nusec_hook_init(&cfg->nusec, game_id, platform_id);
|
|
|
|
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2019-11-04 01:54:31 +01:00
|
|
|
hr = pcbid_hook_init(&cfg->pcbid);
|
|
|
|
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
return hr;
|
|
|
|
}
|
2019-08-31 00:46:57 +02:00
|
|
|
|
2024-04-07 23:55:38 +02:00
|
|
|
hr = vfs_hook_init(&cfg->vfs, game_id);
|
2019-08-31 00:46:57 +02:00
|
|
|
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2023-09-15 07:35:33 +02:00
|
|
|
hr = epay_hook_init(&cfg->epay);
|
|
|
|
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2019-08-31 00:46:57 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|