Skip to content

Update MinHook to 1.3.3#8142

Merged
michaelDCurran merged 8 commits into
nvaccess:masterfrom
BabbageCom:minhook1.3.3
Jun 13, 2018
Merged

Update MinHook to 1.3.3#8142
michaelDCurran merged 8 commits into
nvaccess:masterfrom
BabbageCom:minhook1.3.3

Conversation

@LeonarddeR

Copy link
Copy Markdown
Collaborator

Link to issue number:

None

Summary of the issue:

MinHook, the hooking library used to hook into processes, has been on 1.2.2 for years within NVDA. Version 1.3.3 is the most recent version.

Description of how this pull request fixes the issue:

This updates MinHook to 1.3.3 and updates the associated sconscript file as well.

Testing performed:

Try build ran without any observed issues, but wider testing would be appreciated.

Known issues with pull request:

None

@josephsl

josephsl commented Apr 4, 2018 via email

Copy link
Copy Markdown
Contributor

@LeonarddeR

Copy link
Copy Markdown
Collaborator Author

Here are the relevant changes that might have impact:

  • a helper function MH_StatusToString. Could make log messages more user friendly, not implemented yet but probably quite easy to do
  • Fixed a possible thread deadlock in x64 mode
  • Reduced the footprint a little more
  • Added MH_CreateHookApi and MH_CreateHookApiEx, which allow hooking based on module name and function name rather than function pointer
  • Fixed a false memory leak reported by some tools.
  • Fixed a degradated compatibility issue.
  • Fixed some small bugs.
  • Improved the memory management.
  • Changed the parameters to Windows-friendly types. (void* to LPVOID)
  • Reorganized the source files.
  • Rewrote in plain C
  • Simplified the overall code base to make it more readable and maintainable.
  • Changed the license from 3-clause to 2-clause BSD License. This should have been covered in copying.txt as well

@LeonarddeR

Copy link
Copy Markdown
Collaborator Author

As it now stands, it looks like this pr doesn't allow my Edge to be started any more as soon as the try build is installed. :)

@feerrenrut

Copy link
Copy Markdown
Contributor

As it now stands, it looks like this pr doesn't allow my Edge to be started any more as soon as the try build is installed. :)

Can you confirm: this PR breaks Edge? Can you elaborate on what happens?

Comment thread copying.txt Outdated
Most of the source code for NVDA itself is available under this license.

```
``

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably still be 3 ` characters

@LeonarddeR

Copy link
Copy Markdown
Collaborator Author

@feerrenrut commented on 9 apr. 2018 10:26 CEST:

Can you confirm: this PR breaks Edge? Can you elaborate on what happens?

On one of my systems, as soon as I run this branch as an installed copy, Edge does seem to close around 2 seconds after I start it. When running as a portbale copy, this problem does not occur.

I have already tracked down that this is most likely cause by the more friendly error logging I tried to implement. Without these changes to error logging, A try build functions correctly. I'm currently investigating how to fix this.

@LeonarddeR

Copy link
Copy Markdown
Collaborator Author

Error logging is now again working as expected.

Comment thread nvdaHelper/remote/apiHook.cpp Outdated
void* origFunc;
int res;
MH_STATUS res;
if((res=MH_CreateHook_fp(realFunc,newHookProc,&origFunc))!=MH_OK) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assignments done inside if blocks can easily become a source of error. I would much prefer to see this changed to:

MH_STATUS res = MH_CreateHook_fp(realFunc, newHookProc, &origFunc);
if( res != MH_OK) {

This gets rid of the declared but not initialised res, and reduces the logic inside the if statement.

@LeonarddeR

LeonarddeR commented May 7, 2018 via email

Copy link
Copy Markdown
Collaborator Author

feerrenrut added a commit that referenced this pull request May 7, 2018
Update MinHook to 1.3.3
Merge remote-tracking branch 'origin/pr/8142' into next
@michaelDCurran michaelDCurran merged commit 379cb6e into nvaccess:master Jun 13, 2018
@nvaccessAuto nvaccessAuto added this to the 2018.3 milestone Jun 13, 2018
@ghost

ghost commented Jun 19, 2018

Copy link
Copy Markdown

On Windows 7 32bit with MinHook 1.3.3 there are great problems with UAC.
Not always, but often, after press Yes button in the UAC window, the window itself disappears, but nothing happens and the application does not start.
At the same time in task Manager hanging consent.exe process which does not terminated.
Replacing minHook.dll version 1.3.3 to 1.2.2 solves the problem for me.

@LeonarddeR

LeonarddeR commented Jun 19, 2018 via email

Copy link
Copy Markdown
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants