2023-01-03 05:35:53 +01:00
|
|
|
#include "platform/platform.h"
|
|
|
|
|
|
|
|
HRESULT platform_hook_init(
|
|
|
|
const struct platform_config *cfg,
|
|
|
|
enum platform_type type,
|
|
|
|
jvs_provider_t jvs,
|
2023-01-26 03:09:38 +01:00
|
|
|
HMODULE redir_mod,
|
|
|
|
struct dongle_info d_info
|
2023-01-03 05:35:53 +01:00
|
|
|
)
|
|
|
|
{
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
assert(cfg != NULL);
|
|
|
|
assert(redir_mod != NULL);
|
|
|
|
|
|
|
|
hr = netenv_hook_init(&cfg->netenv);
|
|
|
|
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
hr = locale_hook_init(&cfg->locale);
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2023-01-07 06:52:08 +01:00
|
|
|
if (jvs != NULL) {
|
2023-01-03 05:35:53 +01:00
|
|
|
hr = jvs_hook_init(&cfg->jvs, jvs);
|
|
|
|
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
hr = misc_hook_init(&cfg->misc);
|
|
|
|
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
hr = vfs_hook_init(&cfg->vfs);
|
|
|
|
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2023-03-10 08:46:37 +01:00
|
|
|
hr = es3sec_hook_init(&cfg->dongle, d_info.vid, d_info.pid, d_info.manufacturer, d_info.product);
|
2023-01-07 06:52:08 +01:00
|
|
|
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2023-01-03 05:35:53 +01:00
|
|
|
return S_OK;
|
2023-01-07 06:52:08 +01:00
|
|
|
}
|