microsoft / microsoft/Detours

xxx.dll vs. api-ms-win-xxx-l1-1-1.dll hooks

Open
#195 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
C++
Stars
6.4k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

I'm trying to hook advapi32!EnumServicesStatusExW. However, some programs rather import this function from api-ms-win-service-core-l1-1-1.dll instead. I later learned, that the api-ms-* DLL redirects the call to advapi32.dll. However, the hook was not called.

In a test, when hooking api-ms-win-service-core-l1-1-1!EnumServicesStatusExW directly, the hook however is called.

Now the question is: If api-ms-win-service-core-l1-1-1.dll redirects calls to advapi32.dll, then my hook should be called, imho. Is this a bug that is caused by the new feature / logic of the DLL loader - or is there simply no other way except hooking api-ms-win-service-core-l1-1-1.dll directly? Or maybe I'm mistaken about the difference between these two "DLL types" (?)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the difference between hooking advapi32!EnumServicesStatusExW and api-ms-win-service-core-l1-1-1!EnumServicesStatusExW in the issue. Trace how the DLL redirection is handled and determine whether the expected hook should be reached; done means establishing whether this is a Detours bug or documenting the required direct-hook behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
devtools, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.