-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moving out all PInvoke Methods to its Independent Hi3Helper.Win32 ass…
…embly (#606) # Main Goal As you might already know, Collapse heavily relies on native invocation for some libraries, especially when it is communicating with Win32 APIs. For more than two years, we have been using the ``[DllImport]`` attribute to define the external method to call the native functions of certain libraries (especially when it comes to `Win32` calls). In .NET 7, ``[LibraryImport]`` was introduced, which is the ``[DllImport]`` alternative that provides the source-generated invocation to native functions, instead of using a JIT-ed approach. The ``[LibraryImport]`` brings some invocation features which aren't available for NativeAOT compilations, for example: ``GetLastWin32Error()``, which is useful when diagnosing what's wrong when a `Win32` function is getting called. Read more about ``[LibraryImport]`` here: https://learn.microsoft.com/en-us/dotnet/standard/native-interop/pinvoke-source-generation https://learn.microsoft.com/en-us/dotnet/standard/native-interop/best-practices Another reason for these changes are for maintainability and to share some of the same functionality between our projects. This changes can improve the work time efficiency and reusability of the functions between methods without making or implementing the same methods with the same functionality between modules. ## PR Status : - Overall Status : Completed - Commits : Completed - Synced to base (Collapse:main) : Yes - Build status : OK - Crashing : No - Bug found caused by PR : Unsure ### Templates <details> <summary>Changelog Prefixes</summary> ``` **[New]** **[Imp]** **[Fix]** **[Loc]** **[Doc]** ``` </details>
- Loading branch information
Showing
72 changed files
with
914 additions
and
3,562 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.