forked from TeamTofuShop/segatools
Use new iohook_open_nul_fd() API
Makes error handling more consistent
This commit is contained in:
@ -26,15 +26,27 @@ static HANDLE hwmon_fd;
|
||||
|
||||
HRESULT hwmon_hook_init(const struct hwmon_config *cfg)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
assert(cfg != NULL);
|
||||
|
||||
if (!cfg->enable) {
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
hwmon_fd = iohook_open_dummy_fd();
|
||||
hr = iohook_open_nul_fd(&hwmon_fd);
|
||||
|
||||
return iohook_push_handler(hwmon_handle_irp);
|
||||
if (FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
hr = iohook_push_handler(hwmon_handle_irp);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT hwmon_handle_irp(struct irp *irp)
|
||||
|
@ -139,7 +139,12 @@ HRESULT nusec_hook_init(
|
||||
nusec_nearfull = 0x00010200;
|
||||
nusec_play_count = 0;
|
||||
nusec_play_limit = 1024;
|
||||
nusec_fd = iohook_open_dummy_fd();
|
||||
|
||||
hr = iohook_open_nul_fd(&nusec_fd);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
hr = iohook_push_handler(nusec_handle_irp);
|
||||
|
||||
|
Reference in New Issue
Block a user