-
Notifications
You must be signed in to change notification settings - Fork 282
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
Merge | Pull in the rest of the interop files #2933
base: main
Are you sure you want to change the base?
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@@ -2,16 +2,13 @@ | |||
// The .NET Foundation licenses this file to you under the MIT license. | |||
// See the LICENSE file in the project root for more information. | |||
|
|||
#if DEBUG && !NET8_0_OR_GREATER | |||
#if DEBUG && !NETFRAMEWORK && !NET8_0_OR_GREATER |
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.
#if DEBUG && !NETFRAMEWORK && !NET8_0_OR_GREATER | |
#if DEBUG && NET6_0 |
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.
I think it communicates the intent a bit better, but up to you. We'll delete them soon anyway.
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.
My rationale for using !NET8_0_OR_GREATER is because covers all versions below net8. I know we only build net6 and net8, and I guess it would be silly for someone to pull down the source and try to build it for eg, net7, but this is a fairly benign way to cover more bases.
I think of it similar to how we could do string.IndexOf("foo") == -1
or we could do string.IndexOf("foo") < 0
, and how the latter is generally thought to be safer.
src/Microsoft.Data.SqlClient/src/Interop/Windows/Kernel32/Interop.FreeLibrary.netcore.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Interop/Windows/Kernel32/Interop.GetProcAddress.netcore.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Interop/Windows/Kernel32/Interop.LoadLibraryEx.netcore.cs
Outdated
Show resolved
Hide resolved
....SqlClient/src/Interop/Windows/SChannel/Interop.SecPkgContext_ApplicationProtocol.netcore.cs
Outdated
Show resolved
Hide resolved
f74572d
to
1290944
Compare
…o the same as their physical location ... mostly so I don't lose my mind
This looks good to me. On a more general note, it looks like we're moving away from the various NativeMethods, SafeNativeMethods and UnsafeNativeMethods classes? If so my PR #2828 removes the currently-unused PInvokes from these code files, so there's no need to bother migrating those. There are quite a few other PInvokes in those files which are only used within the SQLDebugging class (and associated debugging infrastructure) though. I'd suggest ignoring those too - SQLDebugging is only used when debugging a client application connected to a local SQL 2000 instance, and when this is no longer permitted I'm planning to submit a PR which will eliminate that functionality and remove these PInvokes anyway. |
Description: This PR is pretty straightforward, it brings in the rest of the files used for "interop". This is the first stage of a series of PRs that I've been working on that migrate the interop class to an interop namespace. This is a prerequisite for a prerequisite for merging LocalDBAPI. It is not strictly required, but it will make my life easier for merging the LocalDBAPI, and ideally it is work that should be done eventually anyhow.
Keep in mind if #2927 goes through, much of this code can be deleted since it is no longer needed in net8 or above.
This PR only moves the files, it does not make any code changes.
Testing: Projects still build, so there is no issue.