DetourEnumerateImports() internally invokes DetourEnumerateImportsEx() and uses an intermediate thunk callback to wrap pfImportFunc. Unfortunately it does not also do the same for pfImportFile, so the client callback ends up getting a pointer to &context instead of the client-supplied pContext. It's easy enough to fix by adding a similar intermediate thunk callback to wrap pfImportFile.
Description
DetourEnumerateImports()
internally invokesDetourEnumerateImportsEx()
and uses an intermediate thunk callback to wrappfImportFunc
. Unfortunately it does not also do the same forpfImportFile
, so the client callback ends up getting a pointer to&context
instead of the client-suppliedpContext
. It's easy enough to fix by adding a similar intermediate thunk callback to wrappfImportFile
.https://github.com/microsoft/Detours/blob/734ac64899c44933151c1335f6ef54a590219221/src/modules.cpp#L667
Version