Repository navigation
Replace DllImport with LibraryImport in SMA 1 - #18520
Conversation
d4a951d to
c7f54dc
Compare
667c477 to
73f821b
Compare
0bc4db3 to
fc4614c
Compare
|
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
|
Steve Lee (@SteveL-MSFT) Please look last 2 new commits. There are 5 DllImport left (in FileSystemProvider.cs) which require manual marshalling. This is not trivial. We need a conclusion if it's worth it. [DllImport("mpr.dll", CharSet = CharSet.Unicode)]
internal static extern int WNetAddConnection2(ref NetResource netResource, byte[] password, string username, int flags);
[DllImport("mpr.dll", CharSet = CharSet.Unicode)]
internal static extern int WNetGetConnection(string localName, StringBuilder remoteName, ref int remoteNameLength);
[DllImport(PinvokeDllNames.QueryDosDeviceDllName, CharSet = CharSet.Unicode, SetLastError = true)]
internal static extern int QueryDosDevice(string lpDeviceName, StringBuilder lpTargetPath, int ucchMax);
[DllImport("kernel32.dll", ExactSpelling = true, CharSet = CharSet.Unicode, SetLastError = true)]
[SuppressMessage("Microsoft.Globalization", "CA2101:SpecifyMarshalingForPInvokeStringArguments", MessageId = "AlternateStreamNativeData.Name")]
internal static extern SafeFindHandle FindFirstStreamW(
string lpFileName, StreamInfoLevels InfoLevel,
[In, Out, MarshalAs(UnmanagedType.LPStruct)]
AlternateStreamNativeData lpFindStreamData, uint dwFlags);
[DllImport("kernel32.dll", ExactSpelling = true, CharSet = CharSet.Unicode, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
[SuppressMessage("Microsoft.Globalization", "CA2101:SpecifyMarshalingForPInvokeStringArguments", MessageId = "AlternateStreamNativeData.Name")]
internal static extern bool FindNextStreamW(
SafeFindHandle hndFindFile,
[In, Out, MarshalAs(UnmanagedType.LPStruct)]
AlternateStreamNativeData lpFindStreamData); |
|
Contributes to #18553. |
|
🎉 Handy links: |
PR Summary
Continue #18496
PR Context
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.(which runs in a different PS Host).