ocran icon indicating copy to clipboard operation
ocran copied to clipboard

Migrate edicon to Ruby Implementation

Open shinokaro opened this issue 1 year ago • 0 comments

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:

  • BeginUpdateResource was incorrectly compared to INVALID_HANDLE_VALUE. Proper error checking requires comparison to NULL.(https://github.com/Largo/ocran/blob/201f51ad4f39eba953682d17e5ceb013c74e3939/src/edicon.c#L58)
  • The calculation of GroupIconSize was incorrect. It should have been calculated using the size of IconDirResEntry multiplied by the number of images, instead of using IconDirectoryEntry.(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.

shinokaro avatar Aug 09 '24 20:08 shinokaro