mirror of
https://gitea.tendokyu.moe/Dniel97/segatools.git
synced 2024-11-27 22:40:48 +01:00
platform/pcbid.c: Return HRESULT for consistency
This commit is contained in:
parent
a5a42c3326
commit
c7255e3ebb
@ -22,22 +22,24 @@ static const struct hook_symbol pcbid_syms[] = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void pcbid_hook_init(const struct pcbid_config *cfg)
|
HRESULT pcbid_hook_init(const struct pcbid_config *cfg)
|
||||||
{
|
{
|
||||||
assert(cfg != NULL);
|
assert(cfg != NULL);
|
||||||
|
|
||||||
if (!cfg->enable) {
|
if (!cfg->enable) {
|
||||||
return;
|
return S_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wcslen(cfg->serial_no) != 15) {
|
if (wcslen(cfg->serial_no) != 15) {
|
||||||
dprintf("Pcbid: ERROR: Must be 15 chars! ex: ACAE01A99999999\n");
|
dprintf("Pcbid: ERROR: Must be 15 chars! ex: ACAE01A99999999\n");
|
||||||
|
|
||||||
return;
|
return E_INVALIDARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(&pcbid_cfg, cfg, sizeof(*cfg));
|
memcpy(&pcbid_cfg, cfg, sizeof(*cfg));
|
||||||
hook_table_apply(NULL, "kernel32.dll", pcbid_syms, _countof(pcbid_syms));
|
hook_table_apply(NULL, "kernel32.dll", pcbid_syms, _countof(pcbid_syms));
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL WINAPI pcbid_GetComputerNameA(char *dest, uint32_t *len)
|
static BOOL WINAPI pcbid_GetComputerNameA(char *dest, uint32_t *len)
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
#include "platform/config.h"
|
#include "platform/config.h"
|
||||||
|
|
||||||
void pcbid_hook_init(const struct pcbid_config *cfg);
|
HRESULT pcbid_hook_init(const struct pcbid_config *cfg);
|
||||||
|
@ -69,7 +69,11 @@ HRESULT platform_hook_init(
|
|||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
pcbid_hook_init(&cfg->pcbid);
|
hr = pcbid_hook_init(&cfg->pcbid);
|
||||||
|
|
||||||
|
if (FAILED(hr)) {
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
|
|
||||||
hr = vfs_hook_init(&cfg->vfs);
|
hr = vfs_hook_init(&cfg->vfs);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user