Jacek Caban (@jacek) commented about dlls/ntdll/loader.c:
if (!imports_fixup_done && importer)
{
/* Prepare for the callee stealing the reference */
wm_owned_ref = FALSE;
add_module_dependency( importer->ldr.DdagNode, wm->ldr.DdagNode );
}
else if (process_attach( wm->ldr.DdagNode, NULL ) != STATUS_SUCCESS)
{
proc = NULL;
}
}
if (proc && wm_owned_ref)
{
/* Owned, but no way to bind to a dependency; leak the reference instead */
wm_owned_ref = FALSE;
}
Is this about modules loaded with `LDR_DONT_RESOLVE_REFS`? Should `find_forwarded_export` still resolve them in that case?
With your series complete, we always have an importer, so unless I’m missing something, this seems to be the only scenario. I’m trying to understand the logic here: if `find_forwarded_export` should still load such dependencies, I can see the reasoning behind skipping `process_attach` in that case, but binding the dependency still seems possible.