Fix CD directory translation in TranslatePath so that the correct path is used
Detect CD in CreateFileA and disallow write access
The implementation first patches the CD path by mapping "d:/gnome/" to "d:/".
This causes all versions of the game to behave the same.
Read the comment in the code for more information.
Finally, the "d:/" folder is mapped to "./" which is assumed to be the games root folder.
This PR was only tested with the US CD version yet. Further testing has to be done to avoid regressions.
I'm really frustrated with the lack of reviews on this project, hence the lack of work.
If this breaks OpenSWE1R for users, they will have to fix this.
Closes #157
This implements what I proposed in https://github.com/OpenSWE1R/openswe1r/issues/157#issuecomment-392179995:
TranslatePath
so that the correct path is usedCreateFileA
and disallow write accessThe implementation first patches the CD path by mapping "d:/gnome/" to "d:/". This causes all versions of the game to behave the same. Read the comment in the code for more information.
Finally, the "d:/" folder is mapped to "./" which is assumed to be the games root folder.
This PR was only tested with the US CD version yet. Further testing has to be done to avoid regressions.