Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate edicon to Ruby Implementation #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shinokaro
Copy link
Collaborator

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.(
    if (h == INVALID_HANDLE_VALUE)
    )
  • 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.(
    DWORD GroupIconSize = sizeof(GroupIcon) + header->ImageCount * sizeof(IconDirectoryEntry);
    )

This reimplement ensures that the functionality of EdIcon is preserved while simplifying future enhancements and maintenance.

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`.
- 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`.
This reimplement ensures that the functionality of `EdIcon` is preserved while simplifying future enhancements and maintenance.
@shinokaro shinokaro force-pushed the migrate-edicon-to-ruby branch from 23b6597 to 4084207 Compare August 9, 2024 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant