I'd appreciate advice on this.
I am looking at adding the handling of LoadLibraryExA (..LOAD_WITH_ALTERED_SEARCH_PATH) (which we use) and I am wondering about how to carry around the library directory during the recursion on MODULE_LoadLibraryExA.
The easiest way is to put it in a static variable (ok, some allocated memory pointed to by a static variable) and depend upon the existing critical sections (which I don't understand particularly) to ensure it is only used by the currently loading tree of DLLS (i.e. set it up after the RtlAcquirePebLock in MODULE_LoadLibraryExA). However I dislike using static variables as a matter of principle.
The way I would prefer would be to add an argument to all the functions in the recursion and use that to carry the name around. MODULE_LoadLibraryExA PE_LoadLibraryExA ELF_LoadLibraryExA PE_CreateModule fixup_imports
Any objections?
Bill