forked from TeamTofuShop/segatools
Use new iohook_open_nul_fd() API
Makes error handling more consistent
This commit is contained in:
@ -85,7 +85,11 @@ HRESULT ds_hook_init(const struct ds_config *cfg)
|
||||
return hr;
|
||||
}
|
||||
|
||||
ds_fd = iohook_open_dummy_fd();
|
||||
hr = iohook_open_nul_fd(&ds_fd);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -89,7 +89,12 @@ HRESULT gpio_hook_init(const struct gpio_config *cfg)
|
||||
|
||||
memcpy(&gpio_config, cfg, sizeof(*cfg));
|
||||
|
||||
gpio_fd = iohook_open_dummy_fd();
|
||||
hr = iohook_open_nul_fd(&gpio_fd);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
hr = iohook_push_handler(gpio_handle_irp);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
|
@ -50,7 +50,12 @@ HRESULT jvs_hook_init(const struct jvs_config *cfg)
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
jvs_fd = iohook_open_dummy_fd();
|
||||
hr = iohook_open_nul_fd(&jvs_fd);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
hr = iohook_push_handler(jvs_handle_irp);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
|
Reference in New Issue
Block a user