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

Refactor all Win32 API references with CsWin32 PInvoke code generator (work in progress) #351

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

gerardog
Copy link
Owner

@gerardog gerardog commented May 16, 2024

Since the inception of gsudo, the number of Win32 Api calls utilized by gsudo has significantly increased. I did not anticipate such growth, resulting in rather convoluted code for these Api references.

Once I learn about the CsWin32 PInvoke code generator, I thought that using it would be a great way to solve that problem and reduce the source.

But, this effort requires much more modifications and time than anticipated. CsWin32 forces API references with a certain signature, which requires additional steps to handle unsafe code, pointers, low level strings, etc. I don't have the time to complete this effort, and the benefits of making this huge change, are relative. I would like a cleaner code base, but not at the cost of not being able to focus on other issues.

I may came back to this branch when I have time, but, that may not happen very soon.

…pdate type usages, replace direct DLL imports with PInvoke calls, and adjust process ID types from int to uint for consistency with Win32 API.
…pdate type usages, replace direct DLL imports with PInvoke calls, and adjust process ID types from int to uint for consistency with Win32 API.
@gerardog gerardog marked this pull request as draft May 16, 2024 02:38
@gerardog gerardog changed the title Refactor all Win32 API refence with CsWin32 PInvoke code generator (work in progress) Refactor all Win32 API references with CsWin32 PInvoke code generator (work in progress) May 22, 2024
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.

None yet

1 participant