ocran
ocran copied to clipboard
Migrate edicon to Ruby Implementation
This pull request introduces a Ruby-based implementation of the previously C-based edicon.exe. Opting for a Ruby reimplement over fixing the existing C code will shorten the build times and make maintenance easier, leveraging widely accessible Microsoft documentation.
Reference Information:
The original edicon.c contained several issues that are being addressed by this reimplementation:
BeginUpdateResourcewas incorrectly compared toINVALID_HANDLE_VALUE. Proper error checking requires comparison toNULL.(https://github.com/Largo/ocran/blob/201f51ad4f39eba953682d17e5ceb013c74e3939/src/edicon.c#L58)- The calculation of
GroupIconSizewas incorrect. It should have been calculated using the size ofIconDirResEntrymultiplied by the number of images, instead of usingIconDirectoryEntry.(https://github.com/Largo/ocran/blob/201f51ad4f39eba953682d17e5ceb013c74e3939/src/edicon.c#L97)
This reimplement ensures that the functionality of EdIcon is preserved while simplifying future enhancements and maintenance.