-
-
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
Open
neon-nyan
wants to merge
14
commits into
main
Choose a base branch
from
win32-migration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
+ 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
neon-nyan
added
Enhancement
New feature or request
Area: Mirror/API Server
Issue labeled for Mirror/API Server issue releated
Area: Runtime
Issue labeled for runtime, Hi3Helper.Core and other libraries used by Collapse
Priority: Medium
labels
Nov 17, 2024
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
neon-nyan
removed
the
Area: Mirror/API Server
Issue labeled for Mirror/API Server issue releated
label
Nov 18, 2024
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
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: Runtime
Issue labeled for runtime, Hi3Helper.Core and other libraries used by Collapse
Enhancement
New feature or request
Priority: Medium
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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