Hook the CreateDirectory*() functions#122
Conversation
|
Hey @TheComputerGuy96. Thanks for your contribution. I'll merge both this and #120 and publish a new release soon. Just worried that this may cause some side-effect somewhere it shouldn't. But so far I've not thought of a edge case. |
|
@thelink2012 hey, any news on that release? |
|
Hey @SandeMC, a bit busy here so I'll probably not be able to merge this before May. |
CookiePLMonster
left a comment
There was a problem hiding this comment.
CreateDirectoryExA and CreateDirectoryExW also need shims.
ZMenu calls CreateDirectoryW() to create the ZMenu directory for storing some .ini files (which currently ends up in the root game folder)
6922c61 to
0047427
Compare
|
@TheComputerGuy96 thanks and sorry for the long delay. Which mod is behaving badly because of the lack of CreateDirectory hooks? Can you provide more details? Is it ZMenu? |
|
@thelink2012 ZMenu creates its own folder in the GTA San Andreas root folder (or maybe the folder relative to the .asi?) to store a speedrun configuration file (but due to the missing hook, the directory gets created in the wrong place and thus that config file likely can't be created due to the missing folder) |
Guards TranslatePathChar before IsAbsolutePath; optional API parameters may be NULL (e.g. CreateDirectoryEx template directory).
CreateDirectory/CreateDirectoryW and CreateDirectoryEx new-directory args use IN; Ex lpTemplateDirectory uses INE when a template path is present.
|
Thanks @TheComputerGuy96! |
ZMenu still doesn't fully work with modloader though (the strings for the
Mod Configurationmenu are all empty which doesn't happen when using a normal ASI loader)Maybe that issue could be worked around by delaying the loading of the modloader strings (but the mod should probably be fixed itself with some memory patches?)