amcus: add proper disable option
This commit is contained in:
parent
a0050a5fac
commit
ced21e32f9
@ -12,6 +12,7 @@
|
|||||||
#include "util/dprintf.h"
|
#include "util/dprintf.h"
|
||||||
|
|
||||||
// https://dev.s-ul.net/djhackers/bemanitools/-/blob/master/src/main/dinput/device_dinput8.c
|
// https://dev.s-ul.net/djhackers/bemanitools/-/blob/master/src/main/dinput/device_dinput8.c
|
||||||
|
static bool is_enable = false;
|
||||||
|
|
||||||
static HRESULT STDAPICALLTYPE my_CoCreateInstance(
|
static HRESULT STDAPICALLTYPE my_CoCreateInstance(
|
||||||
const IID *const rclsid,
|
const IID *const rclsid,
|
||||||
@ -46,17 +47,26 @@ HRESULT amcus_hook_init(struct amcus_config *cfg)
|
|||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_enable = true;
|
||||||
|
|
||||||
dprintf("AMCUS: init\n");
|
dprintf("AMCUS: init\n");
|
||||||
|
|
||||||
hook_table_apply(
|
amcus_insert_hooks(NULL);
|
||||||
NULL,
|
|
||||||
"ole32.dll",
|
|
||||||
amcus_hook_syms,
|
|
||||||
_countof(amcus_hook_syms));
|
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void amcus_insert_hooks(HMODULE target)
|
||||||
|
{
|
||||||
|
if (is_enable) {
|
||||||
|
hook_table_apply(
|
||||||
|
target,
|
||||||
|
"ole32.dll",
|
||||||
|
amcus_hook_syms,
|
||||||
|
_countof(amcus_hook_syms));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static HRESULT STDAPICALLTYPE my_CoCreateInstance(
|
static HRESULT STDAPICALLTYPE my_CoCreateInstance(
|
||||||
const IID *const rclsid,
|
const IID *const rclsid,
|
||||||
LPUNKNOWN pUnkOuter,
|
LPUNKNOWN pUnkOuter,
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include "amcus/iauth.h"
|
#include "amcus/iauth.h"
|
||||||
|
|
||||||
HRESULT amcus_hook_init(struct amcus_config *cfg);
|
HRESULT amcus_hook_init(struct amcus_config *cfg);
|
||||||
|
void amcus_insert_hooks(HMODULE target);
|
||||||
|
|
||||||
DEFINE_GUID(
|
DEFINE_GUID(
|
||||||
amcus_rclsid,
|
amcus_rclsid,
|
||||||
|
Loading…
Reference in New Issue
Block a user