diff --git a/amex/ds.c b/amex/ds.c index 4cbe365..ee605ff 100644 --- a/amex/ds.c +++ b/amex/ds.c @@ -16,6 +16,7 @@ #include "util/crc.h" #include "util/dprintf.h" #include "util/setupapi.h" +#include "util/str.h" #pragma pack(push, 1) @@ -105,7 +106,7 @@ static HRESULT ds_handle_irp(struct irp *irp) static HRESULT ds_handle_open(struct irp *irp) { - if (wcscmp(irp->open_filename, L"$ds") != 0) { + if (!wstr_eq(irp->open_filename, L"$ds")) { return iohook_invoke_next(irp); } diff --git a/amex/eeprom.c b/amex/eeprom.c index 91b863f..a3ad22a 100644 --- a/amex/eeprom.c +++ b/amex/eeprom.c @@ -18,6 +18,7 @@ #include "util/dprintf.h" #include "util/setupapi.h" +#include "util/str.h" static HRESULT eeprom_handle_irp(struct irp *irp); static HRESULT eeprom_handle_open(struct irp *irp); @@ -81,7 +82,7 @@ static HRESULT eeprom_handle_irp(struct irp *irp) static HRESULT eeprom_handle_open(struct irp *irp) { - if (wcscmp(irp->open_filename, L"$eeprom") != 0) { + if (!wstr_eq(irp->open_filename, L"$eeprom") != 0) { return iohook_invoke_next(irp); } diff --git a/amex/gpio.c b/amex/gpio.c index 96c4dc8..16162d9 100644 --- a/amex/gpio.c +++ b/amex/gpio.c @@ -10,6 +10,7 @@ #include "util/dprintf.h" #include "util/setupapi.h" +#include "util/str.h" enum { GPIO_IOCTL_SET_LEDS = 0x8000A004, @@ -120,7 +121,7 @@ static HRESULT gpio_handle_irp(struct irp *irp) static HRESULT gpio_handle_open(struct irp *irp) { - if (wcscmp(irp->open_filename, L"$gpio") != 0) { + if (!wstr_eq(irp->open_filename, L"$gpio")) { return iohook_invoke_next(irp); } diff --git a/amex/jvs.c b/amex/jvs.c index f396962..d93eb34 100644 --- a/amex/jvs.c +++ b/amex/jvs.c @@ -18,6 +18,7 @@ #include "util/dprintf.h" #include "util/dump.h" #include "util/setupapi.h" +#include "util/str.h" enum { JVS_IOCTL_HELLO = 0x80006004, @@ -86,7 +87,7 @@ static HRESULT jvs_handle_irp(struct irp *irp) static HRESULT jvs_handle_open(struct irp *irp) { - if (wcscmp(irp->open_filename, L"$jvs") != 0) { + if (!wstr_eq(irp->open_filename, L"$jvs")) { return iohook_invoke_next(irp); } diff --git a/amex/sram.c b/amex/sram.c index a9eb182..87aa3a6 100644 --- a/amex/sram.c +++ b/amex/sram.c @@ -17,6 +17,7 @@ #include "util/dprintf.h" #include "util/setupapi.h" +#include "util/str.h" static HRESULT sram_handle_irp(struct irp *irp); static HRESULT sram_handle_open(struct irp *irp); @@ -76,7 +77,7 @@ static HRESULT sram_handle_irp(struct irp *irp) static HRESULT sram_handle_open(struct irp *irp) { - if (wcscmp(irp->open_filename, L"$sram") != 0) { + if (!wstr_eq(irp->open_filename, L"$sram")) { return iohook_invoke_next(irp); } diff --git a/platform/hwmon.c b/platform/hwmon.c index 12183a5..763afd1 100644 --- a/platform/hwmon.c +++ b/platform/hwmon.c @@ -9,6 +9,8 @@ #include "platform/hwmon.h" +#include "util/str.h" + enum { HWMON_IOCTL_READ_CPU_TEMP = 0x80006000, }; @@ -46,7 +48,7 @@ static HRESULT hwmon_handle_irp(struct irp *irp) static HRESULT hwmon_handle_open(struct irp *irp) { - if (wcscmp(irp->open_filename, L"\\\\.\\sghwmonitor") != 0) { + if (!wstr_ieq(irp->open_filename, L"\\\\.\\sghwmonitor")) { return iohook_invoke_next(irp); } diff --git a/platform/nusec.c b/platform/nusec.c index 33df179..49e3444 100644 --- a/platform/nusec.c +++ b/platform/nusec.c @@ -2,13 +2,14 @@ #include #include -#include "util/dprintf.h" -#include "util/dump.h" - #include "hook/iohook.h" #include "platform/nusec.h" +#include "util/dprintf.h" +#include "util/dump.h" +#include "util/str.h" + enum { NUSEC_IOCTL_PING = 0x22A114, NUSEC_IOCTL_ERASE_TRACE_LOG = 0x22E188, @@ -87,7 +88,7 @@ static HRESULT nusec_handle_irp(struct irp *irp) static HRESULT nusec_handle_open(struct irp *irp) { - if (wcscmp(irp->open_filename, L"\\??\\FddDriver") != 0) { + if (!wstr_ieq(irp->open_filename, L"\\??\\FddDriver")) { return iohook_invoke_next(irp); }