Registering for all threads is not obvious


My idea was to use LhSetGlobalExclusiveACL(0,0).
Exclusive would mean to allow all threads not in the list. And since the list is empty, all threads are allowed.
But internally in LhSetACL there is a check for IsValidPointer which fails for 0, even though the size is also 0.
So currently I must specify a valid pointer to an array and size 0, even though the array is then not used.
The check should include the InThreadCount. e.g.:
if( InThreadCount!=0 && !IsValidPointer(InThreadIdList, InThreadCount * sizeof(ULONG)) )
And it would be very helpful to add a valid example for this in the documentation.
Closed Aug 15, 2015 at 7:03 AM by spazzarama


joachim99 wrote May 31, 2010 at 8:10 PM

After trying again and debugging, I saw, that I also have to call LhSetExclusiveACL() for each hook too.
Perhaps you could provide a method to enable all hooks for all threads in one step?

wrote Feb 22, 2013 at 12:15 AM

wrote Aug 15, 2015 at 7:03 AM