Refactoring Libraryimport/phase 4#7562
Open
JoonghyunCho wants to merge 2 commits intoSamsung:mainfrom
Open
Conversation
added 2 commits
April 10, 2026 10:42
- Migrate DllImport to LibraryImport for all 9 Network modules - Add partial keyword to all containing classes for source generator - Add [MarshalAs(UnmanagedType.U1)] for bool parameters - Add StringMarshalling.Utf8 only where string params exist - Remove 397 redundant StringMarshalling.Utf8 from methods without string params - All 9 projects build successfully with 0 errors Modules: Bluetooth, Connection, IoTConnectivity, Nfc, Nsd, Smartcard, Stc, WiFi, WiFiDirect
- Revert DllImport-only files with incorrect MarshalAs(U1) bool (Bluetooth, WiFi) - Remove delegate bool MarshalAs changes from 8 mixed files - Revert Stc and WiFi modules (no actual LibraryImport conversion)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Migrate
DllImporttoLibraryImport(source-generated P/Invoke) for all Network modules.This is Phase 4 of 4 in a staged LibraryImport migration. Network modules converted cleanly with no SafeHandle or delegate callback issues encountered in Phase 3.
Modules Changed (27 files)
Changes
[DllImport]to[LibraryImport]and updated method signatures tostatic partial.partialkeyword to all enclosing class declarations for source generator compatibility.stringparams withStringMarshalling = StringMarshalling.Utf8only where strictly needed.[MarshalAs(UnmanagedType.U1)].StringMarshalling.Utf8attributes from methods without string parameters — the original conversion script had applied this attribute indiscriminately to all methods.What is NOT included
LibraryImport.boolMarshalAs improvements — extracted for an independent PR.Build Verification
All 9 modified modules successfully compiled with 0 errors.