Update capnhook - [merged] #148

Closed
opened 2020-08-21 16:51:11 +03:00 by icex2 · 12 comments
icex2 commented 2020-08-21 16:51:11 +03:00 (Migrated from github.com)

Merges update-capnhook -> master

Update the src/main/hook submodule to the latest from: https://github.com/decafcode/capnhook

Adapt everything in BT to new capnhook API (changes), this includes

  • Renaming of functions (iohook_invoke_next)
  • Slight interface changes (com_proxy_wrap, iohook_push_handler)
  • De-duplicate stuff from utils (iobuf, hr)

Note: This MR introduces changes in every hook library. However, since these are rather straight forward, I don't expect anything major to break and won't test all of them either.

_Merges update-capnhook -> master_ Update the `src/main/hook` submodule to the latest from: https://github.com/decafcode/capnhook Adapt everything in BT to new capnhook API (changes), this includes * Renaming of functions (iohook_invoke_next) * Slight interface changes (com_proxy_wrap, iohook_push_handler) * De-duplicate stuff from utils (iobuf, hr) Note: This MR introduces changes in every hook library. However, since these are rather straight forward, I don't expect anything major to break and won't test all of them either.
icex2 commented 2020-08-21 22:35:57 +03:00 (Migrated from github.com)

In GitLab by @xyen on Aug 21, 2020, 21:35

Commented on src/main/camhook/cam.c line 348

"proxyu"

In GitLab by @xyen on Aug 21, 2020, 21:35 Commented on [src/main/camhook/cam.c line 348](https://github.com/djhackersdev/bemanitools/compare/3ab55b9ef02a1e052b4ca16c61a021092eced6d1..ecda787f980646f965c814519389a708690f7540#diff-cc4d7cae74a7918058230af46b19ad1eR348) "proxyu"
icex2 commented 2020-08-21 22:35:57 +03:00 (Migrated from github.com)

In GitLab by @xyen on Aug 21, 2020, 21:35

Commented on src/main/bsthook/dllmain.c line 119

Instead of exploding every one of these into iohook_push_handler calls, we should implement a helper function for it, as I think having the list of irp handlers kept as-is is cleaner.

Additionally, this reduces the number of actual changes needed to review.

In GitLab by @xyen on Aug 21, 2020, 21:35 Commented on [src/main/bsthook/dllmain.c line 119](https://github.com/djhackersdev/bemanitools/compare/9fa83cef641a1f4e2904b13976f428b419d84261..5de9fdee437e8aba712627c48e3080ac289f93b7#diff-cfce9d99009a76ddd49ded9e1ed92f34L119) Instead of exploding every one of these into `iohook_push_handler` calls, we should implement a helper function for it, as I think having the list of irp handlers kept as-is is cleaner. Additionally, this reduces the number of actual changes needed to review.
icex2 commented 2020-08-21 22:35:58 +03:00 (Migrated from github.com)

In GitLab by @xyen on Aug 21, 2020, 21:35

Commented on src/main/bio2emu/emu.c line 72

A lot cleaner / easier to review to just add a wrapper that calls iohook_invoke_next from irp_invoke_next.

Given the number of emulation devices that call this.

In GitLab by @xyen on Aug 21, 2020, 21:35 Commented on [src/main/bio2emu/emu.c line 72](https://github.com/djhackersdev/bemanitools/compare/9fa83cef641a1f4e2904b13976f428b419d84261..5de9fdee437e8aba712627c48e3080ac289f93b7#diff-8acdfbf456767b53ede5d020eccc5b89L72) A lot cleaner / easier to review to just add a wrapper that calls `iohook_invoke_next` from `irp_invoke_next`. Given the number of emulation devices that call this.
icex2 commented 2020-08-31 21:31:43 +03:00 (Migrated from github.com)

I think the single calls make an overall cleaner API and eliminates having to put each handler into an array before being torn apart by the helper or the internal implementation again. Considering we have a max of 4-5 calls so far, the overall code clutter is still reasonable when calling the method multiple times with different handlers, imo.

I think the single calls make an overall cleaner API and eliminates having to put each handler into an array before being torn apart by the helper or the internal implementation again. Considering we have a max of 4-5 calls so far, the overall code clutter is still reasonable when calling the method multiple times with different handlers, imo.
icex2 commented 2020-08-31 21:33:59 +03:00 (Migrated from github.com)

added 1 commit

  • 8da99f76 - Adapt everything in BT5 to new capnhook API

Compare with previous version

added 1 commit <ul><li>8da99f76 - Adapt everything in BT5 to new capnhook API</li></ul> [Compare with previous version](/djhackers/bemanitools/-/merge_requests/47/diffs?diff_id=1295&start_sha=ecda787f980646f965c814519389a708690f7540)
icex2 commented 2020-08-31 21:33:59 +03:00 (Migrated from github.com)

changed this line in version 2 of the diff

changed this line in [version 2 of the diff](/djhackers/bemanitools/-/merge_requests/47/diffs?diff_id=1295&start_sha=ecda787f980646f965c814519389a708690f7540#2651b7502fcb1138e912f7bcfea9d7bed919a27d_348_348)
icex2 commented 2020-08-31 21:34:02 +03:00 (Migrated from github.com)

Fixed.

Fixed.
icex2 commented 2020-08-31 21:35:29 +03:00 (Migrated from github.com)

Do you suggest having irp_invoke_next as an alias for the new iohook_invoke_next?

Do you suggest having `irp_invoke_next` as an alias for the new `iohook_invoke_next`?
icex2 commented 2020-09-01 05:37:51 +03:00 (Migrated from github.com)

In GitLab by @xyen on Sep 1, 2020, 04:37

Commented on src/main/bio2emu/emu.c line 72

on further thought, I think it's fine as-is, if we're keeping the other changes as well

In GitLab by @xyen on Sep 1, 2020, 04:37 Commented on [src/main/bio2emu/emu.c line 72](https://github.com/djhackersdev/bemanitools/compare/9fa83cef641a1f4e2904b13976f428b419d84261..5de9fdee437e8aba712627c48e3080ac289f93b7#diff-8acdfbf456767b53ede5d020eccc5b89L72) on further thought, I think it's fine as-is, if we're keeping the other changes as well
icex2 commented 2020-09-02 22:31:19 +03:00 (Migrated from github.com)

resolved all threads

resolved all threads
icex2 commented 2020-09-02 22:32:10 +03:00 (Migrated from github.com)

In GitLab by @xyen on Sep 2, 2020, 21:32

approved this merge request

In GitLab by @xyen on Sep 2, 2020, 21:32 approved this merge request
icex2 commented 2020-09-02 22:35:17 +03:00 (Migrated from github.com)

added 18 commits

  • 8da99f76...9fa83cef - 16 commits from branch master
  • b777396e - hook: Update capnhook source files from latest master
  • 5de9fdee - Adapt everything in BT5 to new capnhook API

Compare with previous version

added 18 commits <ul><li>8da99f76...9fa83cef - 16 commits from branch <code>master</code></li><li>b777396e - hook: Update capnhook source files from latest master</li><li>5de9fdee - Adapt everything in BT5 to new capnhook API</li></ul> [Compare with previous version](/djhackers/bemanitools/-/merge_requests/47/diffs?diff_id=1301&start_sha=8da99f76544b0554db3864e64d1902c701468e03)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Max/djhackersdev_bemanitools#148