diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 474464de..b5419a8e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,7 +44,7 @@ Building, testing, and packing this repository can be done by using the standard The win32metadata has [these little "gems"](https://github.com/microsoft/win32metadata/blob/main/docs/projections.md) that CsWin32 should consider consuming to improve the quality of the generated APIs. When we identify a gem that we should support but do not yet support, file [an issue with a `metadata gem` label](https://github.com/microsoft/CsWin32/issues?q=is%3Aissue+is%3Aopen+label%3A%22metadata+gem%22). -[pwsh]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell?view=powershell-6 +[pwsh]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell ## Releases diff --git a/README.md b/README.md index 64ad3fbd..7f7cc8af 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ * Rapidly add P/Invoke methods and supporting types to your C# project. * No bulky assemblies to ship alongside your application. * `SafeHandle`-types automatically generated. -* Generates xml documentation based on and links back to docs.microsoft.com +* Generates xml documentation based on and links back to learn.microsoft.com ![Animation demonstrating p/invoke code generation](docfx/images/demo.gif) diff --git a/SECURITY.md b/SECURITY.md index 0dc4b6a7..29306956 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -4,7 +4,7 @@ Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). -If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below. +If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://learn.microsoft.com/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below. ## Reporting Security Issues diff --git a/azure-pipelines/PostPRMessage.ps1 b/azure-pipelines/PostPRMessage.ps1 index 4a2b7886..4075f392 100644 --- a/azure-pipelines/PostPRMessage.ps1 +++ b/azure-pipelines/PostPRMessage.ps1 @@ -8,7 +8,7 @@ param( $CommentState='Active' ) -# See https://docs.microsoft.com/en-us/dotnet/api/microsoft.teamfoundation.sourcecontrol.webapi.commentthreadstatus?view=azure-devops-dotnet +# See https://learn.microsoft.com/dotnet/api/microsoft.teamfoundation.sourcecontrol.webapi.commentthreadstatus if ($CommentState -eq 'Active') { $StatusCode = 1 } elseif ($CommentState -eq 'ByDesign') { @@ -38,7 +38,7 @@ $body = ConvertTo-Json @{ Write-Verbose "Posting JSON payload: `n$Body" # Post the message to the Pull Request -# https://docs.microsoft.com/en-us/rest/api/azure/devops/git/pull%20request%20threads?view=azure-devops-rest-5.1 +# https://learn.microsoft.com/rest/api/azure/devops/git/pull-request-threads $url = "$($env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI)$env:SYSTEM_TEAMPROJECTID/_apis/git/repositories/$($env:BUILD_REPOSITORY_NAME)/pullRequests/$($env:SYSTEM_PULLREQUEST_PULLREQUESTID)/threads?api-version=5.1" if ($PSCmdlet.ShouldProcess($url, 'Post comment via REST call')) { try { diff --git a/azurepipelines-coverage.yml b/azurepipelines-coverage.yml index 0cd5dad3..e2dd1f50 100644 --- a/azurepipelines-coverage.yml +++ b/azurepipelines-coverage.yml @@ -1,4 +1,4 @@ -# https://learn.microsoft.com/azure/devops/pipelines/test/codecoverage-for-pullrequests?view=azure-devops +# https://learn.microsoft.com/azure/devops/pipelines/test/codecoverage-for-pullrequests coverage: status: comments: on # add comment to PRs reporting diff in coverage of modified files diff --git a/docfx/docs/features.md b/docfx/docs/features.md index dc492d73..122b9ece 100644 --- a/docfx/docs/features.md +++ b/docfx/docs/features.md @@ -4,6 +4,6 @@ * No bulky assemblies to ship alongside your application. * Generate the optimal code for your target framework and C# language version. * `SafeHandle`-types automatically generated. -* Generates xml documentation based on and links back to docs.microsoft.com +* Generates xml documentation based on and links back to learn.microsoft.com ![Animation demonstrating p/invoke code generation](../images/demo.gif) diff --git a/src/Microsoft.Windows.CsWin32/Generator.ApiDocs.cs b/src/Microsoft.Windows.CsWin32/Generator.ApiDocs.cs index 10aa99cb..25980bd8 100644 --- a/src/Microsoft.Windows.CsWin32/Generator.ApiDocs.cs +++ b/src/Microsoft.Windows.CsWin32/Generator.ApiDocs.cs @@ -104,7 +104,7 @@ private T AddApiDocumentation(string api, T memberDeclaration) else if (docs.HelpLink is object) { docCommentsBuilder.AppendLine(); - docCommentsBuilder.AppendLine($@"/// Learn more about this API from docs.microsoft.com."); + docCommentsBuilder.AppendLine($@"/// Learn more about this API from learn.microsoft.com."); docCommentsBuilder.Append("/// "); } @@ -211,7 +211,7 @@ static void EmitDoc(string yamlDocSrc, StringBuilder docCommentsBuilder, ApiDeta if (docs is object) { - docCommentsBuilder.AppendLine($@"/// Read more on docs.microsoft.com."); + docCommentsBuilder.AppendLine($@"/// Read more on learn.microsoft.com."); } docCommentsBuilder.Append("/// "); diff --git a/src/Microsoft.Windows.CsWin32/Generator.Invariants.cs b/src/Microsoft.Windows.CsWin32/Generator.Invariants.cs index a97b4527..a96a6908 100644 --- a/src/Microsoft.Windows.CsWin32/Generator.Invariants.cs +++ b/src/Microsoft.Windows.CsWin32/Generator.Invariants.cs @@ -149,7 +149,7 @@ public partial class Generator /// /// This list is combined with an MSBuild item list so that 3rd party metadata can document app-local DLLs. /// - /// + /// private static readonly string[] BuiltInAppLocalLibraries = ["DbgHelp.dll", "SymSrv.dll", "SrcSrv.dll"]; // [DefaultDllImportSearchPaths(DllImportSearchPath.System32)] @@ -323,7 +323,7 @@ public partial class Generator /// Gets a map of interop APIs that should never be generated, whether marshaling is allowed or not, and messages to emit in diagnostics if these APIs are ever directly requested. /// internal static ImmutableDictionary BannedAPIsWithoutMarshaling { get; } = ImmutableDictionary.Empty - .Add("GetLastError", "Do not generate GetLastError. Call Marshal.GetLastWin32Error() instead. Learn more from https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshal.getlastwin32error") + .Add("GetLastError", "Do not generate GetLastError. Call Marshal.GetLastWin32Error() instead. Learn more from https://learn.microsoft.com/dotnet/api/system.runtime.interopservices.marshal.getlastwin32error") .Add("OLD_LARGE_INTEGER", "Use the C# long keyword instead.") .Add("LARGE_INTEGER", "Use the C# long keyword instead.") .Add("ULARGE_INTEGER", "Use the C# ulong keyword instead.") diff --git a/src/Microsoft.Windows.CsWin32/SimpleSyntaxFactory.cs b/src/Microsoft.Windows.CsWin32/SimpleSyntaxFactory.cs index ec00fbcd..dce33f4e 100644 --- a/src/Microsoft.Windows.CsWin32/SimpleSyntaxFactory.cs +++ b/src/Microsoft.Windows.CsWin32/SimpleSyntaxFactory.cs @@ -9,7 +9,7 @@ internal static class SimpleSyntaxFactory /// C# keywords that must be escaped or changed when they appear as identifiers from metadata. /// /// - /// This list comes from this documentation. + /// This list comes from this documentation. /// internal static readonly HashSet CSharpKeywords = new HashSet(StringComparer.Ordinal) { diff --git a/src/Microsoft.Windows.CsWin32/SourceGenerator.cs b/src/Microsoft.Windows.CsWin32/SourceGenerator.cs index 4763b36c..d6b290c5 100644 --- a/src/Microsoft.Windows.CsWin32/SourceGenerator.cs +++ b/src/Microsoft.Windows.CsWin32/SourceGenerator.cs @@ -32,7 +32,7 @@ public class SourceGenerator : ISourceGenerator public static readonly DiagnosticDescriptor NoMatchingMethodOrTypeWithBadCharacters = new DiagnosticDescriptor( "PInvoke001", "No matching method, type or constant found", - "Method, type or constant \"{0}\" not found. It contains unexpected characters, possibly including invisible characters, which can happen when copying and pasting from docs.microsoft.com among other places. Try deleting the line and retyping it.", + "Method, type or constant \"{0}\" not found. It contains unexpected characters, possibly including invisible characters, which can happen when copying and pasting from learn.microsoft.com among other places. Try deleting the line and retyping it.", "Functionality", DiagnosticSeverity.Warning, isEnabledByDefault: true); diff --git a/src/Microsoft.Windows.CsWin32/templates/PInvokeClassMacros.cs b/src/Microsoft.Windows.CsWin32/templates/PInvokeClassMacros.cs index 7400c84a..132e252f 100644 --- a/src/Microsoft.Windows.CsWin32/templates/PInvokeClassMacros.cs +++ b/src/Microsoft.Windows.CsWin32/templates/PInvokeClassMacros.cs @@ -9,7 +9,7 @@ internal class PInvokeClassMacros /// The win32 error to be wrapped. /// An . /// - /// Learn more in the documentation for this API. + /// Learn more in the documentation for this API. /// internal static global::Windows.Win32.Foundation.HRESULT HRESULT_FROM_WIN32(global::Windows.Win32.Foundation.WIN32_ERROR error) => new(unchecked(error <= 0 ? (int)error : (int)(((uint)error & 0x0000FFFF) | 0x80070000))); diff --git a/test/Microsoft.Windows.CsWin32.Tests/GeneratorTests.cs b/test/Microsoft.Windows.CsWin32.Tests/GeneratorTests.cs index 21e701db..62296af0 100644 --- a/test/Microsoft.Windows.CsWin32.Tests/GeneratorTests.cs +++ b/test/Microsoft.Windows.CsWin32.Tests/GeneratorTests.cs @@ -950,7 +950,7 @@ public void MiniDumpWriteDump_AllOptionalPointerParametersAreOptional(string tfm public void ContainsIllegalCharactersForAPIName_InvisibleCharacters() { // You can't see them, but there are invisible hyphens in this name. - // Copy-paste from docs.microsoft.com has been known to include these invisible characters and break matching in NativeMethods.txt. + // Copy-paste from learn.microsoft.com has been known to include these invisible characters and break matching in NativeMethods.txt. Assert.True(Generator.ContainsIllegalCharactersForAPIName("SHGet­Known­Folder­Item")); } diff --git a/test/Microsoft.Windows.CsWin32.Tests/HandleTests.cs b/test/Microsoft.Windows.CsWin32.Tests/HandleTests.cs index 3ef2ab4f..bf1d2948 100644 --- a/test/Microsoft.Windows.CsWin32.Tests/HandleTests.cs +++ b/test/Microsoft.Windows.CsWin32.Tests/HandleTests.cs @@ -98,7 +98,7 @@ public void MSIHANDLE_BecomesSafeHandle() public void HandleStructsHaveIsNullProperty(string handleName) { // A null HGDIOBJ has a specific meaning beyond just the concept of an invalid handle: - // https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-selectobject#return-value + // https://learn.microsoft.com/windows/win32/api/wingdi/nf-wingdi-selectobject#return-value this.AssertGeneratedMember(handleName, "IsNull", "internal bool IsNull => Value == default;"); } @@ -109,7 +109,7 @@ public void HandleStructsHaveIsNullProperty(string handleName) public void HandleStructsHaveStaticNullMember(string handleName) { // A null HGDIOBJ has a specific meaning beyond just the concept of an invalid handle: - // https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-selectobject#return-value + // https://learn.microsoft.com/windows/win32/api/wingdi/nf-wingdi-selectobject#return-value this.AssertGeneratedMember(handleName, "Null", $"internal static {handleName} Null => default;"); }