-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Moving out all PInvoke Methods to its Independent Hi3Helper.Win32 assembly #606
Conversation
+ Move PInvokes for CoCreateInstance + Move PInvokes for ResizableWindowHook
This due to the buffer getting flushed by the GC while the WindowRect data is being accessed. This commit is switching from unsafe implementation to more safer approach
Qodana for .NET15 new problems were found
💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at qodana-support@jetbrains.com
|
CollapseLauncher/Classes/GameManagement/GameSettings/BaseClass/ImportExportBase.cs
Fixed
Show fixed
Hide fixed
CollapseLauncher/XAMLs/MainApp/Pages/Dialogs/InstallationConvert.xaml.cs
Dismissed
Show dismissed
Hide dismissed
Qodana for .NET22 new problems were found
💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at qodana-support@jetbrains.com
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the changes within this scope of PR is mostly just moving stuff around, after a bit of review there doesn't seem to be anything wrong with it. All good to me! approbed
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 toWin32
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 aWin32
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 :
Templates
Changelog Prefixes