Setupapi hooks cleanup #32

Open
opened 2019-10-12 20:30:00 +03:00 by icex2 · 2 comments
icex2 commented 2019-10-12 20:30:00 +03:00 (Migrated from github.com)

Currently, we have hooklib/setupapi handling handles IIDX ezusb1/2 and jubeat P4IO, and, upcoming with a PR, a separate iidxhook8/setupapi hook for handling IIDX bio2. This isn't a great issue right now, but once we need to either re-use or copy/paste this with slight tweaks for more USB devices, we should consider a refactoring to either:

  • Merge them all into a single setupapi module
  • Properly split them to copy-pastes for each game only covering what they need to emulate


    I would like to a avoid a mixed approach with some impls re-used and a few copy-pasted ones.
Currently, we have hooklib/setupapi handling handles IIDX ezusb1/2 and jubeat P4IO, and, upcoming with a PR, a separate iidxhook8/setupapi hook for handling IIDX bio2. This isn't a great issue right now, but once we need to either re-use or copy/paste this with slight tweaks for more USB devices, we should consider a refactoring to either: - Merge them all into a single setupapi module - Properly split them to copy-pastes for each game only covering what they need to emulate <br> I would like to a avoid a mixed approach with some impls re-used and a few copy-pasted ones.
icex2 commented 2019-10-13 20:24:51 +03:00 (Migrated from github.com)

In GitLab by @tau on Oct 13, 2019, 19:24

I would strongly recommend making separate boilerplate setupapi hooks for each of our Xemu static libraries a la p3ioemu/devmgr.c.

While some Win32 APIs are small and orthogonal enough that they can be hooked universally setupapi is not one of them. It has a massive API surface and data model, and some games (iidx25+ I think?) even use the ancient Win95-era "Configuration Manager" API as well (the one whose identifiers start with CM_). We cannot realistically emulate anything close to the entire API so our best bet is to write hooks designed to mate with particular code sequences in particular games.

In GitLab by @tau on Oct 13, 2019, 19:24 I would strongly recommend making separate boilerplate setupapi hooks for each of our Xemu static libraries a la p3ioemu/devmgr.c. While some Win32 APIs are small and orthogonal enough that they can be hooked universally setupapi is not one of them. It has a massive API surface and data model, and some games (iidx25+ I think?) even use the ancient Win95-era "Configuration Manager" API as well (the one whose identifiers start with CM_). We cannot realistically emulate anything close to the entire API so our best bet is to write hooks designed to mate with particular code sequences in particular games.
icex2 commented 2019-10-13 20:26:07 +03:00 (Migrated from github.com)

Great input, thanks.

Great input, thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Max/djhackersdev_bemanitools#32