Detours icon indicating copy to clipboard operation
Detours copied to clipboard

Misleading/non-effective usage of DetourUpdateThread in samples

Open ohuseyinoglu opened this issue 5 years ago • 1 comments

Describe the bug

As mentioned in the discussion b/w @sylveon and @bgianfo, passing GetCurrentThread() to DetourUpdateThread() is practically a NO-OP, however, probably all the samples, and the Using Detours wiki does use the API that way currently!

Command-line test case

N/A

Expected behavior

This is non-effective, and worse, misleading, giving users a false sense of security in their Detours usage. A better handling of threads should be provided at the API level (or at least more detailed code added to samples).

I haven't reviewed the code, but @sonyps5201314 has a closed PR suggesting a new API entry point (DetourUpdateAllOtherThreads). Something along those lines may be useful probably??

Detours version

Latest on master as of this issue's creation date: d8b8144

Additional context

I'll log another issue/question about the stability of the RIP changing after this. Please evaluate the issues together.

ohuseyinoglu avatar Dec 01 '20 12:12 ohuseyinoglu

Thanks for creating an issue to track these.

As mentioned, I believe @sonyps5201314's PR is probably the best fix for this kind of issue.

bgianfo avatar Dec 02 '20 00:12 bgianfo