diff --git a/amex/ds.c b/amex/ds.c index ee605ffc..7553fa7e 100644 --- a/amex/ds.c +++ b/amex/ds.c @@ -13,9 +13,10 @@ #include "hook/iobuf.h" #include "hook/iohook.h" +#include "hooklib/setupapi.h" + #include "util/crc.h" #include "util/dprintf.h" -#include "util/setupapi.h" #include "util/str.h" #pragma pack(push, 1) diff --git a/amex/eeprom.c b/amex/eeprom.c index a3ad22ae..69849b32 100644 --- a/amex/eeprom.c +++ b/amex/eeprom.c @@ -16,8 +16,9 @@ #include "hook/iohook.h" +#include "hooklib/setupapi.h" + #include "util/dprintf.h" -#include "util/setupapi.h" #include "util/str.h" static HRESULT eeprom_handle_irp(struct irp *irp); diff --git a/amex/gpio.c b/amex/gpio.c index 16162d9c..182b3ee4 100644 --- a/amex/gpio.c +++ b/amex/gpio.c @@ -8,8 +8,9 @@ #include "hook/iohook.h" +#include "hooklib/setupapi.h" + #include "util/dprintf.h" -#include "util/setupapi.h" #include "util/str.h" enum { diff --git a/amex/jvs.c b/amex/jvs.c index d93eb342..ad181b93 100644 --- a/amex/jvs.c +++ b/amex/jvs.c @@ -13,11 +13,12 @@ #include "hook/iobuf.h" #include "hook/iohook.h" +#include "hooklib/setupapi.h" + #include "jvs/jvs-bus.h" #include "util/dprintf.h" #include "util/dump.h" -#include "util/setupapi.h" #include "util/str.h" enum { diff --git a/amex/sram.c b/amex/sram.c index 87aa3a69..0de28062 100644 --- a/amex/sram.c +++ b/amex/sram.c @@ -15,8 +15,9 @@ #include "hook/iohook.h" +#include "hooklib/setupapi.h" + #include "util/dprintf.h" -#include "util/setupapi.h" #include "util/str.h" static HRESULT sram_handle_irp(struct irp *irp); diff --git a/cardhook/dllmain.c b/cardhook/dllmain.c index d6ec8328..ef736382 100644 --- a/cardhook/dllmain.c +++ b/cardhook/dllmain.c @@ -5,9 +5,9 @@ #include "hook/process.h" #include "hooklib/serial.h" +#include "hooklib/spike.h" #include "util/dprintf.h" -#include "util/spike.h" static process_entry_t app_startup; diff --git a/cardhook/meson.build b/cardhook/meson.build index eb439178..6573f7a0 100644 --- a/cardhook/meson.build +++ b/cardhook/meson.build @@ -11,6 +11,7 @@ shared_library( link_with : [ aimeio_dll, board_lib, + hooklib_lib, util_lib, ], sources : [ diff --git a/chunihook/dllmain.c b/chunihook/dllmain.c index dcbea405..b59e4e07 100644 --- a/chunihook/dllmain.c +++ b/chunihook/dllmain.c @@ -13,15 +13,15 @@ #include "hook/process.h" +#include "hooklib/clock.h" +#include "hooklib/gfx.h" #include "hooklib/serial.h" +#include "hooklib/spike.h" #include "platform/hwmon.h" #include "platform/nusec.h" -#include "util/clock.h" #include "util/dprintf.h" -#include "util/gfx.h" -#include "util/spike.h" static process_entry_t chuni_startup; diff --git a/chunihook/meson.build b/chunihook/meson.build index 357c3364..b450f89d 100644 --- a/chunihook/meson.build +++ b/chunihook/meson.build @@ -12,6 +12,7 @@ shared_library( amex_lib, board_lib, chuniio_dll, + hooklib_lib, jvs_lib, platform_lib, util_lib, diff --git a/divahook/dllmain.c b/divahook/dllmain.c index 77c8c032..c03942d8 100644 --- a/divahook/dllmain.c +++ b/divahook/dllmain.c @@ -13,15 +13,15 @@ #include "hook/process.h" +#include "hooklib/clock.h" +#include "hooklib/gfx.h" #include "hooklib/serial.h" +#include "hooklib/spike.h" #include "platform/hwmon.h" #include "platform/nusec.h" -#include "util/clock.h" #include "util/dprintf.h" -#include "util/gfx.h" -#include "util/spike.h" static process_entry_t diva_startup; diff --git a/divahook/meson.build b/divahook/meson.build index b392e0b0..d401470b 100644 --- a/divahook/meson.build +++ b/divahook/meson.build @@ -14,6 +14,7 @@ shared_library( amex_lib, board_lib, divaio_dll, + hooklib_lib, jvs_lib, platform_lib, util_lib, diff --git a/util/clock.c b/hooklib/clock.c similarity index 100% rename from util/clock.c rename to hooklib/clock.c diff --git a/util/clock.h b/hooklib/clock.h similarity index 100% rename from util/clock.h rename to hooklib/clock.h diff --git a/util/fdshark.c b/hooklib/fdshark.c similarity index 99% rename from util/fdshark.c rename to hooklib/fdshark.c index e97663ed..e33e9e21 100644 --- a/util/fdshark.c +++ b/hooklib/fdshark.c @@ -8,9 +8,10 @@ #include "hook/iobuf.h" #include "hook/iohook.h" +#include "hooklib/fdshark.h" + #include "util/dprintf.h" #include "util/dump.h" -#include "util/fdshark.h" static const wchar_t *fdshark_path; static HANDLE fdshark_target_fd; diff --git a/util/fdshark.h b/hooklib/fdshark.h similarity index 100% rename from util/fdshark.h rename to hooklib/fdshark.h diff --git a/util/gfx.c b/hooklib/gfx.c similarity index 98% rename from util/gfx.c rename to hooklib/gfx.c index 7b138b36..185798eb 100644 --- a/util/gfx.c +++ b/hooklib/gfx.c @@ -7,6 +7,8 @@ #include "hook/com-proxy.h" #include "hook/table.h" +#include "hooklib/gfx.h" + #include "util/dprintf.h" static HRESULT STDMETHODCALLTYPE my_CreateDevice( diff --git a/util/gfx.h b/hooklib/gfx.h similarity index 100% rename from util/gfx.h rename to hooklib/gfx.h diff --git a/hooklib/meson.build b/hooklib/meson.build new file mode 100644 index 00000000..ed7bae5f --- /dev/null +++ b/hooklib/meson.build @@ -0,0 +1,21 @@ +hooklib_lib = static_library( + 'hooklib', + include_directories : inc, + implicit_include_directories : false, + c_pch : '../precompiled.h', + dependencies : [ + capnhook.get_variable('hook_dep'), + ], + sources : [ + 'clock.c', + 'clock.h', + 'fdshark.c', + 'fdshark.h', + 'gfx.c', + 'gfx.h', + 'setupapi.c', + 'setupapi.h', + 'spike.c', + 'spike.h', + ], +) diff --git a/util/setupapi.c b/hooklib/setupapi.c similarity index 99% rename from util/setupapi.c rename to hooklib/setupapi.c index dac5fca2..dac66ba0 100644 --- a/util/setupapi.c +++ b/hooklib/setupapi.c @@ -9,8 +9,9 @@ #include "hook/table.h" +#include "hooklib/setupapi.h" + #include "util/dprintf.h" -#include "util/setupapi.h" struct setupapi_class { const GUID *guid; diff --git a/util/setupapi.h b/hooklib/setupapi.h similarity index 100% rename from util/setupapi.h rename to hooklib/setupapi.h diff --git a/util/spike.c b/hooklib/spike.c similarity index 99% rename from util/spike.c rename to hooklib/spike.c index 820c5190..09a64d4d 100644 --- a/util/spike.c +++ b/hooklib/spike.c @@ -7,8 +7,9 @@ #include "hook/pe.h" +#include "hooklib/spike.h" + #include "util/dprintf.h" -#include "util/spike.h" /* Spike functions. Their "style" is named after the libc function they bear the closest resemblance to. */ diff --git a/util/spike.h b/hooklib/spike.h similarity index 100% rename from util/spike.h rename to hooklib/spike.h diff --git a/idzhook/dllmain.c b/idzhook/dllmain.c index ef535376..d6aa45e3 100644 --- a/idzhook/dllmain.c +++ b/idzhook/dllmain.c @@ -10,17 +10,17 @@ #include "hook/process.h" +#include "hooklib/clock.h" +#include "hooklib/gfx.h" #include "hooklib/serial.h" +#include "hooklib/spike.h" #include "idzhook/jvs.h" #include "platform/hwmon.h" #include "platform/nusec.h" -#include "util/clock.h" #include "util/dprintf.h" -#include "util/gfx.h" -#include "util/spike.h" static process_entry_t idz_startup; diff --git a/idzhook/meson.build b/idzhook/meson.build index e330b9ae..ac6e8578 100644 --- a/idzhook/meson.build +++ b/idzhook/meson.build @@ -14,6 +14,7 @@ shared_library( aimeio_dll, amex_lib, board_lib, + hooklib_lib, idzio_dll, jvs_lib, platform_lib, diff --git a/meson.build b/meson.build index 66fdb8a8..f3b2d53f 100644 --- a/meson.build +++ b/meson.build @@ -32,6 +32,7 @@ capnhook = subproject('capnhook') subdir('amex') subdir('board') +subdir('hooklib') subdir('jvs') subdir('platform') subdir('util') diff --git a/minihook/dllmain.c b/minihook/dllmain.c index 6ca70621..40f9471d 100644 --- a/minihook/dllmain.c +++ b/minihook/dllmain.c @@ -5,11 +5,12 @@ #include "hook/process.h" +#include "hooklib/clock.h" +#include "hooklib/spike.h" + #include "platform/nusec.h" -#include "util/clock.h" #include "util/dprintf.h" -#include "util/spike.h" static process_entry_t app_startup; diff --git a/minihook/meson.build b/minihook/meson.build index 661c2d0d..8acbf1e1 100644 --- a/minihook/meson.build +++ b/minihook/meson.build @@ -9,6 +9,7 @@ shared_library( ], link_with : [ amex_lib, + hooklib_lib, platform_lib, util_lib, ], diff --git a/platform/hwmon.c b/platform/hwmon.c index 763afd13..15e5da9b 100644 --- a/platform/hwmon.c +++ b/platform/hwmon.c @@ -3,12 +3,11 @@ #include #include -#include "util/dprintf.h" - #include "hook/iohook.h" #include "platform/hwmon.h" +#include "util/dprintf.h" #include "util/str.h" enum { diff --git a/util/meson.build b/util/meson.build index 6cb0c9fe..0b76284c 100644 --- a/util/meson.build +++ b/util/meson.build @@ -9,22 +9,12 @@ util_lib = static_library( sources : [ 'async.c', 'async.h', - 'clock.c', - 'clock.h', 'crc.c', 'crc.h', 'dprintf.c', 'dprintf.h', 'dump.c', 'dump.h', - 'fdshark.c', - 'fdshark.h', - 'gfx.c', - 'gfx.h', - 'setupapi.c', - 'setupapi.h', - 'spike.c', - 'spike.h', 'str.c', 'str.h', ],