diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index 6d3f2efaf848ce..015825df43d7a6 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -3,19 +3,19 @@
"isRoot": true,
"tools": {
"coverlet.console": {
- "version": "1.7.2",
+ "version": "3.1.0",
"commands": [
"coverlet"
]
},
"dotnet-reportgenerator-globaltool": {
- "version": "4.5.8",
+ "version": "5.0.2",
"commands": [
"reportgenerator"
]
},
"microsoft.dotnet.xharness.cli": {
- "version": "1.0.0-prerelease.21622.1",
+ "version": "1.0.0-prerelease.22062.1",
"commands": [
"xharness"
]
diff --git a/.gitignore b/.gitignore
index c1a783db2aa7c9..6627d2c2d0a75b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -187,6 +187,7 @@ node_modules/
*.metaproj.tmp
bin.localpkg/
src/mono/wasm/runtime/dotnet.d.ts.sha256
+src/mono/sample/wasm/browser-nextjs/public/
# RIA/Silverlight projects
Generated_Code/
diff --git a/Directory.Build.props b/Directory.Build.props
index 0983ba4ae36f89..e9e6fc4e362346 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -31,6 +31,7 @@
armarmelarm64
+ loongarch64s390xwasmx64
@@ -157,26 +158,27 @@
- <_toolRuntimeRID Condition="'$(CrossBuild)' == 'true'">$(_hostOS.ToLowerInvariant)-$(_hostArch)
- <_toolRuntimeRID Condition="'$(BuildingInsideVisualStudio)' == 'true'">$(_runtimeOS)-x64
- <_toolRuntimeRID Condition="'$(_toolRuntimeRID)' == ''">$(_runtimeOS)-$(_hostArch)
+ <_toolsRID Condition="'$(CrossBuild)' == 'true'">$(_hostOS.ToLowerInvariant)-$(_hostArch)
+ <_toolsRID Condition="'$(BuildingInsideVisualStudio)' == 'true'">$(_runtimeOS)-x64
+ <_toolsRID Condition="'$(_toolsRID)' == ''">$(_runtimeOS)-$(_hostArch)
- <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'browser'">linux-x64
- <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'browser' and '$(HostOS)' == 'windows'">win-x64
- <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'browser' and '$(HostOS)' == 'osx'">osx-x64
+ <_toolsRID Condition="'$(_runtimeOS)' == 'browser'">linux-x64
+ <_toolsRID Condition="'$(_runtimeOS)' == 'browser' and '$(HostOS)' == 'windows'">win-x64
+ <_toolsRID Condition="'$(_runtimeOS)' == 'browser' and '$(HostOS)' == 'osx'">osx-x64
- <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'android'">linux-x64
- <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'android' and '$(HostOS)' == 'windows'">win-x64
- <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'android' and '$(HostOS)' == 'osx'">osx-x64
+ <_toolsRID Condition="'$(_runtimeOS)' == 'android'">linux-x64
+ <_toolsRID Condition="'$(_runtimeOS)' == 'android' and '$(HostOS)' == 'windows'">win-x64
+ <_toolsRID Condition="'$(_runtimeOS)' == 'android' and '$(HostOS)' == 'osx'">osx-x64
- <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'maccatalyst' or '$(_runtimeOS)' == 'ios' or '$(_runtimeOS)' == 'iOSSimulator' or '$(_runtimeOS)' == 'tvos' or '$(_runtimeOS)' == 'tvOSSimulator'">osx-x64
+ <_toolsRID Condition="'$(_runtimeOS)' == 'maccatalyst' or '$(_runtimeOS)' == 'ios' or '$(_runtimeOS)' == 'iOSSimulator' or '$(_runtimeOS)' == 'tvos' or '$(_runtimeOS)' == 'tvOSSimulator'">osx-x64
-
- linux-$(_hostArch)
- $(_toolRuntimeRID)
+
+ linux-$(_hostArch)
+ $(_toolsRID)
+ $(ToolsRID)$(_packageOS)-$(TargetArchitecture)
diff --git a/docs/coding-guidelines/interop-guidelines.md b/docs/coding-guidelines/interop-guidelines.md
index 997aa1fd3772a8..55d4e9ddcae0ab 100644
--- a/docs/coding-guidelines/interop-guidelines.md
+++ b/docs/coding-guidelines/interop-guidelines.md
@@ -166,6 +166,12 @@ Using enums instead of partial, static classes can lead to needing lots of casts
When defining the P/Invoke signatures and structs, we follow the guidelines in the [interop best practices documentation](https://docs.microsoft.com/en-us/dotnet/standard/native-interop/best-practices).
+The runtime repo makes use of [source-generated p/invokes](../design/features/source-generator-pinvokes.md) whenever possible (see [the compatibility doc](../design/libraries/DllImportGenerator/Compatibility.md) for unsupported scenarios). Methods should be marked `GeneratedDllImport` and be `static` and `partial`.
+
+If implicit framework references are disabled (as is the case for most libraries projects), explicit references to the below are required for marshalling arrays:
+ - `System.Memory`
+ - `System.Runtime.CompilerServices.Unsafe`
+
## UNIX shims
Often, various UNIX flavors offer the same API from the point-of-view of compatibility with C/C++ source code, but they do not have the same ABI. e.g. Fields can be laid out differently, constants can have different numeric values, exports can be named differently, etc. There are not only differences between operating systems (Mac OS X vs. Ubuntu vs. FreeBSD), but also differences related to the underlying processor architecture (x64 vs. x86 vs. ARM).
@@ -174,6 +180,8 @@ This leaves us with a situation where we can't write portable P/Invoke declarati
To address this, we're moving to a model where all UNIX interop from dotnet/runtime starts with a P/Invoke to a C++ lib written specifically for dotnet/runtime. These libs -- System.*.Native.so (aka "shims") -- are intended to be very thin layers over underlying platform libraries. Generally, they are not there to add any significant abstraction, but to create a stable ABI such that the same IL assembly can work across UNIX flavors.
+The System.Native shims are a private implementation detail of the Microsoft.NETCore.App shared framework and are intended only for use by code inside of the shared framework. Calling into the shims from external to Microsoft.NETCore.App has similar risks to using private reflection, with no guarantees from version to version or even patch to patch of stable exports. Assemblies that ship outside of the shared framework (e.g. Microsoft.Extensions.*) must not directly access the shims.
+
Guidelines for shim C++ API:
- Keep them as "thin"/1:1 as possible.
diff --git a/docs/design/mono/debugger.md b/docs/design/mono/debugger.md
index 3a3a2936b79eb4..2268d81bf1047b 100644
--- a/docs/design/mono/debugger.md
+++ b/docs/design/mono/debugger.md
@@ -18,4 +18,11 @@ Web Assembly Debugger supports usage of following attributes:
- Stepping In/Over: results in an additional stepping need to proceed to the next line.
- __System.Diagnostics.DebuggerDisplay__
- __System.Diagnostics.DebuggerTypeProxy__
-- ...
\ No newline at end of file
+- __System.Diagnostics.DebuggerBrowsable__ ([doc](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.debuggerbrowsableattribute?view=net-6.0))
+ - Collapsed - displayed normally.
+ - RootHidden:
+ - Simple type - not displayed in the debugger window.
+ - Collection / Array - the values of a collection are displayed in a flat view, using the naming convention: *rootName[idx]*.
+
+ - Never - not displayed in the debugger window.
+
diff --git a/docs/workflow/Codespaces.md b/docs/workflow/Codespaces.md
index 391cd4087429e6..858da337216f25 100644
--- a/docs/workflow/Codespaces.md
+++ b/docs/workflow/Codespaces.md
@@ -5,13 +5,11 @@ Codespaces allows you to develop in a Docker container running in the cloud. You
dotnet/runtime runs a nightly GitHub Action to build the latest code in the repo. This allows you to immediately start developing and testing after creating a codespace without having to build the whole repo. When the machine is created, it will have built the repo using the code as of 6 AM UTC that morning.
-**NOTE**: In order to use a prebuilt codespace, when you create your machine be sure to select an **`8 core`** machine.
-
1. From https://github.com/dotnet/runtime, drop-down the `Code` button and select the `Codespaces` tab.

-2. Select `8-core` for the Machine type. This will ensure you get a "pre built" image.
+2. Select the Machine type. For dotnet/runtime, it is recommended to select at least a `4-core` machine. You can also verify that a "Prebuild" is ready.

diff --git a/docs/workflow/codespace-machine-size.png b/docs/workflow/codespace-machine-size.png
index 07945fb9ff672d..d0687c85b05f36 100644
Binary files a/docs/workflow/codespace-machine-size.png and b/docs/workflow/codespace-machine-size.png differ
diff --git a/docs/workflow/debugging/coreclr/debugging-aot-compilers.md b/docs/workflow/debugging/coreclr/debugging-aot-compilers.md
index 048d571df45f21..d21fa21a5cb77b 100644
--- a/docs/workflow/debugging/coreclr/debugging-aot-compilers.md
+++ b/docs/workflow/debugging/coreclr/debugging-aot-compilers.md
@@ -19,7 +19,7 @@ Built in debugging aids in the managed compilers
---------------------------------
- When debugging a multi-threaded component of the compiler and not investigating a multi-threading issue itself, it is generally advisable to disable the use of multiple threads.
-To do this use the `--parallelism 1` switch (for crossgen2) or `--singlethreaded` (for ILC) to specify that the maximum parallelism of the process shall be 1.
+To do this use the `--parallelism 1` switch to specify that the maximum parallelism of the process shall be 1.
- When debugging the behavior of compiling a single method, the compiler may be instructed to only compile a single method. This is done via the various --singlemethod options
@@ -172,3 +172,7 @@ devenv /debugexe C:\git2\runtime\.dotnet\dotnet.exe "c:\git2\runtime\artifacts\t
```
This will launch the Visual Studio debugger, with a solution setup for debugging the dotnet.exe process. By default this solution will debug the native code of the process only. To debug the managed components, edit the properties on the solution and set the `Debugger Type` to `Managed (.NET Core, .NET 5+)` or `Mixed (.NET Core, .NET 5+)`.
+
+# Debugging compilation graph
+
+The AOT compilation is driven by a dependency graph. If you need to troubleshoot the dependency graph (to figure out why something was or wasn't generated) you can follow [this guide](debuging-compiler-dependency-analysis.md)
diff --git a/docs/workflow/debugging/coreclr/debuging-compiler-dependency-analysis.md b/docs/workflow/debugging/coreclr/debuging-compiler-dependency-analysis.md
new file mode 100644
index 00000000000000..cc918c391f62a1
--- /dev/null
+++ b/docs/workflow/debugging/coreclr/debuging-compiler-dependency-analysis.md
@@ -0,0 +1,47 @@
+Debugging Compiler Dependency Analysis
+============================
+
+The general technique is to identify what node is missing from the graph or is erroneously present in the graph, and change the dependency analysis logic to adjust the graph. This document describes the various ways of debugging to identify what's happening.
+
+Analysis techniques for the dependency graph.
+1. Use the DependencyGraphViewer tool (if running on Windows). This tool is located in `src/coreclr/tools/aot/DependencyGraphViewer`
+ - This is the only convenient way to examine the graph while also simultaneously debugging the compiler.
+ - While this is currently Windows only due to use of WinForms, it would be fairly straightforward to make a command line based tool.
+ - Dependency graph does not support multiple simultaneous logging facilities, so make sure that you do not set IlcGenerateDgmlFile or invoke ILCompiler with the DGML generation turned on.
+2. Pass command line switches to the compiler to generate a dependency graph dgml file. This will produce the same data as is viewable in the viewer tool, but in a textual xml format.
+ - Future efforts may make the xml file loadable by the viewer tool.
+3. Instrument the compiler dependency analysis. (This may be necessary in cases where the viewer is unable to provide sufficient information about why the graph is structured as it is.)
+
+DependencyGraphViewer
+====================================
+
+This application allows viewing the dependency graph produced by the AOT compilation.
+
+Usage instructions:
+1. Launch the process as an administrator
+2. Run the compiler
+- The compiler can be run to completion, or stopped.
+3. Explore through the graph
+
+# Graphs View #
+- Choose one of the graphs that appears in the Dependency Graphs view to explore. As compilers execute, new graphs will automatically appear here.
+- The set of graphs loaded into the process is limited by available memory space. To clear the used memory, close all windows of the application.
+
+# Graph View #
+- In the Dependency Graph view, enter a regular expression in the text box, and then press ""Filter"". This will display a list of the nodes in the graph which have names which match the regular expression.
+- Commonly, if there is a object file symbol associated with the node it should be used as part of the regular expression. See the various implementations of GetName in the compiler for naming behavior.
+- Additionally, the event source marking mode assigns an Id to each node, and that is found as the mark object on the node, so if a specific id is known, just type that in, and it will appear in the window. (This is for use when using this tool in parallel with debugging the compiler.
+
+# Single Node Exploration #
+Once the interesting node(s) have been identified in the dependency graph window, select one of them, and then press Explore.
+ - In the Node Explorer window, the Dependent nodes (the ones which dependend on the current node are the nodes displayed above, and the Dependee nodes (the nodes that this node depends on) are displayed below. Each node in the list is paired with a textual reason as to why that edge in the graph exists.
+ - Select a node to explore further and press the corresponding button to make it happen.
+
+WhyDGML
+=======
+This tool can be used to visualize paths from a node of interest to the roots. To use it, pass command line option to the compiler to generate the DGML file (`--dgmllog name_of_output_file`) and then use this tool to find the path to the root. If you're looking at an optimized NativeAOT compilation, `--scandgmllog` might be preferable since it will have more details.
+The input to the tool is the DGML file and name of a node of interest. The output is the list of reasons why that node was included.
+
+This tool located in folder `src/coreclr/tools/aot/WhyDgml`
+
+See https://github.com/dotnet/corert/pull/7962 for example of usage and output.
diff --git a/docs/workflow/requirements/freebsd-requirements.md b/docs/workflow/requirements/freebsd-requirements.md
index 941b949a252878..c14c1c1a27cf01 100644
--- a/docs/workflow/requirements/freebsd-requirements.md
+++ b/docs/workflow/requirements/freebsd-requirements.md
@@ -1,13 +1,12 @@
-Requirements to build dotnet/runtime on FreeBSD
+Requirements to build and run dotnet/runtime on FreeBSD
=====================
-This guide will walk you through the requirements needed to build dotnet/runtime on FreeBSD. We'll start by showing how to set up your environment from scratch.
+This guide will walk you through the requirements needed to build and run dotnet/runtime on FreeBSD. We'll start by showing how to set up your environment from scratch.
Since there is no official build and FreeBSD package, native build on FreeBSD is not trivial. There are generally three options, sorted by ease of use:
- cross-compile on Linux using Docker
- cross-compile on Linux using Toolchain
- build on FreeBSD
-
Environment
===========
@@ -65,3 +64,46 @@ sudo pkg install --yes libunwind icu libinotify lttng-ust krb5 cmake openssl nin
Additionally, working dotnet cli with SDK is needed. On other platforms this would be downloaded automatically during build but it is not currently available for FreeBSD.
It needs to be built once on supported platform or obtained via community resources.
+Running on FreeBSD
+-------------------
+Install the following packages:
+- icu
+- libunwind
+- lttng-ust (optional, debug support)
+- krb5
+- openssl (optional, SSL support)
+- libinotify
+- terminfo-db (optional, terminal colors)
+
+The lines to install all the packages above using package manager.
+
+```sh
+sudo pkg install --yes libunwind icu libinotify lttng-ust krb5 openssl terminfo-db
+```
+
+Extract the SDK:
+The canonical location for the SDK is `/usr/share/dotnet`
+
+"VERSION" is the SDK version being unpacked.
+
+```sh
+sudo mkdir /usr/share/dotnet
+tar xf /tmp/dotnet-sdk-VERSION-freebsd-x64.tar.gz -C /usr/share/dotnet/
+```
+
+NuGet Packages:
+The canonical location for the NuGet packages is `/var/cache/nuget`
+
+"VERSION" is the same version as the SDK from above.
+
+- Microsoft.NETCore.App.Host.freebsd-x64.VERSION.nupkg
+- Microsoft.NETCore.App.Runtime.freebsd-x64.VERSION.nupkg
+- Microsoft.AspNetCore.App.Runtime.freebsd-x64.VERSION.nupkg
+
+Add the following line to any `NuGet.config` you are using under the `` section:
+
+```xml
+
+```
+
+Finally, either add `/usr/share/dotnet` to your PATH or create a symbolic for `/usr/share/dotnet/dotnet`
diff --git a/eng/CodeAnalysis.src.globalconfig b/eng/CodeAnalysis.src.globalconfig
index 400c8c432c21bf..0fc9bf8e5a7eeb 100644
--- a/eng/CodeAnalysis.src.globalconfig
+++ b/eng/CodeAnalysis.src.globalconfig
@@ -1444,7 +1444,7 @@ dotnet_diagnostic.IDE0057.severity = suggestion
dotnet_diagnostic.IDE0058.severity = silent
# IDE0059: Unnecessary assignment of a value
-dotnet_diagnostic.IDE0059.severity = suggestion
+dotnet_diagnostic.IDE0059.severity = warning
# IDE0060: Remove unused parameter
dotnet_diagnostic.IDE0060.severity = silent
diff --git a/eng/Subsets.props b/eng/Subsets.props
index f0bb31a28aea72..772fbfcb995329 100644
--- a/eng/Subsets.props
+++ b/eng/Subsets.props
@@ -243,7 +243,7 @@
-
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index e3a571f451cdea..a2cfe2c769fe8f 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -1,8 +1,8 @@
-
+ https://github.com/dotnet/icu
- d9371f17932fbf828f1d1e2f21a99b64ba40eba5
+ aae7d341a8ee7841ed0cb1cf298ab17fe04c187bhttps://github.com/dotnet/msquic
@@ -16,159 +16,159 @@
https://github.com/dotnet/wcf7f504aabb1988e9a093c1e74d8040bd52feb2f01
-
+ https://github.com/dotnet/llvm-project
- ef5d90bc37b53288e32d78dbf34eae32cd0893d3
+ e7e0ebc663c70ccb19c331af50d418a06dc92df8
-
+ https://github.com/dotnet/llvm-project
- ef5d90bc37b53288e32d78dbf34eae32cd0893d3
+ e7e0ebc663c70ccb19c331af50d418a06dc92df8
-
+ https://github.com/dotnet/llvm-project
- ef5d90bc37b53288e32d78dbf34eae32cd0893d3
+ e7e0ebc663c70ccb19c331af50d418a06dc92df8
-
+ https://github.com/dotnet/llvm-project
- ef5d90bc37b53288e32d78dbf34eae32cd0893d3
+ e7e0ebc663c70ccb19c331af50d418a06dc92df8
-
+ https://github.com/dotnet/llvm-project
- ef5d90bc37b53288e32d78dbf34eae32cd0893d3
+ e7e0ebc663c70ccb19c331af50d418a06dc92df8
-
+ https://github.com/dotnet/llvm-project
- ef5d90bc37b53288e32d78dbf34eae32cd0893d3
+ e7e0ebc663c70ccb19c331af50d418a06dc92df8
-
+ https://github.com/dotnet/llvm-project
- ef5d90bc37b53288e32d78dbf34eae32cd0893d3
+ e7e0ebc663c70ccb19c331af50d418a06dc92df8
-
+ https://github.com/dotnet/llvm-project
- ef5d90bc37b53288e32d78dbf34eae32cd0893d3
+ e7e0ebc663c70ccb19c331af50d418a06dc92df8
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5
-
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5https://github.com/microsoft/vstest140434f7109d357d0158ade9e5164a4861513965
-
+ https://github.com/dotnet/runtime-assets
- f6e023ee68f858cd020a13dc9dfc13ba6a82b64b
+ a597df23119faf540d95cebab14b82f084c47384
-
+ https://github.com/dotnet/runtime-assets
- f6e023ee68f858cd020a13dc9dfc13ba6a82b64b
+ a597df23119faf540d95cebab14b82f084c47384
-
+ https://github.com/dotnet/runtime-assets
- f6e023ee68f858cd020a13dc9dfc13ba6a82b64b
+ a597df23119faf540d95cebab14b82f084c47384
-
+ https://github.com/dotnet/runtime-assets
- f6e023ee68f858cd020a13dc9dfc13ba6a82b64b
+ a597df23119faf540d95cebab14b82f084c47384
-
+ https://github.com/dotnet/runtime-assets
- f6e023ee68f858cd020a13dc9dfc13ba6a82b64b
+ a597df23119faf540d95cebab14b82f084c47384
-
+ https://github.com/dotnet/runtime-assets
- f6e023ee68f858cd020a13dc9dfc13ba6a82b64b
+ a597df23119faf540d95cebab14b82f084c47384
-
+ https://github.com/dotnet/runtime-assets
- f6e023ee68f858cd020a13dc9dfc13ba6a82b64b
+ a597df23119faf540d95cebab14b82f084c47384
-
+ https://github.com/dotnet/runtime-assets
- f6e023ee68f858cd020a13dc9dfc13ba6a82b64b
+ a597df23119faf540d95cebab14b82f084c47384
-
+ https://github.com/dotnet/runtime-assets
- f6e023ee68f858cd020a13dc9dfc13ba6a82b64b
+ a597df23119faf540d95cebab14b82f084c47384
-
+ https://github.com/dotnet/runtime-assets
- f6e023ee68f858cd020a13dc9dfc13ba6a82b64b
+ a597df23119faf540d95cebab14b82f084c47384
-
+ https://github.com/dotnet/runtime-assets
- f6e023ee68f858cd020a13dc9dfc13ba6a82b64b
+ a597df23119faf540d95cebab14b82f084c47384https://github.com/dotnet/llvm-project
@@ -202,53 +202,57 @@
https://github.com/dotnet/llvm-project662aff66999c435aec09c58643e9fd703eadc3e0
-
+ https://github.com/dotnet/runtime
- 834b278911962102919b3a7dec22ca6cb26bfa8a
+ a2af6294767b4a3f4c2ce787c5dda2abeeda7a00
-
+ https://github.com/dotnet/runtime
- 834b278911962102919b3a7dec22ca6cb26bfa8a
+ a2af6294767b4a3f4c2ce787c5dda2abeeda7a00
-
+ https://github.com/dotnet/runtime
- 834b278911962102919b3a7dec22ca6cb26bfa8a
+ a2af6294767b4a3f4c2ce787c5dda2abeeda7a00
-
+ https://github.com/dotnet/runtime
- 834b278911962102919b3a7dec22ca6cb26bfa8a
+ a2af6294767b4a3f4c2ce787c5dda2abeeda7a00
-
+ https://github.com/dotnet/runtime
- 834b278911962102919b3a7dec22ca6cb26bfa8a
+ a2af6294767b4a3f4c2ce787c5dda2abeeda7a00
-
+ https://github.com/dotnet/runtime
- 834b278911962102919b3a7dec22ca6cb26bfa8a
+ a2af6294767b4a3f4c2ce787c5dda2abeeda7a00
-
+ https://github.com/dotnet/runtime
- 834b278911962102919b3a7dec22ca6cb26bfa8a
+ a2af6294767b4a3f4c2ce787c5dda2abeeda7a00
-
+ https://github.com/dotnet/runtime
- 834b278911962102919b3a7dec22ca6cb26bfa8a
+ a2af6294767b4a3f4c2ce787c5dda2abeeda7a00
-
+ https://github.com/dotnet/linker
- 41467d340a3345f08cb8ba67c20c1ea40c57682f
+ 1a6468ff722c8d362f37638989ec01ab9975ac28
-
+ https://github.com/dotnet/xharness
- 7ad8d01a879af9437a7c33d01409bd761700cdad
+ d33e67a6c2cc5fe415917c6f9bd17046a929dcc0
-
+ https://github.com/dotnet/xharness
- 7ad8d01a879af9437a7c33d01409bd761700cdad
+ d33e67a6c2cc5fe415917c6f9bd17046a929dcc0
-
+
+ https://github.com/dotnet/xharness
+ d33e67a6c2cc5fe415917c6f9bd17046a929dcc0
+
+ https://github.com/dotnet/arcade
- 0cd94b1d02c03377d99f3739beb191591f6abee5
+ 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5https://dev.azure.com/dnceng/internal/_git/dotnet-optimization
@@ -266,13 +270,13 @@
https://dev.azure.com/dnceng/internal/_git/dotnet-optimization91d6b3c1f51888d166701510189505f35714665c
-
+ https://github.com/dotnet/hotreload-utils
- f0d838421286fed81005fd4ddf6562555b641b3b
+ 5bc948c6242bc9423c3269d122dcdf0ad6c06a83
-
+ https://github.com/dotnet/runtime-assets
- f6e023ee68f858cd020a13dc9dfc13ba6a82b64b
+ a597df23119faf540d95cebab14b82f084c47384https://github.com/dotnet/roslyn-analyzers
diff --git a/eng/Versions.props b/eng/Versions.props
index 47d31b37c8e334..8bc9373cc09ac7 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -42,50 +42,50 @@
3.11.0
- 4.0.0-4.final
- 4.0.0-4.final
+ 4.0.1
+ 4.0.13.3.2
- 4.0.0-4.final
- 4.0.0-4.final
+ 4.0.1
+ 4.0.17.0.0-preview1.21613.12.0.0-alpha.1.21525.11
- 7.0.0-beta.21621.3
- 7.0.0-beta.21621.3
- 7.0.0-beta.21621.3
- 7.0.0-beta.21621.3
- 7.0.0-beta.21621.3
- 7.0.0-beta.21621.3
- 2.5.1-beta.21621.3
- 7.0.0-beta.21621.3
- 7.0.0-beta.21621.3
- 7.0.0-beta.21621.3
- 7.0.0-beta.21621.3
- 7.0.0-beta.21621.3
- 7.0.0-beta.21621.3
- 7.0.0-beta.21621.3
- 7.0.0-beta.21621.3
+ 7.0.0-beta.22056.6
+ 7.0.0-beta.22056.6
+ 7.0.0-beta.22056.6
+ 7.0.0-beta.22056.6
+ 7.0.0-beta.22056.6
+ 7.0.0-beta.22056.6
+ 2.5.1-beta.22056.6
+ 7.0.0-beta.22056.6
+ 7.0.0-beta.22056.6
+ 7.0.0-beta.22056.6
+ 7.0.0-beta.22056.6
+ 7.0.0-beta.22056.6
+ 7.0.0-beta.22056.6
+ 7.0.0-beta.22056.6
+ 7.0.0-beta.22056.66.0.0-preview.1.102
- 7.0.0-alpha.1.21620.1
- 7.0.0-alpha.1.21620.1
- 7.0.0-alpha.1.21620.1
+ 7.0.0-alpha.1.22059.2
+ 7.0.0-alpha.1.22059.2
+ 7.0.0-alpha.1.22059.23.1.0
- 7.0.0-alpha.1.21620.1
- 1.0.0-alpha.1.21630.1
- 1.0.0-alpha.1.21630.1
- 1.0.0-alpha.1.21630.1
- 1.0.0-alpha.1.21630.1
- 1.0.0-alpha.1.21630.1
- 1.0.0-alpha.1.21630.1
- 1.0.0-alpha.1.21630.1
- 1.0.0-alpha.1.21630.1
+ 7.0.0-alpha.1.22059.2
+ 1.0.0-alpha.1.22060.1
+ 1.0.0-alpha.1.22060.1
+ 1.0.0-alpha.1.22060.1
+ 1.0.0-alpha.1.22060.1
+ 1.0.0-alpha.1.22060.1
+ 1.0.0-alpha.1.22060.1
+ 1.0.0-alpha.1.22060.1
+ 1.0.0-alpha.1.22060.15.0.04.3.0
@@ -120,24 +120,24 @@
5.0.05.0.04.9.0-rc2.21473.1
- 7.0.0-alpha.1.21620.1
- 7.0.0-alpha.1.21620.1
+ 7.0.0-alpha.1.22059.2
+ 7.0.0-alpha.1.22059.24.5.44.5.0
- 7.0.0-alpha.1.21620.1
+ 7.0.0-alpha.1.22059.2
- 7.0.0-beta.21620.3
- 7.0.0-beta.21620.3
- 7.0.0-beta.21620.3
- 7.0.0-beta.21620.3
- 7.0.0-beta.21620.3
- 7.0.0-beta.21620.3
- 7.0.0-beta.21620.3
- 7.0.0-beta.21620.3
- 7.0.0-beta.21620.3
- 7.0.0-beta.21620.3
- 7.0.0-beta.21620.3
- 7.0.0-beta.21620.3
+ 7.0.0-beta.22060.1
+ 7.0.0-beta.22060.1
+ 7.0.0-beta.22060.1
+ 7.0.0-beta.22060.1
+ 7.0.0-beta.22060.1
+ 7.0.0-beta.22060.1
+ 7.0.0-beta.22060.1
+ 7.0.0-beta.22060.1
+ 7.0.0-beta.22060.1
+ 7.0.0-beta.22060.1
+ 7.0.0-beta.22060.1
+ 7.0.0-beta.22060.11.0.0-prerelease.21577.21.0.0-prerelease.21577.2
@@ -160,12 +160,13 @@
1.0.1-prerelease-0000616.9.0-preview-20201201-01
- 1.0.0-prerelease.21622.1
- 1.0.0-prerelease.21622.1
- 1.0.2-alpha.0.21620.2
+ 1.0.0-prerelease.22062.1
+ 1.0.0-prerelease.22062.1
+ 1.0.0-prerelease.22062.1
+ 1.0.2-alpha.0.22060.22.4.2-pre.92.4.2
- 1.3.0
+ 3.1.012.0.32.0.44.12.0
@@ -175,10 +176,10 @@
6.0.0-preview-20211019.1
- 7.0.100-1.21620.1
+ 7.0.100-1.22053.1$(MicrosoftNETILLinkTasksVersion)
- 7.0.0-alpha.1.21620.1
+ 7.0.0-alpha.1.22060.17.0.0-alpha.1.21529.3
diff --git a/eng/build.sh b/eng/build.sh
index f1ef5958fdbc92..ea8e3089e95f4d 100755
--- a/eng/build.sh
+++ b/eng/build.sh
@@ -17,7 +17,7 @@ scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
usage()
{
echo "Common settings:"
- echo " --arch (-a) Target platform: x86, x64, arm, armel, arm64, s390x or wasm."
+ echo " --arch (-a) Target platform: x86, x64, arm, armel, arm64, loongarch64, s390x or wasm."
echo " [Default: Your machine's architecture.]"
echo " --binaryLog (-bl) Output binary log."
echo " --cross Optional argument to signify cross compilation."
@@ -206,12 +206,12 @@ while [[ $# > 0 ]]; do
fi
passedArch="$(echo "$2" | tr "[:upper:]" "[:lower:]")"
case "$passedArch" in
- x64|x86|arm|armel|arm64|s390x|wasm)
+ x64|x86|arm|armel|arm64|loongarch64|s390x|wasm)
arch=$passedArch
;;
*)
echo "Unsupported target architecture '$2'."
- echo "The allowed values are x86, x64, arm, armel, arm64, s390x, and wasm."
+ echo "The allowed values are x86, x64, arm, armel, arm64, loongarch64, s390x, and wasm."
exit 1
;;
esac
diff --git a/eng/common/cross/arm/tizen-build-rootfs.sh b/eng/common/cross/arm/tizen-build-rootfs.sh
new file mode 100644
index 00000000000000..9fdb32e920e22c
--- /dev/null
+++ b/eng/common/cross/arm/tizen-build-rootfs.sh
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+set -e
+
+__ARM_HARDFP_CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+__TIZEN_CROSSDIR="$__ARM_HARDFP_CrossDir/tizen"
+
+if [[ -z "$ROOTFS_DIR" ]]; then
+ echo "ROOTFS_DIR is not defined."
+ exit 1;
+fi
+
+TIZEN_TMP_DIR=$ROOTFS_DIR/tizen_tmp
+mkdir -p $TIZEN_TMP_DIR
+
+# Download files
+echo ">>Start downloading files"
+VERBOSE=1 $__ARM_HARDFP_CrossDir/tizen-fetch.sh $TIZEN_TMP_DIR
+echo "<>Start constructing Tizen rootfs"
+TIZEN_RPM_FILES=`ls $TIZEN_TMP_DIR/*.rpm`
+cd $ROOTFS_DIR
+for f in $TIZEN_RPM_FILES; do
+ rpm2cpio $f | cpio -idm --quiet
+done
+echo "<>Start configuring Tizen rootfs"
+ln -sfn asm-arm ./usr/include/asm
+patch -p1 < $__TIZEN_CROSSDIR/tizen.patch
+echo "</dev/null; then
+ VERBOSE=0
+fi
+
+Log()
+{
+ if [ $VERBOSE -ge $1 ]; then
+ echo ${@:2}
+ fi
+}
+
+Inform()
+{
+ Log 1 -e "\x1B[0;34m$@\x1B[m"
+}
+
+Debug()
+{
+ Log 2 -e "\x1B[0;32m$@\x1B[m"
+}
+
+Error()
+{
+ >&2 Log 0 -e "\x1B[0;31m$@\x1B[m"
+}
+
+Fetch()
+{
+ URL=$1
+ FILE=$2
+ PROGRESS=$3
+ if [ $VERBOSE -ge 1 ] && [ $PROGRESS ]; then
+ CURL_OPT="--progress-bar"
+ else
+ CURL_OPT="--silent"
+ fi
+ curl $CURL_OPT $URL > $FILE
+}
+
+hash curl 2> /dev/null || { Error "Require 'curl' Aborting."; exit 1; }
+hash xmllint 2> /dev/null || { Error "Require 'xmllint' Aborting."; exit 1; }
+hash sha256sum 2> /dev/null || { Error "Require 'sha256sum' Aborting."; exit 1; }
+
+TMPDIR=$1
+if [ ! -d $TMPDIR ]; then
+ TMPDIR=./tizen_tmp
+ Debug "Create temporary directory : $TMPDIR"
+ mkdir -p $TMPDIR
+fi
+
+TIZEN_URL=http://download.tizen.org/snapshots/tizen
+BUILD_XML=build.xml
+REPOMD_XML=repomd.xml
+PRIMARY_XML=primary.xml
+TARGET_URL="http://__not_initialized"
+
+Xpath_get()
+{
+ XPATH_RESULT=''
+ XPATH=$1
+ XML_FILE=$2
+ RESULT=$(xmllint --xpath $XPATH $XML_FILE)
+ if [[ -z ${RESULT// } ]]; then
+ Error "Can not find target from $XML_FILE"
+ Debug "Xpath = $XPATH"
+ exit 1
+ fi
+ XPATH_RESULT=$RESULT
+}
+
+fetch_tizen_pkgs_init()
+{
+ TARGET=$1
+ PROFILE=$2
+ Debug "Initialize TARGET=$TARGET, PROFILE=$PROFILE"
+
+ TMP_PKG_DIR=$TMPDIR/tizen_${PROFILE}_pkgs
+ if [ -d $TMP_PKG_DIR ]; then rm -rf $TMP_PKG_DIR; fi
+ mkdir -p $TMP_PKG_DIR
+
+ PKG_URL=$TIZEN_URL/$PROFILE/latest
+
+ BUILD_XML_URL=$PKG_URL/$BUILD_XML
+ TMP_BUILD=$TMP_PKG_DIR/$BUILD_XML
+ TMP_REPOMD=$TMP_PKG_DIR/$REPOMD_XML
+ TMP_PRIMARY=$TMP_PKG_DIR/$PRIMARY_XML
+ TMP_PRIMARYGZ=${TMP_PRIMARY}.gz
+
+ Fetch $BUILD_XML_URL $TMP_BUILD
+
+ Debug "fetch $BUILD_XML_URL to $TMP_BUILD"
+
+ TARGET_XPATH="//build/buildtargets/buildtarget[@name=\"$TARGET\"]/repo[@type=\"binary\"]/text()"
+ Xpath_get $TARGET_XPATH $TMP_BUILD
+ TARGET_PATH=$XPATH_RESULT
+ TARGET_URL=$PKG_URL/$TARGET_PATH
+
+ REPOMD_URL=$TARGET_URL/repodata/repomd.xml
+ PRIMARY_XPATH='string(//*[local-name()="data"][@type="primary"]/*[local-name()="location"]/@href)'
+
+ Fetch $REPOMD_URL $TMP_REPOMD
+
+ Debug "fetch $REPOMD_URL to $TMP_REPOMD"
+
+ Xpath_get $PRIMARY_XPATH $TMP_REPOMD
+ PRIMARY_XML_PATH=$XPATH_RESULT
+ PRIMARY_URL=$TARGET_URL/$PRIMARY_XML_PATH
+
+ Fetch $PRIMARY_URL $TMP_PRIMARYGZ
+
+ Debug "fetch $PRIMARY_URL to $TMP_PRIMARYGZ"
+
+ gunzip $TMP_PRIMARYGZ
+
+ Debug "unzip $TMP_PRIMARYGZ to $TMP_PRIMARY"
+}
+
+fetch_tizen_pkgs()
+{
+ ARCH=$1
+ PACKAGE_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]][*[local-name()="arch"][text()="_ARCH_"]]/*[local-name()="location"]/@href)'
+
+ PACKAGE_CHECKSUM_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]][*[local-name()="arch"][text()="_ARCH_"]]/*[local-name()="checksum"]/text())'
+
+ for pkg in ${@:2}
+ do
+ Inform "Fetching... $pkg"
+ XPATH=${PACKAGE_XPATH_TPL/_PKG_/$pkg}
+ XPATH=${XPATH/_ARCH_/$ARCH}
+ Xpath_get $XPATH $TMP_PRIMARY
+ PKG_PATH=$XPATH_RESULT
+
+ XPATH=${PACKAGE_CHECKSUM_XPATH_TPL/_PKG_/$pkg}
+ XPATH=${XPATH/_ARCH_/$ARCH}
+ Xpath_get $XPATH $TMP_PRIMARY
+ CHECKSUM=$XPATH_RESULT
+
+ PKG_URL=$TARGET_URL/$PKG_PATH
+ PKG_FILE=$(basename $PKG_PATH)
+ PKG_PATH=$TMPDIR/$PKG_FILE
+
+ Debug "Download $PKG_URL to $PKG_PATH"
+ Fetch $PKG_URL $PKG_PATH true
+
+ echo "$CHECKSUM $PKG_PATH" | sha256sum -c - > /dev/null
+ if [ $? -ne 0 ]; then
+ Error "Fail to fetch $PKG_URL to $PKG_PATH"
+ Debug "Checksum = $CHECKSUM"
+ exit 1
+ fi
+ done
+}
+
+Inform "Initialize arm base"
+fetch_tizen_pkgs_init standard base
+Inform "fetch common packages"
+fetch_tizen_pkgs armv7hl gcc gcc-devel-static glibc glibc-devel libicu libicu-devel libatomic linux-glibc-devel keyutils keyutils-devel libkeyutils
+Inform "fetch coreclr packages"
+fetch_tizen_pkgs armv7hl lldb lldb-devel libgcc libstdc++ libstdc++-devel libunwind libunwind-devel lttng-ust-devel lttng-ust userspace-rcu-devel userspace-rcu
+Inform "fetch corefx packages"
+fetch_tizen_pkgs armv7hl libcom_err libcom_err-devel zlib zlib-devel libopenssl11 libopenssl1.1-devel krb5 krb5-devel
+
+Inform "Initialize standard unified"
+fetch_tizen_pkgs_init standard unified
+Inform "fetch corefx packages"
+fetch_tizen_pkgs armv7hl gssdp gssdp-devel tizen-release
+
diff --git a/eng/common/cross/arm/tizen/tizen.patch b/eng/common/cross/arm/tizen/tizen.patch
new file mode 100644
index 00000000000000..fb12ade7250ae9
--- /dev/null
+++ b/eng/common/cross/arm/tizen/tizen.patch
@@ -0,0 +1,9 @@
+diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so
+--- a/usr/lib/libc.so 2016-12-30 23:00:08.284951863 +0900
++++ b/usr/lib/libc.so 2016-12-30 23:00:32.140951815 +0900
+@@ -2,4 +2,4 @@
+ Use the shared library, but some functions are only in
+ the static library, so try that secondarily. */
+ OUTPUT_FORMAT(elf32-littlearm)
+-GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux-armhf.so.3 ) )
++GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux-armhf.so.3 ) )
diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh
index 5102245b7b5e3f..e94d13d62ef64d 100755
--- a/eng/common/cross/build-rootfs.sh
+++ b/eng/common/cross/build-rootfs.sh
@@ -185,8 +185,8 @@ while :; do
__LLDB_Package="liblldb-6.0-dev"
;;
tizen)
- if [ "$__BuildArch" != "armel" ] && [ "$__BuildArch" != "arm64" ]; then
- echo "Tizen is available only for armel and arm64."
+ if [ "$__BuildArch" != "arm" ] && [ "$__BuildArch" != "armel" ] && [ "$__BuildArch" != "arm64" ]; then
+ echo "Tizen is available only for arm, armel and arm64."
usage;
exit 1;
fi
diff --git a/eng/common/cross/toolchain.cmake b/eng/common/cross/toolchain.cmake
index 9d22fc92693031..f7878dddd39211 100644
--- a/eng/common/cross/toolchain.cmake
+++ b/eng/common/cross/toolchain.cmake
@@ -34,6 +34,9 @@ elseif(TARGET_ARCH_NAME STREQUAL "arm")
else()
set(TOOLCHAIN "arm-linux-gnueabihf")
endif()
+ if(TIZEN)
+ set(TIZEN_TOOLCHAIN "armv7hl-tizen-linux-gnueabihf/9.2.0")
+ endif()
elseif(TARGET_ARCH_NAME STREQUAL "arm64")
set(CMAKE_SYSTEM_PROCESSOR aarch64)
if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/aarch64-alpine-linux-musl)
@@ -66,6 +69,10 @@ endif()
# Specify include paths
if(TIZEN)
+ if(TARGET_ARCH_NAME STREQUAL "arm")
+ include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/)
+ include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/armv7hl-tizen-linux-gnueabihf)
+ endif()
if(TARGET_ARCH_NAME STREQUAL "armel")
include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/)
include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/armv7l-tizen-linux-gnueabi)
@@ -160,7 +167,7 @@ if(LINUX)
add_toolchain_linker_flag("-Wl,--rpath-link=${CROSS_ROOTFS}/usr/lib/${TOOLCHAIN}")
endif()
-if(TARGET_ARCH_NAME STREQUAL "armel")
+if(TARGET_ARCH_NAME MATCHES "^(arm|armel)$")
if(TIZEN)
add_toolchain_linker_flag("-B${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}")
add_toolchain_linker_flag("-L${CROSS_ROOTFS}/lib")
@@ -215,7 +222,7 @@ elseif(TARGET_ARCH_NAME STREQUAL "x86")
endif()
if(TIZEN)
- if(TARGET_ARCH_NAME MATCHES "^(armel|arm64)$")
+ if(TARGET_ARCH_NAME MATCHES "^(arm|armel|arm64)$")
add_compile_options(-Wno-deprecated-declarations) # compile-time option
add_compile_options(-D__extern_always_inline=inline) # compile-time option
endif()
diff --git a/eng/common/generate-graph-files.ps1 b/eng/common/generate-graph-files.ps1
deleted file mode 100644
index 0728b1a8b570d6..00000000000000
--- a/eng/common/generate-graph-files.ps1
+++ /dev/null
@@ -1,86 +0,0 @@
-Param(
- [Parameter(Mandatory=$true)][string] $barToken, # Token generated at https://maestro-prod.westus2.cloudapp.azure.com/Account/Tokens
- [Parameter(Mandatory=$true)][string] $gitHubPat, # GitHub personal access token from https://github.com/settings/tokens (no auth scopes needed)
- [Parameter(Mandatory=$true)][string] $azdoPat, # Azure Dev Ops tokens from https://dev.azure.com/dnceng/_details/security/tokens (code read scope needed)
- [Parameter(Mandatory=$true)][string] $outputFolder, # Where the graphviz.txt file will be created
- [string] $darcVersion, # darc's version
- [string] $graphvizVersion = '2.38', # GraphViz version
- [switch] $includeToolset # Whether the graph should include toolset dependencies or not. i.e. arcade, optimization. For more about
- # toolset dependencies see https://github.com/dotnet/arcade/blob/master/Documentation/Darc.md#toolset-vs-product-dependencies
-)
-
-function CheckExitCode ([string]$stage)
-{
- $exitCode = $LASTEXITCODE
- if ($exitCode -ne 0) {
- Write-PipelineTelemetryError -Category 'Arcade' -Message "Something failed in stage: '$stage'. Check for errors above. Exiting now..."
- ExitWithExitCode $exitCode
- }
-}
-
-try {
- $ErrorActionPreference = 'Stop'
- . $PSScriptRoot\tools.ps1
-
- Import-Module -Name (Join-Path $PSScriptRoot 'native\CommonLibrary.psm1')
-
- Push-Location $PSScriptRoot
-
- Write-Host 'Installing darc...'
- . .\darc-init.ps1 -darcVersion $darcVersion
- CheckExitCode 'Running darc-init'
-
- $engCommonBaseDir = Join-Path $PSScriptRoot 'native\'
- $graphvizInstallDir = CommonLibrary\Get-NativeInstallDirectory
- $nativeToolBaseUri = 'https://netcorenativeassets.blob.core.windows.net/resource-packages/external'
- $installBin = Join-Path $graphvizInstallDir 'bin'
-
- Write-Host 'Installing dot...'
- .\native\install-tool.ps1 -ToolName graphviz -InstallPath $installBin -BaseUri $nativeToolBaseUri -CommonLibraryDirectory $engCommonBaseDir -Version $graphvizVersion -Verbose
-
- $darcExe = "$env:USERPROFILE\.dotnet\tools"
- $darcExe = Resolve-Path "$darcExe\darc.exe"
-
- Create-Directory $outputFolder
-
- # Generate 3 graph descriptions:
- # 1. Flat with coherency information
- # 2. Graphviz (dot) file
- # 3. Standard dependency graph
- $graphVizFilePath = "$outputFolder\graphviz.txt"
- $graphVizImageFilePath = "$outputFolder\graph.png"
- $normalGraphFilePath = "$outputFolder\graph-full.txt"
- $flatGraphFilePath = "$outputFolder\graph-flat.txt"
- $baseOptions = @( '--github-pat', "$gitHubPat", '--azdev-pat', "$azdoPat", '--password', "$barToken" )
-
- if ($includeToolset) {
- Write-Host 'Toolsets will be included in the graph...'
- $baseOptions += @( '--include-toolset' )
- }
-
- Write-Host 'Generating standard dependency graph...'
- & "$darcExe" get-dependency-graph @baseOptions --output-file $normalGraphFilePath
- CheckExitCode 'Generating normal dependency graph'
-
- Write-Host 'Generating flat dependency graph and graphviz file...'
- & "$darcExe" get-dependency-graph @baseOptions --flat --coherency --graphviz $graphVizFilePath --output-file $flatGraphFilePath
- CheckExitCode 'Generating flat and graphviz dependency graph'
-
- Write-Host "Generating graph image $graphVizFilePath"
- $dotFilePath = Join-Path $installBin "graphviz\$graphvizVersion\release\bin\dot.exe"
- & "$dotFilePath" -Tpng -o"$graphVizImageFilePath" "$graphVizFilePath"
- CheckExitCode 'Generating graphviz image'
-
- Write-Host "'$graphVizFilePath', '$flatGraphFilePath', '$normalGraphFilePath' and '$graphVizImageFilePath' created!"
-}
-catch {
- if (!$includeToolset) {
- Write-Host 'This might be a toolset repo which includes only toolset dependencies. ' -NoNewline -ForegroundColor Yellow
- Write-Host 'Since -includeToolset is not set there is no graph to create. Include -includeToolset and try again...' -ForegroundColor Yellow
- }
- Write-Host $_.ScriptStackTrace
- Write-PipelineTelemetryError -Category 'Arcade' -Message $_
- ExitWithExitCode 1
-} finally {
- Pop-Location
-}
\ No newline at end of file
diff --git a/eng/common/sdl/configure-sdl-tool.ps1 b/eng/common/sdl/configure-sdl-tool.ps1
index 8a68fc24b11b0d..bdbf49e6c71de8 100644
--- a/eng/common/sdl/configure-sdl-tool.ps1
+++ b/eng/common/sdl/configure-sdl-tool.ps1
@@ -15,7 +15,9 @@ Param(
# Optional: Additional params to add to any tool using CredScan.
[string[]] $CrScanAdditionalRunConfigParams,
# Optional: Additional params to add to any tool using PoliCheck.
- [string[]] $PoliCheckAdditionalRunConfigParams
+ [string[]] $PoliCheckAdditionalRunConfigParams,
+ # Optional: Additional params to add to any tool using CodeQL/Semmle.
+ [string[]] $CodeQLAdditionalRunConfigParams
)
$ErrorActionPreference = 'Stop'
@@ -78,6 +80,11 @@ try {
$tool.Args += "`"Target < $TargetDirectory`""
}
$tool.Args += $PoliCheckAdditionalRunConfigParams
+ } elseif ($tool.Name -eq 'semmle' -or $tool.Name -eq 'codeql') {
+ if ($targetDirectory) {
+ $tool.Args += "`"SourceCodeDirectory < $TargetDirectory`""
+ }
+ $tool.Args += $CodeQLAdditionalRunConfigParams
}
# Create variable pointing to the args array directly so we can use splat syntax later.
diff --git a/eng/common/sdl/execute-all-sdl-tools.ps1 b/eng/common/sdl/execute-all-sdl-tools.ps1
index e5bef8ebd3a3b4..4797e012c7d2f7 100644
--- a/eng/common/sdl/execute-all-sdl-tools.ps1
+++ b/eng/common/sdl/execute-all-sdl-tools.ps1
@@ -34,6 +34,7 @@ Param(
[string] $GuardianLoggerLevel='Standard', # Optional: the logger level for the Guardian CLI; options are Trace, Verbose, Standard, Warning, and Error
[string[]] $CrScanAdditionalRunConfigParams, # Optional: Additional Params to custom build a CredScan run config in the format @("xyz:abc","sdf:1")
[string[]] $PoliCheckAdditionalRunConfigParams, # Optional: Additional Params to custom build a Policheck run config in the format @("xyz:abc","sdf:1")
+ [string[]] $CodeQLAdditionalRunConfigParams, # Optional: Additional Params to custom build a Semmle/CodeQL run config in the format @("xyz < abc","sdf < 1")
[bool] $BreakOnFailure=$False # Optional: Fail the build if there were errors during the run
)
@@ -105,7 +106,8 @@ try {
-AzureDevOpsAccessToken $AzureDevOpsAccessToken `
-GuardianLoggerLevel $GuardianLoggerLevel `
-CrScanAdditionalRunConfigParams $CrScanAdditionalRunConfigParams `
- -PoliCheckAdditionalRunConfigParams $PoliCheckAdditionalRunConfigParams
+ -PoliCheckAdditionalRunConfigParams $PoliCheckAdditionalRunConfigParams `
+ -CodeQLAdditionalRunConfigParams $CodeQLAdditionalRunConfigParams
if ($BreakOnFailure) {
Exit-IfNZEC "Sdl"
}
diff --git a/eng/common/templates/job/generate-graph-files.yml b/eng/common/templates/job/generate-graph-files.yml
deleted file mode 100644
index e54ce956f9088e..00000000000000
--- a/eng/common/templates/job/generate-graph-files.yml
+++ /dev/null
@@ -1,48 +0,0 @@
-parameters:
- # Optional: dependencies of the job
- dependsOn: ''
-
- # Optional: A defined YAML pool - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#pool
- pool: {}
-
- # Optional: Include toolset dependencies in the generated graph files
- includeToolset: false
-
-jobs:
-- job: Generate_Graph_Files
-
- dependsOn: ${{ parameters.dependsOn }}
-
- displayName: Generate Graph Files
-
- pool: ${{ parameters.pool }}
-
- variables:
- # Publish-Build-Assets provides: MaestroAccessToken, BotAccount-dotnet-maestro-bot-PAT
- # DotNet-AllOrgs-Darc-Pats provides: dn-bot-devdiv-dnceng-rw-code-pat
- - group: Publish-Build-Assets
- - group: DotNet-AllOrgs-Darc-Pats
- - name: _GraphArguments
- value: -gitHubPat $(BotAccount-dotnet-maestro-bot-PAT)
- -azdoPat $(dn-bot-devdiv-dnceng-rw-code-pat)
- -barToken $(MaestroAccessToken)
- -outputFolder '$(Build.StagingDirectory)/GraphFiles/'
- - ${{ if ne(parameters.includeToolset, 'false') }}:
- - name: _GraphArguments
- value: ${{ variables._GraphArguments }} -includeToolset
-
- steps:
- - task: PowerShell@2
- displayName: Generate Graph Files
- inputs:
- filePath: eng\common\generate-graph-files.ps1
- arguments: $(_GraphArguments)
- continueOnError: true
- - task: PublishBuildArtifacts@1
- displayName: Publish Graph to Artifacts
- inputs:
- PathtoPublish: '$(Build.StagingDirectory)/GraphFiles'
- PublishLocation: Container
- ArtifactName: GraphFiles
- continueOnError: true
- condition: always()
diff --git a/eng/common/templates/jobs/codeql-build.yml b/eng/common/templates/jobs/codeql-build.yml
new file mode 100644
index 00000000000000..f7dc5ea4aaa63c
--- /dev/null
+++ b/eng/common/templates/jobs/codeql-build.yml
@@ -0,0 +1,31 @@
+parameters:
+ # See schema documentation in /Documentation/AzureDevOps/TemplateSchema.md
+ continueOnError: false
+ # Required: A collection of jobs to run - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#job
+ jobs: []
+ # Optional: if specified, restore and use this version of Guardian instead of the default.
+ overrideGuardianVersion: ''
+
+jobs:
+- template: /eng/common/templates/jobs/jobs.yml
+ parameters:
+ enableMicrobuild: false
+ enablePublishBuildArtifacts: false
+ enablePublishTestResults: false
+ enablePublishBuildAssets: false
+ enablePublishUsingPipelines: false
+ enableTelemetry: true
+
+ variables:
+ - group: Publish-Build-Assets
+ # The Guardian version specified in 'eng/common/sdl/packages.config'. This value must be kept in
+ # sync with the packages.config file.
+ - name: DefaultGuardianVersion
+ value: 0.109.0
+ - name: GuardianPackagesConfigFile
+ value: $(Build.SourcesDirectory)\eng\common\sdl\packages.config
+ - name: GuardianVersion
+ value: ${{ coalesce(parameters.overrideGuardianVersion, '$(DefaultGuardianVersion)') }}
+
+ jobs: ${{ parameters.jobs }}
+
diff --git a/eng/common/templates/jobs/jobs.yml b/eng/common/templates/jobs/jobs.yml
index 8dd1fdbd144a06..ff4ab75c886dc7 100644
--- a/eng/common/templates/jobs/jobs.yml
+++ b/eng/common/templates/jobs/jobs.yml
@@ -87,13 +87,3 @@ jobs:
runAsPublic: ${{ parameters.runAsPublic }}
publishUsingPipelines: ${{ parameters.enablePublishUsingPipelines }}
enablePublishBuildArtifacts: ${{ parameters.enablePublishBuildArtifacts }}
-
- - ${{ if eq(parameters.graphFileGeneration.enabled, true) }}:
- - template: ../job/generate-graph-files.yml
- parameters:
- continueOnError: ${{ parameters.continueOnError }}
- includeToolset: ${{ parameters.graphFileGeneration.includeToolset }}
- dependsOn:
- - Asset_Registry_Publish
- pool:
- vmImage: 'windows-2019'
diff --git a/eng/common/templates/steps/execute-codeql.yml b/eng/common/templates/steps/execute-codeql.yml
new file mode 100644
index 00000000000000..3930b1630214b3
--- /dev/null
+++ b/eng/common/templates/steps/execute-codeql.yml
@@ -0,0 +1,32 @@
+parameters:
+ # Language that should be analyzed. Defaults to csharp
+ language: csharp
+ # Build Commands
+ buildCommands: ''
+ overrideParameters: '' # Optional: to override values for parameters.
+ additionalParameters: '' # Optional: parameters that need user specific values eg: '-SourceToolsList @("abc","def") -ArtifactToolsList @("ghi","jkl")'
+ # Optional: if specified, restore and use this version of Guardian instead of the default.
+ overrideGuardianVersion: ''
+ # Optional: if true, publish the '.gdn' folder as a pipeline artifact. This can help with in-depth
+ # diagnosis of problems with specific tool configurations.
+ publishGuardianDirectoryToPipeline: false
+ # The script to run to execute all SDL tools. Use this if you want to use a script to define SDL
+ # parameters rather than relying on YAML. It may be better to use a local script, because you can
+ # reproduce results locally without piecing together a command based on the YAML.
+ executeAllSdlToolsScript: 'eng/common/sdl/execute-all-sdl-tools.ps1'
+ # There is some sort of bug (has been reported) in Azure DevOps where if this parameter is named
+ # 'continueOnError', the parameter value is not correctly picked up.
+ # This can also be remedied by the caller (post-build.yml) if it does not use a nested parameter
+ # optional: determines whether to continue the build if the step errors;
+ sdlContinueOnError: false
+
+steps:
+- template: /eng/common/templates/steps/execute-sdl.yml
+ parameters:
+ overrideGuardianVersion: ${{ parameters.overrideGuardianVersion }}
+ executeAllSdlToolsScript: ${{ parameters.executeAllSdlToolsScript }}
+ overrideParameters: ${{ parameters.overrideParameters }}
+ additionalParameters: '${{ parameters.additionalParameters }}
+ -CodeQLAdditionalRunConfigParams @("BuildCommands < ${{ parameters.buildCommands }}", "Language < ${{ parameters.language }}")'
+ publishGuardianDirectoryToPipeline: ${{ parameters.publishGuardianDirectoryToPipeline }}
+ sdlContinueOnError: ${{ parameters.sdlContinueOnError }}
\ No newline at end of file
diff --git a/eng/generators.targets b/eng/generators.targets
index 4c32554b5e2195..843842937ef3f7 100644
--- a/eng/generators.targets
+++ b/eng/generators.targets
@@ -84,10 +84,6 @@
true$(DefineConstants);DLLIMPORTGENERATOR_INTERNALUNSAFE
-
-
- $(DefineConstants);DLLIMPORTGENERATOR_ENABLED
-
diff --git a/eng/native/build-commons.sh b/eng/native/build-commons.sh
index 8f1a746752a347..373091b13a0014 100755
--- a/eng/native/build-commons.sh
+++ b/eng/native/build-commons.sh
@@ -197,7 +197,7 @@ usage()
echo ""
echo "Common Options:"
echo ""
- echo "BuildArch can be: -arm, -armel, -arm64, -s390x, x64, x86, -wasm"
+ echo "BuildArch can be: -arm, -armel, -arm64, -loongarch64, -s390x, x64, x86, -wasm"
echo "BuildType can be: -debug, -checked, -release"
echo "-os: target OS (defaults to running OS)"
echo "-bindir: output directory (defaults to $__ProjectRoot/artifacts)"
@@ -377,6 +377,10 @@ while :; do
__BuildArch=x64
;;
+ loongarch64|-loongarch64)
+ __BuildArch=loongarch64
+ ;;
+
s390x|-s390x)
__BuildArch=s390x
;;
diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake
index 5a20591cc025bb..fad1ac58d39c88 100644
--- a/eng/native/configurecompiler.cmake
+++ b/eng/native/configurecompiler.cmake
@@ -216,6 +216,9 @@ elseif (CLR_CMAKE_HOST_ARCH_ARM)
elseif (CLR_CMAKE_HOST_ARCH_ARM64)
set(ARCH_HOST_NAME arm64)
add_definitions(-DHOST_ARM64 -DHOST_64BIT)
+elseif (CLR_CMAKE_HOST_ARCH_LOONGARCH64)
+ set(ARCH_HOST_NAME loongarch64)
+ add_definitions(-DHOST_LOONGARCH64 -DHOST_64BIT)
elseif (CLR_CMAKE_HOST_ARCH_S390X)
set(ARCH_HOST_NAME s390x)
add_definitions(-DHOST_S390X -DHOST_64BIT -DBIGENDIAN)
@@ -237,6 +240,8 @@ if (CLR_CMAKE_HOST_UNIX)
message("Detected Linux ARM")
elseif(CLR_CMAKE_HOST_UNIX_ARM64)
message("Detected Linux ARM64")
+ elseif(CLR_CMAKE_HOST_UNIX_LOONGARCH64)
+ message("Detected Linux LOONGARCH64")
elseif(CLR_CMAKE_HOST_UNIX_X86)
message("Detected Linux i686")
elseif(CLR_CMAKE_HOST_UNIX_S390X)
@@ -301,6 +306,11 @@ elseif (CLR_CMAKE_TARGET_ARCH_I386)
set(ARCH_SOURCES_DIR i386)
add_compile_definitions($<$>>:TARGET_X86>)
add_compile_definitions($<$>>:TARGET_32BIT>)
+elseif (CLR_CMAKE_TARGET_ARCH_LOONGARCH64)
+ set(ARCH_TARGET_NAME loongarch64)
+ set(ARCH_SOURCES_DIR loongarch64)
+ add_compile_definitions($<$>>:TARGET_LOONGARCH64>)
+ add_compile_definitions($<$>>:TARGET_64BIT>)
elseif (CLR_CMAKE_TARGET_ARCH_S390X)
set(ARCH_TARGET_NAME s390x)
set(ARCH_SOURCES_DIR s390x)
diff --git a/eng/native/configureplatform.cmake b/eng/native/configureplatform.cmake
index f5c8abe66991a0..cdf33430b49f11 100644
--- a/eng/native/configureplatform.cmake
+++ b/eng/native/configureplatform.cmake
@@ -43,6 +43,8 @@ if(CLR_CMAKE_HOST_OS STREQUAL Linux)
set(CLR_CMAKE_HOST_UNIX_ARM 1)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL arm64)
set(CLR_CMAKE_HOST_UNIX_ARM64 1)
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL loongarch64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL loongarch64)
+ set(CLR_CMAKE_HOST_UNIX_LOONGARCH64 1)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL i686 OR CMAKE_SYSTEM_PROCESSOR STREQUAL x86)
set(CLR_CMAKE_HOST_UNIX_X86 1)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL s390x)
@@ -218,6 +220,9 @@ if(CLR_CMAKE_HOST_UNIX_ARM)
elseif(CLR_CMAKE_HOST_UNIX_ARM64)
set(CLR_CMAKE_HOST_ARCH_ARM64 1)
set(CLR_CMAKE_HOST_ARCH "arm64")
+elseif(CLR_CMAKE_HOST_UNIX_LOONGARCH64)
+ set(CLR_CMAKE_HOST_ARCH_LOONGARCH64 1)
+ set(CLR_CMAKE_HOST_ARCH "loongarch64")
elseif(CLR_CMAKE_HOST_UNIX_AMD64)
set(CLR_CMAKE_HOST_ARCH_AMD64 1)
set(CLR_CMAKE_HOST_ARCH "x64")
@@ -268,6 +273,8 @@ if (CLR_CMAKE_TARGET_ARCH STREQUAL x64)
set(CLR_CMAKE_TARGET_ARCH_I386 1)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL arm64)
set(CLR_CMAKE_TARGET_ARCH_ARM64 1)
+ elseif(CLR_CMAKE_TARGET_ARCH STREQUAL loongarch64)
+ set(CLR_CMAKE_TARGET_ARCH_LOONGARCH64 1)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL arm)
set(CLR_CMAKE_TARGET_ARCH_ARM 1)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL armel)
@@ -374,6 +381,8 @@ if(CLR_CMAKE_TARGET_UNIX)
set(CLR_CMAKE_TARGET_UNIX_ARM 1)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL arm64)
set(CLR_CMAKE_TARGET_UNIX_ARM64 1)
+ elseif(CLR_CMAKE_TARGET_ARCH STREQUAL loongarch64)
+ set(CLR_CMAKE_TARGET_UNIX_LOONGARCH64 1)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL x86)
set(CLR_CMAKE_TARGET_UNIX_X86 1)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL s390x)
diff --git a/eng/native/functions.cmake b/eng/native/functions.cmake
index 87b4d15734bf69..4e68a9be01e8c9 100644
--- a/eng/native/functions.cmake
+++ b/eng/native/functions.cmake
@@ -4,7 +4,7 @@ function(clr_unknown_arch)
elseif(CLR_CROSS_COMPONENTS_BUILD)
message(FATAL_ERROR "Only AMD64, I386 host are supported for linux cross-architecture component. Found: ${CMAKE_SYSTEM_PROCESSOR}")
else()
- message(FATAL_ERROR "Only AMD64, ARM64 and ARM are supported. Found: ${CMAKE_SYSTEM_PROCESSOR}")
+ message(FATAL_ERROR "Only AMD64, ARM64, LOONGARCH64 and ARM are supported. Found: ${CMAKE_SYSTEM_PROCESSOR}")
endif()
endfunction()
@@ -94,6 +94,10 @@ function(find_unwind_libs UnwindLibs)
find_library(UNWIND_ARCH NAMES unwind-aarch64)
endif()
+ if(CLR_CMAKE_HOST_ARCH_LOONGARCH64)
+ find_library(UNWIND_ARCH NAMES unwind-loongarch64)
+ endif()
+
if(CLR_CMAKE_HOST_ARCH_AMD64)
find_library(UNWIND_ARCH NAMES unwind-x86_64)
endif()
diff --git a/eng/native/init-os-and-arch.sh b/eng/native/init-os-and-arch.sh
index fc4078fa3a9aa4..586534be1c8aa9 100644
--- a/eng/native/init-os-and-arch.sh
+++ b/eng/native/init-os-and-arch.sh
@@ -37,6 +37,10 @@ case "$CPUName" in
arch=arm64
;;
+ loongarch64)
+ arch=loongarch64
+ ;;
+
amd64|x86_64)
arch=x64
;;
diff --git a/eng/native/tryrun.cmake b/eng/native/tryrun.cmake
index 96199969da69c9..e8a04c5698ad35 100644
--- a/eng/native/tryrun.cmake
+++ b/eng/native/tryrun.cmake
@@ -68,7 +68,7 @@ if(DARWIN)
else()
message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only arm64 or x64 is supported for OSX cross build!")
endif()
-elseif(TARGET_ARCH_NAME MATCHES "^(armel|arm|arm64|s390x|x86)$" OR FREEBSD OR ILLUMOS)
+elseif(TARGET_ARCH_NAME MATCHES "^(armel|arm|arm64|loongarch64|s390x|x86)$" OR FREEBSD OR ILLUMOS)
set_cache_value(FILE_OPS_CHECK_FERROR_OF_PREVIOUS_CALL_EXITCODE 1)
set_cache_value(GETPWUID_R_SETS_ERRNO_EXITCODE 0)
set_cache_value(HAS_POSIX_SEMAPHORES_EXITCODE 0)
@@ -146,9 +146,9 @@ elseif(TARGET_ARCH_NAME MATCHES "^(armel|arm|arm64|s390x|x86)$" OR FREEBSD OR IL
set_cache_value(HAVE_FUNCTIONAL_PTHREAD_ROBUST_MUTEXES_EXITCODE 0)
endif()
else()
- message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, arm64, s390x and x86 are supported!")
+ message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, arm64, loongarch64, s390x and x86 are supported!")
endif()
-if(TARGET_ARCH_NAME STREQUAL "x86" OR TARGET_ARCH_NAME STREQUAL "s390x")
+if(TARGET_ARCH_NAME STREQUAL "x86" OR TARGET_ARCH_NAME STREQUAL "s390x" OR TARGET_ARCH_NAME STREQUAL "loongarch64")
set_cache_value(HAVE_FUNCTIONAL_PTHREAD_ROBUST_MUTEXES_EXITCODE 0)
endif()
diff --git a/eng/packaging.targets b/eng/packaging.targets
index 6d2bbce10da346..667837fbff1067 100644
--- a/eng/packaging.targets
+++ b/eng/packaging.targets
@@ -23,6 +23,10 @@
'$(PreReleaseVersionLabel)' != 'servicing' and
'$(GitHubRepositoryName)' != 'runtimelab'">true
false
+
+ true$(XmlDocFileRoot)1033\$(AssemblyName).xmltrue
@@ -259,7 +263,7 @@
diff --git a/eng/pipelines/coreclr/perf_slow.yml b/eng/pipelines/coreclr/perf_slow.yml
index e8410af6d361f9..04994eac96a44b 100644
--- a/eng/pipelines/coreclr/perf_slow.yml
+++ b/eng/pipelines/coreclr/perf_slow.yml
@@ -137,10 +137,11 @@ jobs:
buildConfig: release
container: ubuntu-18.04-cross-arm64-20211022152824-b2c2436
runtimeFlavor: mono
+ runtimeVariant: 'llvmaot'
platforms:
- Linux_arm64
jobParameters:
- buildArgs: -s mono+libs+host+packs -c $(_BuildConfig)
+ buildArgs: -s mono+libs+host+packs -c $(_BuildConfig) /p:MonoEnableLLVM=true /p:MonoBundleLLVMOptimizer=true
nameSuffix: AOT
isOfficialBuild: false
extraStepsTemplate: /eng/pipelines/common/upload-artifact-step.yml
diff --git a/eng/pipelines/coreclr/superpmi-collect.yml b/eng/pipelines/coreclr/superpmi-collect.yml
index 0d41f151d6b554..8918ee8cbfcd39 100644
--- a/eng/pipelines/coreclr/superpmi-collect.yml
+++ b/eng/pipelines/coreclr/superpmi-collect.yml
@@ -30,8 +30,7 @@ jobs:
jobTemplate: /eng/pipelines/common/build-coreclr-and-libraries-job.yml
buildConfig: checked
platforms:
- # Linux tests are built on the OSX machines.
- # - OSX_x64
+ - OSX_arm64
- Linux_arm
- Linux_arm64
- Linux_x64
@@ -46,6 +45,16 @@ jobs:
- Linux_x64
- windows_x64
+# superpmi-collect-job that targets macOS/arm64 depends on coreclr binaries produced by the macOS/x64 job
+- template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/coreclr/templates/build-job.yml
+ buildConfig: checked
+ platforms:
+ - OSX_x64
+ jobParameters:
+ testGroup: outerloop
+
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/templates/runtimes/build-test-job.yml
@@ -62,6 +71,7 @@ jobs:
platforms:
# Linux tests are built on the OSX machines.
# - OSX_x64
+ - OSX_arm64
- Linux_arm
- Linux_arm64
- Linux_x64
@@ -83,6 +93,7 @@ jobs:
platforms:
# Linux tests are built on the OSX machines.
# - OSX_x64
+ - OSX_arm64
- Linux_arm
- Linux_arm64
- Linux_x64
@@ -105,6 +116,7 @@ jobs:
platforms:
# Linux tests are built on the OSX machines.
# - OSX_x64
+ - OSX_arm64
- Linux_arm
- Linux_arm64
- Linux_x64
@@ -127,6 +139,7 @@ jobs:
platforms:
# Linux tests are built on the OSX machines.
# - OSX_x64
+ - OSX_arm64
- Linux_arm
- Linux_arm64
- Linux_x64
@@ -148,6 +161,7 @@ jobs:
platforms:
# Linux tests are built on the OSX machines.
# - OSX_x64
+ - OSX_arm64
#TODO: Need special handling of running "benchmark build" from inside TMP folder on helix machine.
# - Linux_arm
# - Linux_arm64
diff --git a/eng/pipelines/coreclr/templates/run-superpmi-collect-job.yml b/eng/pipelines/coreclr/templates/run-superpmi-collect-job.yml
index 1ac235f6f6d08e..be05b52b6b1859 100644
--- a/eng/pipelines/coreclr/templates/run-superpmi-collect-job.yml
+++ b/eng/pipelines/coreclr/templates/run-superpmi-collect-job.yml
@@ -106,7 +106,7 @@ jobs:
steps:
- ${{ parameters.steps }}
- - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi_collect_setup.py -source_directory $(Build.SourcesDirectory) -core_root_directory $(Core_Root_Dir) -arch $(archType) -mch_file_tag $(MchFileTag) -input_directory $(InputDirectory) -collection_name $(CollectionName) -collection_type $(CollectionType) -max_size 50 # size in MB
+ - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi_collect_setup.py -source_directory $(Build.SourcesDirectory) -core_root_directory $(Core_Root_Dir) -arch $(archType) -platform $(osGroup) -mch_file_tag $(MchFileTag) -input_directory $(InputDirectory) -collection_name $(CollectionName) -collection_type $(CollectionType) -max_size 50 # size in MB
displayName: ${{ format('SuperPMI setup ({0})', parameters.osGroup) }}
# Create required directories for merged mch collection and superpmi logs
@@ -159,6 +159,10 @@ jobs:
artifactName: 'SuperPMI_Collection_$(CollectionName)_$(CollectionType)_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)'
displayName: ${{ format('Upload artifacts SuperPMI {0}-{1} collection', parameters.collectionName, parameters.collectionType) }}
+ # Ensure the Python azure-storage-blob package is installed before doing the upload.
+ - script: $(PipScript) install --user --upgrade pip && $(PipScript) install --user azure.storage.blob==12.5.0 --force-reinstall
+ displayName: Upgrade Pip to latest and install azure-storage-blob Python package
+
- script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi.py upload -log_level DEBUG -arch $(archType) -build_type $(buildConfig) -mch_files $(MergedMchFileLocation)$(CollectionName).$(CollectionType).$(MchFileTag).mch -core_root $(Build.SourcesDirectory)/artifacts/bin/coreclr/$(osGroup).x64.$(buildConfigUpper)
displayName: ${{ format('Upload SuperPMI {0}-{1} collection to Azure Storage', parameters.collectionName, parameters.collectionType) }}
env:
diff --git a/eng/pipelines/coreclr/templates/superpmi-collect-job.yml b/eng/pipelines/coreclr/templates/superpmi-collect-job.yml
index 6c990a25ff4aa3..652d17af08eba5 100644
--- a/eng/pipelines/coreclr/templates/superpmi-collect-job.yml
+++ b/eng/pipelines/coreclr/templates/superpmi-collect-job.yml
@@ -84,8 +84,8 @@ jobs:
- template: /eng/pipelines/common/download-artifact-step.yml
parameters:
unpackFolder: '$(Build.SourcesDirectory)/artifacts/tests/libraries_zipped/$(osGroup).$(archType).$(buildConfigUpper)'
- artifactFileName: 'libraries_test_assets_${{ parameters.osGroup }}_x64_Release$(archiveExtension)'
- artifactName: ${{ format('libraries_test_assets_{0}_x64_Release', parameters.osGroup) }}
+ artifactFileName: 'libraries_test_assets_${{ parameters.osGroup }}_$(archType)_Release$(archiveExtension)'
+ artifactName: ${{ format('libraries_test_assets_{0}_$(archType)_Release', parameters.osGroup) }}
displayName: 'generic libraries test artifacts'
# Unzip individual test projects
diff --git a/eng/pipelines/runtime-manual.yml b/eng/pipelines/runtime-manual.yml
index a4391cff70da59..d6182de37f3bed 100644
--- a/eng/pipelines/runtime-manual.yml
+++ b/eng/pipelines/runtime-manual.yml
@@ -488,9 +488,7 @@ jobs:
timeoutInMinutes: 180
condition: >-
or(
- eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
- eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
- eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true),
+ eq(variables['isManualOrIsNotPR'], true),
eq(variables['isFullMatrix'], true))
# extra steps, run tests
extraStepsTemplate: /eng/pipelines/libraries/helix.yml
@@ -498,6 +496,8 @@ jobs:
creator: dotnet-bot
testRunNamePrefixSuffix: Mono_$(_BuildConfig)
scenarios:
+ - normal
+ - WasmTestOnBrowser
- WasmTestOnNodeJs
condition: >-
or(
diff --git a/eng/run-test.sh b/eng/run-test.sh
index 64474cc435af16..0475cff40cd839 100644
--- a/eng/run-test.sh
+++ b/eng/run-test.sh
@@ -31,7 +31,7 @@ usage()
echo " default: Debug"
echo " --os OS to run (FreeBSD, Linux, NetBSD, illumos or Solaris)"
echo " default: detect current OS"
- echo " --arch Architecture to run (x64, arm, armel, x86, arm64)"
+ echo " --arch Architecture to run (x64, arm, armel, x86, arm64, loongarch64)"
echo " default: detect current architecture"
echo
echo "Execution options:"
diff --git a/eng/targetingpacks.targets b/eng/targetingpacks.targets
index 9dd37bef8fa1c3..4213c84e709d9c 100644
--- a/eng/targetingpacks.targets
+++ b/eng/targetingpacks.targets
@@ -33,7 +33,7 @@
LatestRuntimeFrameworkVersion="$(ProductVersion)"
RuntimeFrameworkName="$(LocalFrameworkOverrideName)"
RuntimePackNamePatterns="$(LocalFrameworkOverrideName).Runtime.**RID**"
- RuntimePackRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;maccatalyst-x64;maccatalyst-arm64"
+ RuntimePackRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-loongarch64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;maccatalyst-x64;maccatalyst-arm64"
TargetFramework="$(NetCoreAppCurrent)"
TargetingPackName="$(LocalFrameworkOverrideName).Ref"
TargetingPackVersion="$(ProductVersion)"
@@ -43,13 +43,13 @@
RuntimeFrameworkName="$(LocalFrameworkOverrideName)"
LatestRuntimeFrameworkVersion="$(ProductVersion)"
RuntimePackNamePatterns="$(LocalFrameworkOverrideName).Runtime.Mono.**RID**"
- RuntimePackRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;maccatalyst-x64;maccatalyst-arm64;browser-wasm;ios-arm64;ios-arm;iossimulator-arm64;iossimulator-x64;iossimulator-x86;tvos-arm64;tvossimulator-arm64;tvossimulator-x64;android-arm64;android-arm;android-x64;android-x86"
+ RuntimePackRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-loongarch64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;maccatalyst-x64;maccatalyst-arm64;browser-wasm;ios-arm64;ios-arm;iossimulator-arm64;iossimulator-x64;iossimulator-x86;tvos-arm64;tvossimulator-arm64;tvossimulator-x64;android-arm64;android-arm;android-x64;android-x86"
RuntimePackLabels="Mono"
Condition="'@(KnownRuntimePack)' == '' or !@(KnownRuntimePack->AnyHaveMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))"/>
-
@@ -169,6 +168,7 @@
+
diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets
index 192363c4b170a1..da8da1d2f4bfa9 100644
--- a/eng/testing/tests.mobile.targets
+++ b/eng/testing/tests.mobile.targets
@@ -198,7 +198,8 @@
+ AfterTargets="ComputeResolvedFilesToPublishList"
+ Condition="'$(TestFramework)' == 'xunit'">
<_runnerFilesToPublish Include="$(AndroidTestRunnerDir)*" Condition="'$(TargetOS)' == 'Android'" />
<_runnerFilesToPublish Include="$(AppleTestRunnerDir)*" Condition="'$(TargetOS)' == 'MacCatalyst' or '$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'iOSSimulator' or '$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'tvOSSimulator'" />
diff --git a/eng/testing/tests.props b/eng/testing/tests.props
index a6a9034a8099d2..86c661d4bb2813 100644
--- a/eng/testing/tests.props
+++ b/eng/testing/tests.props
@@ -38,6 +38,10 @@
+
+
+
+
$(RunTestsCommand) --runtime-path "$(NetCoreAppCurrentTestHostPath.TrimEnd('\/'))"$(RunTestsCommand) --rsp-file "$(TestRspFile)"
- "$(RunScriptOutputPath)" $(AssemblyName) $(TargetArchitecture) $(TargetOS.ToLowerInvariant()) $(TestProjectName) $(AdditionalXHarnessArguments)
+
+
+
+ "$(RunScriptOutputPath)" $(AssemblyName) $(TargetArchitecture) $(TargetOS.ToLowerInvariant()) $(TestProjectName)
+ $(RunTestsCommand) $(Configuration) $(AdditionalXHarnessArguments)
+ $(RunTestsCommand) $(AdditionalXHarnessArguments)"$(RunScriptOutputPath)" $(JSEngine) $(AssemblyName).dll $(Scenario)
diff --git a/eng/testing/tests.wasm.targets b/eng/testing/tests.wasm.targets
index 273ab76ef90a3f..191d2c2295690f 100644
--- a/eng/testing/tests.wasm.targets
+++ b/eng/testing/tests.wasm.targets
@@ -47,7 +47,8 @@
<_XHarnessArgs Condition="'$(IsFunctionalTest)' == 'true'" >$(_XHarnessArgs) --expected-exit-code=$(ExpectedExitCode)
<_XHarnessArgs Condition="'$(WasmXHarnessArgs)' != ''" >$(_XHarnessArgs) $(WasmXHarnessArgs)
- <_AppArgs Condition="'$(IsFunctionalTest)' != 'true' and '$(Scenario)' != 'BuildWasmApps'">--run WasmTestRunner.dll $(AssemblyName).dll
+ <_AppArgs Condition="'$(IsFunctionalTest)' != 'true' and '$(Scenario)' != 'BuildWasmApps' and '$(WasmMainAssemblyFileName)' == ''">--run WasmTestRunner.dll $(AssemblyName).dll
+ <_AppArgs Condition="'$(IsFunctionalTest)' != 'true' and '$(WasmMainAssemblyFileName)' != ''">--run $(WasmMainAssemblyFileName)
<_AppArgs Condition="'$(IsFunctionalTest)' == 'true'">--run $(AssemblyName).dll
<_AppArgs Condition="'$(WasmTestAppArgs)' != ''">$(_AppArgs) $(WasmTestAppArgs)
diff --git a/global.json b/global.json
index e2c9f881274f55..f191cfdd2e3525 100644
--- a/global.json
+++ b/global.json
@@ -12,12 +12,12 @@
"python3": "3.7.1"
},
"msbuild-sdks": {
- "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "7.0.0-beta.21621.3",
- "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.21621.3",
- "Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.21621.3",
- "Microsoft.DotNet.SharedFramework.Sdk": "7.0.0-beta.21621.3",
+ "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "7.0.0-beta.22056.6",
+ "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22056.6",
+ "Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.22056.6",
+ "Microsoft.DotNet.SharedFramework.Sdk": "7.0.0-beta.22056.6",
"Microsoft.Build.NoTargets": "3.1.0",
"Microsoft.Build.Traversal": "3.0.23",
- "Microsoft.NET.Sdk.IL": "7.0.0-alpha.1.21620.1"
+ "Microsoft.NET.Sdk.IL": "7.0.0-alpha.1.22059.2"
}
}
diff --git a/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj
index f62c8b95b7c143..e1230d59401d86 100644
--- a/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj
+++ b/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj
@@ -78,6 +78,10 @@
AnyCPU$(DefineConstants);TARGET_ARM64
+
+ AnyCPU
+ $(DefineConstants);TARGET_LOONGARCH64
+
diff --git a/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs b/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs
index 240a78ecfdde75..977d73e5c3b990 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs
@@ -15,7 +15,7 @@
namespace System
{
[NonVersionable]
- public unsafe partial struct RuntimeTypeHandle : ISerializable
+ public unsafe partial struct RuntimeTypeHandle : IEquatable, ISerializable
{
// Returns handle for interop with EE. The handle is guaranteed to be non-null.
internal RuntimeTypeHandle GetNativeHandle()
@@ -814,7 +814,7 @@ RuntimeMethodHandleInternal Value
}
[NonVersionable]
- public unsafe partial struct RuntimeMethodHandle : ISerializable
+ public unsafe partial struct RuntimeMethodHandle : IEquatable, ISerializable
{
// Returns handle for interop with EE. The handle is guaranteed to be non-null.
internal static IRuntimeMethodInfo EnsureNonNullMethodInfo(IRuntimeMethodInfo method)
@@ -1139,7 +1139,7 @@ internal sealed class RuntimeFieldInfoStub : IRuntimeFieldInfo
}
[NonVersionable]
- public unsafe struct RuntimeFieldHandle : ISerializable
+ public unsafe struct RuntimeFieldHandle : IEquatable, ISerializable
{
// Returns handle for interop with EE. The handle is guaranteed to be non-null.
internal RuntimeFieldHandle GetNativeHandle()
diff --git a/src/coreclr/ToolBox/SOS/DacTableGen/diautil.cs b/src/coreclr/ToolBox/SOS/DacTableGen/diautil.cs
index 8da9217b477bc0..28af4119833668 100644
--- a/src/coreclr/ToolBox/SOS/DacTableGen/diautil.cs
+++ b/src/coreclr/ToolBox/SOS/DacTableGen/diautil.cs
@@ -619,7 +619,7 @@ private String GetTypeString(IDiaSymbol s)
else if (tag == SymTagEnum.SymTagBaseType)
{
BasicType bt = (BasicType) s.baseType;
- str.AppendFormat("(base type={0}, len={1:d})", bt.ToString(), s.length);
+ str.Append($"(base type={bt}, len={s.length:d})");
}
else if (tag == SymTagEnum.SymTagArrayType)
{
@@ -677,7 +677,7 @@ private String GetTypeString(IDiaSymbol s)
try
{
succ = true;
- str.AppendFormat("[{0:d}]", s.length/s.type.length );
+ str.Append($"[{s.length/s.type.length:d}]");
}
catch (Exception)
{
diff --git a/src/coreclr/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp b/src/coreclr/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp
index ad4830fa73b1ab..061d3d6a77b927 100644
--- a/src/coreclr/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp
+++ b/src/coreclr/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp
@@ -494,7 +494,7 @@ CORINFO_CLASS_HANDLE interceptor_ICJI::getTypeInstantiationArgument(CORINFO_CLAS
// If fFullInst=TRUE (regardless of fNamespace and fAssembly), include namespace and assembly for any type parameters
// If fAssembly=TRUE, suffix with a comma and the full assembly qualification
// return size of representation
-int interceptor_ICJI::appendClassName(__deref_inout_ecount(*pnBufLen) char16_t** ppBuf,
+int interceptor_ICJI::appendClassName(_Outptr_result_buffer_(*pnBufLen) char16_t** ppBuf,
int* pnBufLen,
CORINFO_CLASS_HANDLE cls,
bool fNamespace,
@@ -1257,7 +1257,7 @@ HRESULT interceptor_ICJI::GetErrorHRESULT(struct _EXCEPTION_POINTERS* pException
// Fetches the message of the current exception
// Returns the size of the message (including terminating null). This can be
// greater than bufferLength if the buffer is insufficient.
-uint32_t interceptor_ICJI::GetErrorMessage(__inout_ecount(bufferLength) char16_t *buffer, uint32_t bufferLength)
+uint32_t interceptor_ICJI::GetErrorMessage(_Inout_updates_(bufferLength) char16_t *buffer, uint32_t bufferLength)
{
mc->cr->AddCall("GetErrorMessage");
return original_ICorJitInfo->GetErrorMessage(buffer, bufferLength);
@@ -1367,7 +1367,7 @@ unsigned interceptor_ICJI::getMethodHash(CORINFO_METHOD_HANDLE ftn /* IN */
// this function is for debugging only.
size_t interceptor_ICJI::findNameOfToken(CORINFO_MODULE_HANDLE module, /* IN */
mdToken metaTOK, /* IN */
- __out_ecount(FQNameCapacity) char* szFQName, /* OUT */
+ _Out_writes_(FQNameCapacity) char* szFQName, /* OUT */
size_t FQNameCapacity /* IN */
)
{
@@ -1716,13 +1716,6 @@ uint32_t interceptor_ICJI::getFieldThreadLocalStoreID(CORINFO_FIELD_HANDLE field
return temp;
}
-// Sets another object to intercept calls to "self" and current method being compiled
-void interceptor_ICJI::setOverride(ICorDynamicInfo* pOverride, CORINFO_METHOD_HANDLE currentMethod)
-{
- mc->cr->AddCall("setOverride");
- original_ICorJitInfo->setOverride(pOverride, currentMethod);
-}
-
// Adds an active dependency from the context method's module to the given module
// This is internal callback for the EE. JIT should not call it directly.
void interceptor_ICJI::addActiveDependency(CORINFO_MODULE_HANDLE moduleFrom, CORINFO_MODULE_HANDLE moduleTo)
diff --git a/src/coreclr/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp b/src/coreclr/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp
index 88e0e03e42d989..657575cce71fe3 100644
--- a/src/coreclr/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp
+++ b/src/coreclr/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp
@@ -1184,14 +1184,6 @@ uint32_t interceptor_ICJI::getFieldThreadLocalStoreID(
return original_ICorJitInfo->getFieldThreadLocalStoreID(field, ppIndirection);
}
-void interceptor_ICJI::setOverride(
- ICorDynamicInfo* pOverride,
- CORINFO_METHOD_HANDLE currentMethod)
-{
- mcs->AddCall("setOverride");
- original_ICorJitInfo->setOverride(pOverride, currentMethod);
-}
-
void interceptor_ICJI::addActiveDependency(
CORINFO_MODULE_HANDLE moduleFrom,
CORINFO_MODULE_HANDLE moduleTo)
diff --git a/src/coreclr/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp b/src/coreclr/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp
index 16926858871788..294750ccde5c1a 100644
--- a/src/coreclr/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp
+++ b/src/coreclr/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp
@@ -1036,13 +1036,6 @@ uint32_t interceptor_ICJI::getFieldThreadLocalStoreID(
return original_ICorJitInfo->getFieldThreadLocalStoreID(field, ppIndirection);
}
-void interceptor_ICJI::setOverride(
- ICorDynamicInfo* pOverride,
- CORINFO_METHOD_HANDLE currentMethod)
-{
- original_ICorJitInfo->setOverride(pOverride, currentMethod);
-}
-
void interceptor_ICJI::addActiveDependency(
CORINFO_MODULE_HANDLE moduleFrom,
CORINFO_MODULE_HANDLE moduleTo)
diff --git a/src/coreclr/ToolBox/superpmi/superpmi/icorjitinfo.cpp b/src/coreclr/ToolBox/superpmi/superpmi/icorjitinfo.cpp
index 3ff21d07fb59f0..16c66a6a398476 100644
--- a/src/coreclr/ToolBox/superpmi/superpmi/icorjitinfo.cpp
+++ b/src/coreclr/ToolBox/superpmi/superpmi/icorjitinfo.cpp
@@ -426,7 +426,7 @@ CORINFO_CLASS_HANDLE MyICJI::getTypeInstantiationArgument(CORINFO_CLASS_HANDLE c
// If fFullInst=TRUE (regardless of fNamespace and fAssembly), include namespace and assembly for any type parameters
// If fAssembly=TRUE, suffix with a comma and the full assembly qualification
// return size of representation
-int MyICJI::appendClassName(__deref_inout_ecount(*pnBufLen) char16_t** ppBuf,
+int MyICJI::appendClassName(_Outptr_result_buffer_(*pnBufLen) char16_t** ppBuf,
int* pnBufLen,
CORINFO_CLASS_HANDLE cls,
bool fNamespace,
@@ -1099,7 +1099,7 @@ HRESULT MyICJI::GetErrorHRESULT(struct _EXCEPTION_POINTERS* pExceptionPointers)
// Fetches the message of the current exception
// Returns the size of the message (including terminating null). This can be
// greater than bufferLength if the buffer is insufficient.
-uint32_t MyICJI::GetErrorMessage(__inout_ecount(bufferLength) char16_t* buffer, uint32_t bufferLength)
+uint32_t MyICJI::GetErrorMessage(_Inout_updates_(bufferLength) char16_t* buffer, uint32_t bufferLength)
{
jitInstance->mc->cr->AddCall("GetErrorMessage");
LogError("Hit unimplemented GetErrorMessage");
@@ -1214,7 +1214,7 @@ unsigned MyICJI::getMethodHash(CORINFO_METHOD_HANDLE ftn /* IN */
// this function is for debugging only.
size_t MyICJI::findNameOfToken(CORINFO_MODULE_HANDLE module, /* IN */
mdToken metaTOK, /* IN */
- __out_ecount(FQNameCapacity) char* szFQName, /* OUT */
+ _Out_writes_(FQNameCapacity) char* szFQName, /* OUT */
size_t FQNameCapacity /* IN */
)
{
@@ -1490,14 +1490,6 @@ uint32_t MyICJI::getFieldThreadLocalStoreID(CORINFO_FIELD_HANDLE field, void** p
return jitInstance->mc->repGetFieldThreadLocalStoreID(field, ppIndirection);
}
-// Sets another object to intercept calls to "self" and current method being compiled
-void MyICJI::setOverride(ICorDynamicInfo* pOverride, CORINFO_METHOD_HANDLE currentMethod)
-{
- jitInstance->mc->cr->AddCall("setOverride");
- LogError("Hit unimplemented setOverride");
- DebugBreakorAV(115);
-}
-
// Adds an active dependency from the context method's module to the given module
// This is internal callback for the EE. JIT should not call it directly.
void MyICJI::addActiveDependency(CORINFO_MODULE_HANDLE moduleFrom, CORINFO_MODULE_HANDLE moduleTo)
diff --git a/src/coreclr/ToolBox/superpmi/superpmi/jitdebugger.cpp b/src/coreclr/ToolBox/superpmi/superpmi/jitdebugger.cpp
index 169d0a268483b7..242771fe796c85 100644
--- a/src/coreclr/ToolBox/superpmi/superpmi/jitdebugger.cpp
+++ b/src/coreclr/ToolBox/superpmi/superpmi/jitdebugger.cpp
@@ -134,7 +134,7 @@ BOOL GetRegistryLongValue(HKEY hKeyParent, LPCWSTR szKey, LPCWSTR szName, long*
// Note:
//
//----------------------------------------------------------------------------
-HRESULT GetCurrentModuleFileName(__out_ecount(*pcchBuffer) LPWSTR pBuffer, __inout DWORD* pcchBuffer)
+HRESULT GetCurrentModuleFileName(_Out_writes_(*pcchBuffer) LPWSTR pBuffer, __inout DWORD* pcchBuffer)
{
LIMITED_METHOD_CONTRACT;
@@ -252,7 +252,7 @@ void GetDebuggerSettingInfo(LPWSTR wszDebuggerString, DWORD cchDebuggerString, B
// * wszDebuggerString can be NULL. When wszDebuggerString is NULL, pcchDebuggerString should
// * point to a DWORD of zero. pcchDebuggerString cannot be NULL, and the DWORD pointed by
// * pcchDebuggerString will store the used or required string buffer size in characters.
-HRESULT GetDebuggerSettingInfoWorker(__out_ecount_part_opt(*pcchDebuggerString, *pcchDebuggerString)
+HRESULT GetDebuggerSettingInfoWorker(_Out_writes_to_opt_(*pcchDebuggerString, *pcchDebuggerString)
LPWSTR wszDebuggerString,
DWORD* pcchDebuggerString,
BOOL* pfAuto)
diff --git a/src/coreclr/ToolBox/superpmi/superpmi/jitdebugger.h b/src/coreclr/ToolBox/superpmi/superpmi/jitdebugger.h
index f941151b2e5493..a7f1eec42765de 100644
--- a/src/coreclr/ToolBox/superpmi/superpmi/jitdebugger.h
+++ b/src/coreclr/ToolBox/superpmi/superpmi/jitdebugger.h
@@ -14,14 +14,14 @@ BOOL GetRegistryLongValue(HKEY hKeyParent, // Parent key.
long* pValue, // Put value here, if found.
BOOL fReadNonVirtualizedKey); // Whether to read 64-bit hive on WOW64
-HRESULT GetCurrentModuleFileName(__out_ecount(*pcchBuffer) LPWSTR pBuffer, __inout DWORD* pcchBuffer);
+HRESULT GetCurrentModuleFileName(_Out_writes_(*pcchBuffer) LPWSTR pBuffer, __inout DWORD* pcchBuffer);
#ifndef _WIN64
BOOL RunningInWow64();
#endif
BOOL IsCurrentModuleFileNameInAutoExclusionList();
-HRESULT GetDebuggerSettingInfoWorker(__out_ecount_part_opt(*pcchDebuggerString, *pcchDebuggerString)
+HRESULT GetDebuggerSettingInfoWorker(_Out_writes_to_opt_(*pcchDebuggerString, *pcchDebuggerString)
LPWSTR wszDebuggerString,
DWORD* pcchDebuggerString,
BOOL* pfAuto);
diff --git a/src/coreclr/binder/textualidentityparser.cpp b/src/coreclr/binder/textualidentityparser.cpp
index 5d85a0a71cf377..f69e0bf66b202b 100644
--- a/src/coreclr/binder/textualidentityparser.cpp
+++ b/src/coreclr/binder/textualidentityparser.cpp
@@ -77,7 +77,7 @@ namespace BINDER_SPACE
}
}
- inline void BinToUnicodeHex(const BYTE *pSrc, UINT cSrc, __out_ecount(2*cSrc) LPWSTR pDst)
+ inline void BinToUnicodeHex(const BYTE *pSrc, UINT cSrc, _Out_writes_(2*cSrc) LPWSTR pDst)
{
UINT x;
UINT y;
diff --git a/src/coreclr/build-runtime.sh b/src/coreclr/build-runtime.sh
index 09529929492821..8d42b92ce95c0a 100755
--- a/src/coreclr/build-runtime.sh
+++ b/src/coreclr/build-runtime.sh
@@ -50,6 +50,8 @@ build_cross_architecture_components()
__SkipCrossArchBuild=0
elif [[ "$__BuildArch" == "arm64" && "$__CrossArch" == "x64" ]]; then
__SkipCrossArchBuild=0
+ elif [[ "$__BuildArch" == "loongarch64" && "$__CrossArch" == "x64" ]]; then
+ __SkipCrossArchBuild=0
else
# not supported
return
diff --git a/src/coreclr/classlibnative/bcltype/arraynative.cpp b/src/coreclr/classlibnative/bcltype/arraynative.cpp
index 738fd98c7f9e76..ca60fa978a626c 100644
--- a/src/coreclr/classlibnative/bcltype/arraynative.cpp
+++ b/src/coreclr/classlibnative/bcltype/arraynative.cpp
@@ -1154,23 +1154,25 @@ FCIMPL2_IV(void, ArrayNative::InitializeArray, ArrayBase* pArrayRef, FCALLRuntim
}
FCIMPLEND
-FCIMPL3(void*, ArrayNative::GetSpanDataFrom, FCALLRuntimeFieldHandle structField, FCALLRuntimeTypeHandle targetType, INT32* count)
+FCIMPL3_VVI(void*, ArrayNative::GetSpanDataFrom, FCALLRuntimeFieldHandle structField, FCALLRuntimeTypeHandle targetTypeUnsafe, INT32* count)
{
FCALL_CONTRACT;
struct
{
REFLECTFIELDREF refField;
+ REFLECTCLASSBASEREF refClass;
} gc;
gc.refField = (REFLECTFIELDREF)ObjectToOBJECTREF(FCALL_RFH_TO_REFLECTFIELD(structField));
+ gc.refClass = (REFLECTCLASSBASEREF)ObjectToOBJECTREF(FCALL_RTH_TO_REFLECTCLASS(targetTypeUnsafe));
void* data;
- HELPER_METHOD_FRAME_BEGIN_RET_1(gc);
+ HELPER_METHOD_FRAME_BEGIN_RET_PROTECT(gc);
FieldDesc* pField = (FieldDesc*)gc.refField->GetField();
if (!pField->IsRVA())
COMPlusThrow(kArgumentException);
- TypeHandle targetTypeHandle = FCALL_RTH_TO_REFLECTCLASS(targetType)->GetType();
+ TypeHandle targetTypeHandle = gc.refClass->GetType();
if (!CorTypeInfo::IsPrimitiveType(targetTypeHandle.GetSignatureCorElementType()) && !targetTypeHandle.IsEnum())
COMPlusThrow(kArgumentException);
@@ -1180,8 +1182,9 @@ FCIMPL3(void*, ArrayNative::GetSpanDataFrom, FCALLRuntimeFieldHandle structField
// Report the RVA field to the logger.
g_IBCLogger.LogRVADataAccess(pField);
- _ASSERTE(data != NULL && count != NULL);
data = pField->GetStaticAddressHandle(NULL);
+ _ASSERTE(data != NULL);
+ _ASSERTE(count != NULL);
if (AlignUp((UINT_PTR)data, targetTypeSize) != (UINT_PTR)data)
COMPlusThrow(kArgumentException);
diff --git a/src/coreclr/classlibnative/bcltype/arraynative.h b/src/coreclr/classlibnative/bcltype/arraynative.h
index 6a1c8979525cdb..bd74be3d3ea6ac 100644
--- a/src/coreclr/classlibnative/bcltype/arraynative.h
+++ b/src/coreclr/classlibnative/bcltype/arraynative.h
@@ -48,7 +48,7 @@ class ArrayNative
// This method will acquire data to create a span from a TypeHandle
// to a field.
- static FCDECL3(void*, GetSpanDataFrom, FCALLRuntimeFieldHandle structField, FCALLRuntimeTypeHandle targetType, INT32* count);
+ static FCDECL3_VVI(void*, GetSpanDataFrom, FCALLRuntimeFieldHandle structField, FCALLRuntimeTypeHandle targetTypeUnsafe, INT32* count);
private:
// Helper for CreateInstance
diff --git a/src/coreclr/clrdefinitions.cmake b/src/coreclr/clrdefinitions.cmake
index 50aab221c8032e..d5fc9f5e1ee8e5 100644
--- a/src/coreclr/clrdefinitions.cmake
+++ b/src/coreclr/clrdefinitions.cmake
@@ -191,12 +191,12 @@ if (CLR_CMAKE_TARGET_ARCH_AMD64)
add_definitions(-DUNIX_AMD64_ABI_ITF)
endif (CLR_CMAKE_TARGET_ARCH_AMD64)
add_definitions(-DFEATURE_USE_ASM_GC_WRITE_BARRIERS)
-if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64)
+if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_LOONGARCH64)
add_definitions(-DFEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP)
-endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64)
-if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64)
+endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_LOONGARCH64)
+if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_LOONGARCH64)
add_definitions(-DFEATURE_MANUALLY_MANAGED_CARD_BUNDLES)
-endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64)
+endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_LOONGARCH64)
if(NOT CLR_CMAKE_TARGET_UNIX)
add_definitions(-DFEATURE_WIN32_REGISTRY)
@@ -240,6 +240,7 @@ function(set_target_definitions_to_custom_os_and_arch)
elseif (TARGETDETAILS_ARCH STREQUAL "x86")
target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE UNIX_X86_ABI)
elseif (TARGETDETAILS_ARCH STREQUAL "arm64")
+ elseif (TARGETDETAILS_ARCH STREQUAL "loongarch64")
endif()
if ((TARGETDETAILS_ARCH STREQUAL "arm64") AND (TARGETDETAILS_OS STREQUAL "unix_osx"))
target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE OSX_ARM64_ABI)
@@ -260,6 +261,10 @@ function(set_target_definitions_to_custom_os_and_arch)
target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_64BIT)
target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_ARM64)
target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE FEATURE_MULTIREG_RETURN)
+ elseif(TARGETDETAILS_ARCH STREQUAL "loongarch64")
+ target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_64BIT)
+ target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_LOONGARCH64)
+ target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE FEATURE_MULTIREG_RETURN)
elseif((TARGETDETAILS_ARCH STREQUAL "arm") OR (TARGETDETAILS_ARCH STREQUAL "armel"))
target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_ARM)
endif()
diff --git a/src/coreclr/debug/createdump/crashinfomac.cpp b/src/coreclr/debug/createdump/crashinfomac.cpp
index ad9c247e37dfdc..3ada3bd767c964 100644
--- a/src/coreclr/debug/createdump/crashinfomac.cpp
+++ b/src/coreclr/debug/createdump/crashinfomac.cpp
@@ -277,6 +277,9 @@ void CrashInfo::VisitSegment(MachOModule& module, const segment_command_64& segm
uint64_t start = segment.vmaddr + module.LoadBias();
uint64_t end = start + segment.vmsize;
+ // Add this module segment to the set used by the thread unwinding to lookup the module base address for an ip.
+ AddModuleAddressRange(start, end, module.BaseAddress());
+
// Round to page boundary
start = start & PAGE_MASK;
_ASSERTE(start > 0);
@@ -297,9 +300,6 @@ void CrashInfo::VisitSegment(MachOModule& module, const segment_command_64& segm
}
// Add this module segment to the module mappings list
m_moduleMappings.insert(moduleRegion);
-
- // Add this module segment to the set used by the thread unwinding to lookup the module base address for an ip.
- AddModuleAddressRange(start, end, module.BaseAddress());
}
else
{
diff --git a/src/coreclr/debug/createdump/stackframe.h b/src/coreclr/debug/createdump/stackframe.h
index 75e20d93120c0c..00c3a1cfb7fd8f 100644
--- a/src/coreclr/debug/createdump/stackframe.h
+++ b/src/coreclr/debug/createdump/stackframe.h
@@ -66,9 +66,16 @@ struct StackFrame
}
}
+// See comment in threadinfo.cpp UnwindNativeFrames function
+#if defined(__aarch64__)
+ #define STACK_POINTER_MASK ~0x7
+#else
+ #define STACK_POINTER_MASK ~0x0
+#endif
+
inline uint64_t ModuleAddress() const { return m_moduleAddress; }
inline uint64_t InstructionPointer() const { return m_instructionPointer; }
- inline uint64_t StackPointer() const { return m_stackPointer; }
+ inline uint64_t StackPointer() const { return m_stackPointer & STACK_POINTER_MASK; }
inline uint32_t NativeOffset() const { return m_nativeOffset; }
inline uint32_t Token() const { return m_token; }
inline uint32_t ILOffset() const { return m_ilOffset; }
diff --git a/src/coreclr/debug/createdump/threadinfo.cpp b/src/coreclr/debug/createdump/threadinfo.cpp
index 82509f52750653..e64eafc8d29a96 100644
--- a/src/coreclr/debug/createdump/threadinfo.cpp
+++ b/src/coreclr/debug/createdump/threadinfo.cpp
@@ -53,6 +53,16 @@ ThreadInfo::UnwindNativeFrames(CONTEXT* pContext)
uint64_t ip = 0, sp = 0;
GetFrameLocation(pContext, &ip, &sp);
+#if defined(__aarch64__)
+ // ARM64 can have frames with the same SP but different IPs. Increment sp so it gets added to the stack
+ // frames in the correct order and to prevent the below loop termination on non-increasing sp. Since stack
+ // pointers are always 8 byte align, this increase is masked off in StackFrame::StackPointer() to get the
+ // original stack pointer.
+ if (sp == previousSp && ip != previousIp)
+ {
+ sp++;
+ }
+#endif
if (ip == 0 || sp <= previousSp) {
TRACE_VERBOSE("Unwind: sp not increasing or ip == 0 sp %p ip %p\n", (void*)sp, (void*)ip);
break;
diff --git a/src/coreclr/debug/daccess/daccess.cpp b/src/coreclr/debug/daccess/daccess.cpp
index f9ec95c1f41838..9aaf6e6e4cb171 100644
--- a/src/coreclr/debug/daccess/daccess.cpp
+++ b/src/coreclr/debug/daccess/daccess.cpp
@@ -92,10 +92,10 @@ BOOL WINAPI DllMain(HANDLE instance, DWORD reason, LPVOID reserved)
}
HRESULT
-ConvertUtf8(__in LPCUTF8 utf8,
+ConvertUtf8(_In_ LPCUTF8 utf8,
ULONG32 bufLen,
ULONG32* nameLen,
- __out_ecount_part_opt(bufLen, *nameLen) PWSTR buffer)
+ _Out_writes_to_opt_(bufLen, *nameLen) PWSTR buffer)
{
if (nameLen)
{
@@ -118,9 +118,9 @@ ConvertUtf8(__in LPCUTF8 utf8,
}
HRESULT
-AllocUtf8(__in_opt LPCWSTR wstr,
+AllocUtf8(_In_opt_ LPCWSTR wstr,
ULONG32 srcChars,
- __deref_out LPUTF8* utf8)
+ _Outptr_ LPUTF8* utf8)
{
ULONG32 chars = WszWideCharToMultiByte(CP_UTF8, 0, wstr, srcChars,
NULL, 0, NULL, NULL);
@@ -165,7 +165,7 @@ HRESULT
GetFullClassNameFromMetadata(IMDInternalImport* mdImport,
mdTypeDef classToken,
ULONG32 bufferChars,
- __inout_ecount(bufferChars) LPUTF8 buffer)
+ _Inout_updates_(bufferChars) LPUTF8 buffer)
{
HRESULT hr;
LPCUTF8 baseName, namespaceName;
@@ -179,7 +179,7 @@ HRESULT
GetFullMethodNameFromMetadata(IMDInternalImport* mdImport,
mdMethodDef methodToken,
ULONG32 bufferChars,
- __inout_ecount(bufferChars) LPUTF8 buffer)
+ _Inout_updates_(bufferChars) LPUTF8 buffer)
{
HRESULT status;
HRESULT hr;
@@ -228,13 +228,13 @@ GetFullMethodNameFromMetadata(IMDInternalImport* mdImport,
}
HRESULT
-SplitFullName(__in_z __in PCWSTR fullName,
+SplitFullName(_In_z_ PCWSTR fullName,
SplitSyntax syntax,
ULONG32 memberDots,
- __deref_out_opt LPUTF8* namespaceName,
- __deref_out_opt LPUTF8* typeName,
- __deref_out_opt LPUTF8* memberName,
- __deref_out_opt LPUTF8* params)
+ _Outptr_opt_ LPUTF8* namespaceName,
+ _Outptr_opt_ LPUTF8* typeName,
+ _Outptr_opt_ LPUTF8* memberName,
+ _Outptr_opt_ LPUTF8* params)
{
HRESULT status;
PCWSTR paramsStart, memberStart, memberEnd, typeStart;
@@ -401,7 +401,7 @@ SplitFullName(__in_z __in PCWSTR fullName,
}
int
-CompareUtf8(__in LPCUTF8 str1, __in LPCUTF8 str2, __in ULONG32 nameFlags)
+CompareUtf8(_In_ LPCUTF8 str1, _In_ LPCUTF8 str2, _In_ ULONG32 nameFlags)
{
if (nameFlags & CLRDATA_BYNAME_CASE_INSENSITIVE)
{
@@ -469,8 +469,8 @@ MetaEnum::End(void)
HRESULT
MetaEnum::NextToken(mdToken* token,
- __deref_opt_out_opt LPCUTF8* namespaceName,
- __deref_opt_out_opt LPCUTF8* name)
+ _Outptr_opt_result_maybenull_ LPCUTF8* namespaceName,
+ _Outptr_opt_result_maybenull_ LPCUTF8* name)
{
HRESULT hr;
if (!m_mdImport)
@@ -584,8 +584,8 @@ MetaEnum::NextDomainToken(AppDomain** appDomain,
}
HRESULT
-MetaEnum::NextTokenByName(__in_opt LPCUTF8 namespaceName,
- __in_opt LPCUTF8 name,
+MetaEnum::NextTokenByName(_In_opt_ LPCUTF8 namespaceName,
+ _In_opt_ LPCUTF8 name,
ULONG32 nameFlags,
mdToken* token)
{
@@ -617,8 +617,8 @@ MetaEnum::NextTokenByName(__in_opt LPCUTF8 namespaceName,
}
HRESULT
-MetaEnum::NextDomainTokenByName(__in_opt LPCUTF8 namespaceName,
- __in_opt LPCUTF8 name,
+MetaEnum::NextDomainTokenByName(_In_opt_ LPCUTF8 namespaceName,
+ _In_opt_ LPCUTF8 name,
ULONG32 nameFlags,
AppDomain** appDomain, mdToken* token)
{
@@ -755,7 +755,7 @@ SplitName::Clear(void)
}
HRESULT
-SplitName::SplitString(__in_opt PCWSTR fullName)
+SplitName::SplitString(_In_opt_ PCWSTR fullName)
{
if (m_syntax == SPLIT_NO_NAME)
{
@@ -800,7 +800,7 @@ WCHAR* wcrscan(LPCWSTR beg, LPCWSTR end, WCHAR ch)
// sepName to point to the second '+' character in the string. When sepName
// points to the first '+' character this function will return "Outer" in
// pResult and sepName will point one WCHAR before fullName.
-HRESULT NextEnclosingClasName(LPCWSTR fullName, __deref_inout LPWSTR& sepName, __deref_out LPUTF8 *pResult)
+HRESULT NextEnclosingClasName(LPCWSTR fullName, _Outref_ LPWSTR& sepName, _Outptr_ LPUTF8 *pResult)
{
if (sepName < fullName)
{
@@ -994,7 +994,7 @@ SplitName::FindField(IMDInternalImport* mdInternal)
}
HRESULT
-SplitName::AllocAndSplitString(__in_opt PCWSTR fullName,
+SplitName::AllocAndSplitString(_In_opt_ PCWSTR fullName,
SplitSyntax syntax,
ULONG32 nameFlags,
ULONG32 memberDots,
@@ -1024,7 +1024,7 @@ SplitName::AllocAndSplitString(__in_opt PCWSTR fullName,
}
HRESULT
-SplitName::CdStartMethod(__in_opt PCWSTR fullName,
+SplitName::CdStartMethod(_In_opt_ PCWSTR fullName,
ULONG32 nameFlags,
Module* mod,
mdTypeDef typeToken,
@@ -1138,7 +1138,7 @@ SplitName::CdNextDomainMethod(CLRDATA_ENUM* handle,
}
HRESULT
-SplitName::CdStartField(__in_opt PCWSTR fullName,
+SplitName::CdStartField(_In_opt_ PCWSTR fullName,
ULONG32 nameFlags,
ULONG32 fieldFlags,
IXCLRDataTypeInstance* fromTypeInst,
@@ -1241,7 +1241,7 @@ SplitName::CdNextField(ClrDataAccess* dac,
IXCLRDataValue** value,
ULONG32 nameBufRetLen,
ULONG32* nameLenRet,
- __out_ecount_part_opt(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ],
+ _Out_writes_to_opt_(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ],
IXCLRDataModule** tokenScopeRet,
mdFieldDef* tokenRet)
{
@@ -1419,7 +1419,7 @@ SplitName::CdNextDomainField(ClrDataAccess* dac,
}
HRESULT
-SplitName::CdStartType(__in_opt PCWSTR fullName,
+SplitName::CdStartType(_In_opt_ PCWSTR fullName,
ULONG32 nameFlags,
Module* mod,
AppDomain* appDomain,
@@ -3698,7 +3698,7 @@ ClrDataAccess::GetRuntimeNameByAddress(
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *symbolLen,
- /* [size_is][out] */ __out_ecount_opt(bufLen) WCHAR symbolBuf[ ],
+ /* [size_is][out] */ _Out_writes_bytes_opt_(bufLen) WCHAR symbolBuf[ ],
/* [out] */ CLRDATA_ADDRESS* displacement)
{
HRESULT status;
@@ -4317,7 +4317,7 @@ ClrDataAccess::GetDataByAddress(
/* [in] */ IXCLRDataTask* tlsTask,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataValue **value,
/* [out] */ CLRDATA_ADDRESS *displacement)
{
@@ -5642,7 +5642,7 @@ ClrDataAccess::GetFullMethodName(
IN MethodDesc* methodDesc,
IN ULONG32 symbolChars,
OUT ULONG32* symbolLen,
- __out_ecount_part_opt(symbolChars, *symbolLen) LPWSTR symbol
+ _Out_writes_to_opt_(symbolChars, *symbolLen) LPWSTR symbol
)
{
StackSString s;
@@ -5690,7 +5690,7 @@ ClrDataAccess::GetJitHelperName(
#define JITHELPER(code,fn,sig) #code,
#include
};
- static_assert_no_msg(COUNTOF(s_rgHelperNames) == CORINFO_HELP_COUNT);
+ static_assert_no_msg(ARRAY_SIZE(s_rgHelperNames) == CORINFO_HELP_COUNT);
#ifdef TARGET_UNIX
if (!dynamicHelpersOnly)
@@ -5737,7 +5737,7 @@ ClrDataAccess::RawGetMethodName(
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *symbolLen,
- /* [size_is][out] */ __out_ecount_opt(bufLen) WCHAR symbolBuf[ ],
+ /* [size_is][out] */ _Out_writes_bytes_opt_(bufLen) WCHAR symbolBuf[ ],
/* [out] */ CLRDATA_ADDRESS* displacement)
{
#ifdef TARGET_ARM
@@ -5745,7 +5745,7 @@ ClrDataAccess::RawGetMethodName(
address &= ~THUMB_CODE;
#endif
- const UINT k_cch64BitHexFormat = COUNTOF("1234567812345678");
+ const UINT k_cch64BitHexFormat = ARRAY_SIZE("1234567812345678");
HRESULT status;
if (flags != 0)
@@ -5887,7 +5887,7 @@ ClrDataAccess::RawGetMethodName(
// Printf failed. Estimate a size that will be at least big enough to hold the name
if (symbolLen)
{
- size_t cchSymbol = COUNTOF(s_wszFormatNameWithStubManager) +
+ size_t cchSymbol = ARRAY_SIZE(s_wszFormatNameWithStubManager) +
wcslen(wszStubManagerName) +
k_cch64BitHexFormat +
1;
@@ -5950,7 +5950,7 @@ ClrDataAccess::RawGetMethodName(
// Printf failed. Estimate a size that will be at least big enough to hold the name
if (symbolLen)
{
- size_t cchSymbol = COUNTOF(s_wszFormatNameAddressOnly) +
+ size_t cchSymbol = ARRAY_SIZE(s_wszFormatNameAddressOnly) +
k_cch64BitHexFormat +
1;
@@ -6460,7 +6460,7 @@ ClrDataAccess::GetMetaDataFileInfoFromPEFile(PEAssembly *pPEAssembly,
DWORD &dwDataSize,
DWORD &dwRvaHint,
bool &isNGEN,
- __out_ecount(cchFilePath) LPWSTR wszFilePath,
+ _Out_writes_(cchFilePath) LPWSTR wszFilePath,
const DWORD cchFilePath)
{
SUPPORTS_DAC_HOST_ONLY;
@@ -6524,7 +6524,7 @@ ClrDataAccess::GetMetaDataFileInfoFromPEFile(PEAssembly *pPEAssembly,
bool ClrDataAccess::GetILImageInfoFromNgenPEFile(PEAssembly *pPEAssembly,
DWORD &dwTimeStamp,
DWORD &dwSize,
- __out_ecount(cchFilePath) LPWSTR wszFilePath,
+ _Out_writes_(cchFilePath) LPWSTR wszFilePath,
const DWORD cchFilePath)
{
SUPPORTS_DAC_HOST_ONLY;
@@ -6548,7 +6548,7 @@ bool ClrDataAccess::GetILImageInfoFromNgenPEFile(PEAssembly *pPEAssembly,
// In the end we add given ilExtension.
// This dependecy is based on Apollo installer behavior.
bool ClrDataAccess::GetILImageNameFromNgenImage( LPCWSTR ilExtension,
- __out_ecount(cchFilePath) LPWSTR wszFilePath,
+ _Out_writes_(cchFilePath) LPWSTR wszFilePath,
const DWORD cchFilePath)
{
if (wszFilePath == NULL || cchFilePath == 0)
@@ -7565,9 +7565,9 @@ typedef struct _WER_RUNTIME_EXCEPTION_INFORMATION
// else detailed error code.
//
//----------------------------------------------------------------------------
-STDAPI OutOfProcessExceptionEventGetWatsonBucket(__in PDWORD pContext,
- __in const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation,
- __out GenericModeBlock * pGMB)
+STDAPI OutOfProcessExceptionEventGetWatsonBucket(_In_ PDWORD pContext,
+ _In_ const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation,
+ _Out_ GenericModeBlock * pGMB)
{
HANDLE hProcess = pExceptionInformation->hProcess;
HANDLE hThread = pExceptionInformation->hThread;
@@ -7656,12 +7656,12 @@ STDAPI OutOfProcessExceptionEventGetWatsonBucket(__in PDWORD pContext,
// Since this is called by external modules it's important that we don't let any exceptions leak out (see Win8 95224).
//
//----------------------------------------------------------------------------
-STDAPI OutOfProcessExceptionEventCallback(__in PDWORD pContext,
- __in const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation,
- __out BOOL * pbOwnershipClaimed,
- __out_ecount(*pchSize) PWSTR pwszEventName,
+STDAPI OutOfProcessExceptionEventCallback(_In_ PDWORD pContext,
+ _In_ const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation,
+ _Out_ BOOL * pbOwnershipClaimed,
+ _Out_writes_(*pchSize) PWSTR pwszEventName,
__inout PDWORD pchSize,
- __out PDWORD pdwSignatureCount)
+ _Out_ PDWORD pdwSignatureCount)
{
SUPPORTS_DAC_HOST_ONLY;
@@ -7748,12 +7748,12 @@ STDAPI OutOfProcessExceptionEventCallback(__in PDWORD pContext,
// Since this is called by external modules it's important that we don't let any exceptions leak out (see Win8 95224).
//
//----------------------------------------------------------------------------
-STDAPI OutOfProcessExceptionEventSignatureCallback(__in PDWORD pContext,
- __in const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation,
- __in DWORD dwIndex,
- __out_ecount(*pchName) PWSTR pwszName,
+STDAPI OutOfProcessExceptionEventSignatureCallback(_In_ PDWORD pContext,
+ _In_ const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation,
+ _In_ DWORD dwIndex,
+ _Out_writes_(*pchName) PWSTR pwszName,
__inout PDWORD pchName,
- __out_ecount(*pchValue) PWSTR pwszValue,
+ _Out_writes_(*pchValue) PWSTR pwszValue,
__inout PDWORD pchValue)
{
SUPPORTS_DAC_HOST_ONLY;
@@ -7873,12 +7873,12 @@ STDAPI OutOfProcessExceptionEventSignatureCallback(__in PDWORD pContext,
// this function are of the pwszName and pwszValue buffers.
//
//----------------------------------------------------------------------------
-STDAPI OutOfProcessExceptionEventDebuggerLaunchCallback(__in PDWORD pContext,
- __in const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation,
- __out BOOL * pbCustomDebuggerNeeded,
- __out_ecount_opt(*pchSize) PWSTR pwszDebuggerLaunch,
+STDAPI OutOfProcessExceptionEventDebuggerLaunchCallback(_In_ PDWORD pContext,
+ _In_ const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation,
+ _Out_ BOOL * pbCustomDebuggerNeeded,
+ _Out_writes_opt_(*pchSize) PWSTR pwszDebuggerLaunch,
__inout PDWORD pchSize,
- __out BOOL * pbAutoLaunchDebugger)
+ _Out_ BOOL * pbAutoLaunchDebugger)
{
SUPPORTS_DAC_HOST_ONLY;
diff --git a/src/coreclr/debug/daccess/dacfn.cpp b/src/coreclr/debug/daccess/dacfn.cpp
index e1b83aba17e20c..11f798ed04c199 100644
--- a/src/coreclr/debug/daccess/dacfn.cpp
+++ b/src/coreclr/debug/daccess/dacfn.cpp
@@ -89,7 +89,7 @@ DacExceptionFilter(Exception* ex, ClrDataAccess* access,
}
void __cdecl
-DacWarning(__in char* format, ...)
+DacWarning(_In_ char* format, ...)
{
char text[256];
va_list args;
diff --git a/src/coreclr/debug/daccess/dacimpl.h b/src/coreclr/debug/daccess/dacimpl.h
index 948bef16e498da..57a4dc1bbab8fc 100644
--- a/src/coreclr/debug/daccess/dacimpl.h
+++ b/src/coreclr/debug/daccess/dacimpl.h
@@ -222,22 +222,22 @@ struct METH_EXTENTS
CLRDATA_ADDRESS_RANGE extents[1];
};
-HRESULT ConvertUtf8(__in LPCUTF8 utf8,
+HRESULT ConvertUtf8(_In_ LPCUTF8 utf8,
ULONG32 bufLen,
ULONG32* nameLen,
- __out_ecount_part_opt(bufLen, *nameLen) PWSTR buffer);
-HRESULT AllocUtf8(__in_opt LPCWSTR wstr,
+ _Out_writes_to_opt_(bufLen, *nameLen) PWSTR buffer);
+HRESULT AllocUtf8(_In_opt_ LPCWSTR wstr,
ULONG32 srcChars,
- __deref_out LPUTF8* utf8);
+ _Outptr_ LPUTF8* utf8);
HRESULT GetFullClassNameFromMetadata(IMDInternalImport* mdImport,
mdTypeDef classToken,
ULONG32 bufferChars,
- __inout_ecount(bufferChars) LPUTF8 buffer);
+ _Inout_updates_(bufferChars) LPUTF8 buffer);
HRESULT GetFullMethodNameFromMetadata(IMDInternalImport* mdImport,
mdMethodDef methodToken,
ULONG32 bufferChars,
- __inout_ecount(bufferChars) LPUTF8 buffer);
+ _Inout_updates_(bufferChars) LPUTF8 buffer);
enum SplitSyntax
{
@@ -247,15 +247,15 @@ enum SplitSyntax
SPLIT_NO_NAME,
};
-HRESULT SplitFullName(__in_z __in PCWSTR fullName,
+HRESULT SplitFullName(_In_z_ PCWSTR fullName,
SplitSyntax syntax,
ULONG32 memberDots,
- __deref_out_opt LPUTF8* namespaceName,
- __deref_out_opt LPUTF8* typeName,
- __deref_out_opt LPUTF8* memberName,
- __deref_out_opt LPUTF8* params);
+ _Outptr_opt_ LPUTF8* namespaceName,
+ _Outptr_opt_ LPUTF8* typeName,
+ _Outptr_opt_ LPUTF8* memberName,
+ _Outptr_opt_ LPUTF8* params);
-int CompareUtf8(__in LPCUTF8 str1, __in LPCUTF8 str2, __in ULONG32 nameFlags);
+int CompareUtf8(_In_ LPCUTF8 str1, _In_ LPCUTF8 str2, _In_ ULONG32 nameFlags);
#define INH_STATIC \
(CLRDATA_VALUE_ALL_KINDS | \
@@ -304,16 +304,16 @@ class MetaEnum
void End(void);
HRESULT NextToken(mdToken* token,
- __deref_opt_out_opt LPCUTF8* namespaceName,
- __deref_opt_out_opt LPCUTF8* name);
+ _Outptr_opt_result_maybenull_ LPCUTF8* namespaceName,
+ _Outptr_opt_result_maybenull_ LPCUTF8* name);
HRESULT NextDomainToken(AppDomain** appDomain,
mdToken* token);
- HRESULT NextTokenByName(__in_opt LPCUTF8 namespaceName,
- __in_opt LPCUTF8 name,
+ HRESULT NextTokenByName(_In_opt_ LPCUTF8 namespaceName,
+ _In_opt_ LPCUTF8 name,
ULONG32 nameFlags,
mdToken* token);
- HRESULT NextDomainTokenByName(__in_opt LPCUTF8 namespaceName,
- __in_opt LPCUTF8 name,
+ HRESULT NextDomainTokenByName(_In_opt_ LPCUTF8 namespaceName,
+ _In_opt_ LPCUTF8 name,
ULONG32 nameFlags,
AppDomain** appDomain, mdToken* token);
@@ -410,7 +410,7 @@ class SplitName
void Delete(void);
void Clear(void);
- HRESULT SplitString(__in_opt PCWSTR fullName);
+ HRESULT SplitString(_In_opt_ PCWSTR fullName);
bool FindType(IMDInternalImport* mdInternal);
bool FindMethod(IMDInternalImport* mdInternal);
@@ -421,13 +421,13 @@ class SplitName
return CompareUtf8(str1, str2, m_nameFlags);
}
- static HRESULT AllocAndSplitString(__in_opt PCWSTR fullName,
+ static HRESULT AllocAndSplitString(_In_opt_ PCWSTR fullName,
SplitSyntax syntax,
ULONG32 nameFlags,
ULONG32 memberDots,
SplitName** split);
- static HRESULT CdStartMethod(__in_opt PCWSTR fullName,
+ static HRESULT CdStartMethod(_In_opt_ PCWSTR fullName,
ULONG32 nameFlags,
Module* mod,
mdTypeDef typeToken,
@@ -441,7 +441,7 @@ class SplitName
AppDomain** appDomain,
mdMethodDef* token);
- static HRESULT CdStartField(__in_opt PCWSTR fullName,
+ static HRESULT CdStartField(_In_opt_ PCWSTR fullName,
ULONG32 nameFlags,
ULONG32 fieldFlags,
IXCLRDataTypeInstance* fromTypeInst,
@@ -462,14 +462,14 @@ class SplitName
IXCLRDataValue** value,
ULONG32 nameBufRetLen,
ULONG32* nameLenRet,
- __out_ecount_part_opt(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ],
+ _Out_writes_to_opt_(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ],
IXCLRDataModule** tokenScopeRet,
mdFieldDef* tokenRet);
static HRESULT CdNextDomainField(ClrDataAccess* dac,
CLRDATA_ENUM* handle,
IXCLRDataValue** value);
- static HRESULT CdStartType(__in_opt PCWSTR fullName,
+ static HRESULT CdStartType(_In_opt_ PCWSTR fullName,
ULONG32 nameFlags,
Module* mod,
AppDomain* appDomain,
@@ -901,7 +901,7 @@ class ClrDataAccess
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_opt(bufLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_bytes_opt_(bufLen) WCHAR nameBuf[ ],
/* [out] */ CLRDATA_ADDRESS* displacement);
virtual HRESULT STDMETHODCALLTYPE StartEnumAppDomains(
@@ -972,7 +972,7 @@ class ClrDataAccess
/* [in] */ IXCLRDataTask* tlsTask,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataValue **value,
/* [out] */ CLRDATA_ADDRESS *displacement);
@@ -1080,10 +1080,10 @@ class ClrDataAccess
virtual HRESULT STDMETHODCALLTYPE GetAppDomainStoreData(struct DacpAppDomainStoreData *data);
virtual HRESULT STDMETHODCALLTYPE GetAppDomainList(unsigned int count, CLRDATA_ADDRESS values[], unsigned int *pNeeded);
virtual HRESULT STDMETHODCALLTYPE GetAppDomainData(CLRDATA_ADDRESS addr, struct DacpAppDomainData *data);
- virtual HRESULT STDMETHODCALLTYPE GetAppDomainName(CLRDATA_ADDRESS addr, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetAppDomainName(CLRDATA_ADDRESS addr, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded);
virtual HRESULT STDMETHODCALLTYPE GetAssemblyList(CLRDATA_ADDRESS appDomain, int count, CLRDATA_ADDRESS values[], int *fetched);
virtual HRESULT STDMETHODCALLTYPE GetAssemblyData(CLRDATA_ADDRESS baseDomainPtr, CLRDATA_ADDRESS assembly, struct DacpAssemblyData *data);
- virtual HRESULT STDMETHODCALLTYPE GetAssemblyName(CLRDATA_ADDRESS assembly, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetAssemblyName(CLRDATA_ADDRESS assembly, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded);
virtual HRESULT STDMETHODCALLTYPE GetThreadData(CLRDATA_ADDRESS thread, struct DacpThreadData *data);
virtual HRESULT STDMETHODCALLTYPE GetThreadFromThinlockID(UINT thinLockId, CLRDATA_ADDRESS *pThread);
virtual HRESULT STDMETHODCALLTYPE GetStackLimits(CLRDATA_ADDRESS threadPtr, CLRDATA_ADDRESS *lower, CLRDATA_ADDRESS *upper, CLRDATA_ADDRESS *fp);
@@ -1091,27 +1091,27 @@ class ClrDataAccess
virtual HRESULT STDMETHODCALLTYPE GetMethodDescData(CLRDATA_ADDRESS methodDesc, CLRDATA_ADDRESS ip, struct DacpMethodDescData *data, ULONG cRevertedRejitVersions, DacpReJitData * rgRevertedRejitData, ULONG * pcNeededRevertedRejitData);
virtual HRESULT STDMETHODCALLTYPE GetMethodDescPtrFromIP(CLRDATA_ADDRESS ip, CLRDATA_ADDRESS * ppMD);
- virtual HRESULT STDMETHODCALLTYPE GetMethodDescName(CLRDATA_ADDRESS methodDesc, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetMethodDescName(CLRDATA_ADDRESS methodDesc, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded);
virtual HRESULT STDMETHODCALLTYPE GetMethodDescPtrFromFrame(CLRDATA_ADDRESS frameAddr, CLRDATA_ADDRESS * ppMD);
virtual HRESULT STDMETHODCALLTYPE GetCodeHeaderData(CLRDATA_ADDRESS ip, struct DacpCodeHeaderData *data);
virtual HRESULT STDMETHODCALLTYPE GetThreadpoolData(struct DacpThreadpoolData *data);
virtual HRESULT STDMETHODCALLTYPE GetWorkRequestData(CLRDATA_ADDRESS addrWorkRequest, struct DacpWorkRequestData *data);
virtual HRESULT STDMETHODCALLTYPE GetObjectData(CLRDATA_ADDRESS objAddr, struct DacpObjectData *data);
- virtual HRESULT STDMETHODCALLTYPE GetObjectStringData(CLRDATA_ADDRESS obj, unsigned int count, __out_z __inout_ecount(count) WCHAR *stringData, unsigned int *pNeeded);
- virtual HRESULT STDMETHODCALLTYPE GetObjectClassName(CLRDATA_ADDRESS obj, unsigned int count, __out_z __inout_ecount(count) WCHAR *className, unsigned int *pNeeded);
- virtual HRESULT STDMETHODCALLTYPE GetMethodTableName(CLRDATA_ADDRESS mt, unsigned int count, __out_z __inout_ecount(count) WCHAR *mtName, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetObjectStringData(CLRDATA_ADDRESS obj, unsigned int count, _Inout_updates_z_(count) WCHAR *stringData, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetObjectClassName(CLRDATA_ADDRESS obj, unsigned int count, _Inout_updates_z_(count) WCHAR *className, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetMethodTableName(CLRDATA_ADDRESS mt, unsigned int count, _Inout_updates_z_(count) WCHAR *mtName, unsigned int *pNeeded);
virtual HRESULT STDMETHODCALLTYPE GetMethodTableData(CLRDATA_ADDRESS mt, struct DacpMethodTableData *data);
virtual HRESULT STDMETHODCALLTYPE GetMethodTableFieldData(CLRDATA_ADDRESS mt, struct DacpMethodTableFieldData *data);
virtual HRESULT STDMETHODCALLTYPE GetMethodTableTransparencyData(CLRDATA_ADDRESS mt, struct DacpMethodTableTransparencyData *data);
virtual HRESULT STDMETHODCALLTYPE GetMethodTableForEEClass(CLRDATA_ADDRESS eeClass, CLRDATA_ADDRESS *value);
virtual HRESULT STDMETHODCALLTYPE GetFieldDescData(CLRDATA_ADDRESS fieldDesc, struct DacpFieldDescData *data);
- virtual HRESULT STDMETHODCALLTYPE GetFrameName(CLRDATA_ADDRESS vtable, unsigned int count, __out_z __inout_ecount(count) WCHAR *frameName, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetFrameName(CLRDATA_ADDRESS vtable, unsigned int count, _Inout_updates_z_(count) WCHAR *frameName, unsigned int *pNeeded);
virtual HRESULT STDMETHODCALLTYPE GetModule(CLRDATA_ADDRESS addr, IXCLRDataModule **mod);
virtual HRESULT STDMETHODCALLTYPE GetModuleData(CLRDATA_ADDRESS moduleAddr, struct DacpModuleData *data);
virtual HRESULT STDMETHODCALLTYPE TraverseModuleMap(ModuleMapType mmt, CLRDATA_ADDRESS moduleAddr, MODULEMAPTRAVERSE pCallback, LPVOID token);
virtual HRESULT STDMETHODCALLTYPE GetMethodDescFromToken(CLRDATA_ADDRESS moduleAddr, mdToken token, CLRDATA_ADDRESS *methodDesc);
virtual HRESULT STDMETHODCALLTYPE GetPEFileBase(CLRDATA_ADDRESS addr, CLRDATA_ADDRESS *base);
- virtual HRESULT STDMETHODCALLTYPE GetPEFileName(CLRDATA_ADDRESS addr, unsigned int count, __out_z __inout_ecount(count) WCHAR *fileName, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetPEFileName(CLRDATA_ADDRESS addr, unsigned int count, _Inout_updates_z_(count) WCHAR *fileName, unsigned int *pNeeded);
virtual HRESULT STDMETHODCALLTYPE GetAssemblyModuleList(CLRDATA_ADDRESS assembly, unsigned int count, CLRDATA_ADDRESS modules[], unsigned int *pNeeded);
virtual HRESULT STDMETHODCALLTYPE GetGCHeapData(struct DacpGcHeapData *data);
virtual HRESULT STDMETHODCALLTYPE GetGCHeapList(unsigned int count, CLRDATA_ADDRESS heaps[], unsigned int *pNeeded);
@@ -1127,7 +1127,7 @@ class ClrDataAccess
virtual HRESULT STDMETHODCALLTYPE TraverseEHInfo(CLRDATA_ADDRESS ip, DUMPEHINFO pCallback, LPVOID token);
virtual HRESULT STDMETHODCALLTYPE GetStressLogAddress(CLRDATA_ADDRESS *stressLog);
virtual HRESULT STDMETHODCALLTYPE GetJitManagerList(unsigned int count, struct DacpJitManagerInfo managers[], unsigned int *pNeeded);
- virtual HRESULT STDMETHODCALLTYPE GetJitHelperFunctionName(CLRDATA_ADDRESS ip, unsigned int count, __out_z __inout_ecount(count) char *name, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetJitHelperFunctionName(CLRDATA_ADDRESS ip, unsigned int count, _Inout_updates_z_(count) char *name, unsigned int *pNeeded);
virtual HRESULT STDMETHODCALLTYPE GetJumpThunkTarget(T_CONTEXT *ctx, CLRDATA_ADDRESS *targetIP, CLRDATA_ADDRESS *targetMD);
virtual HRESULT STDMETHODCALLTYPE TraverseLoaderHeap(CLRDATA_ADDRESS loaderHeapAddr, VISITHEAP pCallback);
virtual HRESULT STDMETHODCALLTYPE GetCodeHeapList(CLRDATA_ADDRESS jitManager, unsigned int count, struct DacpJitCodeHeapInfo codeHeaps[], unsigned int *pNeeded);
@@ -1152,17 +1152,17 @@ class ClrDataAccess
virtual HRESULT STDMETHODCALLTYPE GetDacModuleHandle(HMODULE *phModule);
virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyList(CLRDATA_ADDRESS appDomain, int count, CLRDATA_ADDRESS values[], unsigned int *pNeeded);
- virtual HRESULT STDMETHODCALLTYPE GetPrivateBinPaths(CLRDATA_ADDRESS appDomain, int count, __out_z __inout_ecount(count) WCHAR *paths, unsigned int *pNeeded);
- virtual HRESULT STDMETHODCALLTYPE GetAssemblyLocation(CLRDATA_ADDRESS assembly, int count, __out_z __inout_ecount(count) WCHAR *location, unsigned int *pNeeded);
- virtual HRESULT STDMETHODCALLTYPE GetAppDomainConfigFile(CLRDATA_ADDRESS appDomain, int count, __out_z __inout_ecount(count) WCHAR *configFile, unsigned int *pNeeded);
- virtual HRESULT STDMETHODCALLTYPE GetApplicationBase(CLRDATA_ADDRESS appDomain, int count, __out_z __inout_ecount(count) WCHAR *base, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetPrivateBinPaths(CLRDATA_ADDRESS appDomain, int count, _Inout_updates_z_(count) WCHAR *paths, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetAssemblyLocation(CLRDATA_ADDRESS assembly, int count, _Inout_updates_z_(count) WCHAR *location, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetAppDomainConfigFile(CLRDATA_ADDRESS appDomain, int count, _Inout_updates_z_(count) WCHAR *configFile, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetApplicationBase(CLRDATA_ADDRESS appDomain, int count, _Inout_updates_z_(count) WCHAR *base, unsigned int *pNeeded);
virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyData(CLRDATA_ADDRESS assembly, unsigned int *pContext, HRESULT *pResult);
- virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyLocation(CLRDATA_ADDRESS assembly, unsigned int count, __out_z __inout_ecount(count) WCHAR *location, unsigned int *pNeeded);
- virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyDisplayName(CLRDATA_ADDRESS assembly, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyLocation(CLRDATA_ADDRESS assembly, unsigned int count, _Inout_updates_z_(count) WCHAR *location, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyDisplayName(CLRDATA_ADDRESS assembly, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded);
virtual HRESULT STDMETHODCALLTYPE GetStackReferences(DWORD osThreadID, ISOSStackRefEnum **ppEnum);
- virtual HRESULT STDMETHODCALLTYPE GetRegisterName(int regNum, unsigned int count, __out_z __inout_ecount(count) WCHAR *buffer, unsigned int *pNeeded);
+ virtual HRESULT STDMETHODCALLTYPE GetRegisterName(int regNum, unsigned int count, _Inout_updates_z_(count) WCHAR *buffer, unsigned int *pNeeded);
virtual HRESULT STDMETHODCALLTYPE GetHandleEnum(ISOSHandleEnum **ppHandleEnum);
virtual HRESULT STDMETHODCALLTYPE GetHandleEnumForTypes(unsigned int types[], unsigned int count, ISOSHandleEnum **ppHandleEnum);
@@ -1244,12 +1244,12 @@ class ClrDataAccess
HRESULT GetFullMethodName(IN MethodDesc* methodDesc,
IN ULONG32 symbolChars,
IN ULONG32* symbolLen,
- __out_ecount_part_opt(symbolChars, *symbolLen) LPWSTR symbol);
+ _Out_writes_to_opt_(symbolChars, *symbolLen) LPWSTR symbol);
HRESULT RawGetMethodName(/* [in] */ CLRDATA_ADDRESS address,
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_opt(bufLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_bytes_opt_(bufLen) WCHAR nameBuf[ ],
/* [out] */ CLRDATA_ADDRESS* displacement);
HRESULT FollowStubStep(
@@ -1512,17 +1512,17 @@ class ClrDataAccess
DWORD &dwDataSize,
DWORD &dwRvaHint,
bool &isNGEN,
- __out_ecount(cchFilePath) LPWSTR wszFilePath,
+ _Out_writes_(cchFilePath) LPWSTR wszFilePath,
DWORD cchFilePath);
static bool GetILImageInfoFromNgenPEFile(PEAssembly *pPEAssembly,
DWORD &dwTimeStamp,
DWORD &dwSize,
- __out_ecount(cchPath) LPWSTR wszPath,
+ _Out_writes_(cchPath) LPWSTR wszPath,
const DWORD cchPath);
#if defined(FEATURE_CORESYSTEM)
static bool GetILImageNameFromNgenImage(LPCWSTR ilExtension,
- __out_ecount(cchFilePath) LPWSTR wszFilePath,
+ _Out_writes_(cchFilePath) LPWSTR wszFilePath,
const DWORD cchFilePath);
#endif // FEATURE_CORESYSTEM
};
@@ -2348,7 +2348,7 @@ class ClrDataAppDomain : public IXCLRDataAppDomain
virtual HRESULT STDMETHODCALLTYPE GetName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]);
virtual HRESULT STDMETHODCALLTYPE GetUniqueID(
/* [out] */ ULONG64 *id);
@@ -2429,17 +2429,17 @@ class ClrDataAssembly : public IXCLRDataAssembly
virtual HRESULT STDMETHODCALLTYPE GetName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]);
virtual HRESULT STDMETHODCALLTYPE GetFileName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]);
virtual HRESULT STDMETHODCALLTYPE GetDisplayName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]);
virtual HRESULT STDMETHODCALLTYPE GetFlags(
/* [out] */ ULONG32 *flags);
@@ -2601,12 +2601,12 @@ class ClrDataModule : public IXCLRDataModule, IXCLRDataModule2
virtual HRESULT STDMETHODCALLTYPE GetName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]);
virtual HRESULT STDMETHODCALLTYPE GetFileName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]);
virtual HRESULT STDMETHODCALLTYPE GetVersionId(
/* [out] */ GUID* vid);
@@ -2747,7 +2747,7 @@ class ClrDataTypeDefinition : public IXCLRDataTypeDefinition
/* [out][in] */ CLRDATA_ENUM *handle,
/* [in] */ ULONG32 nameBufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataTypeDefinition **type,
/* [out] */ ULONG32 *flags,
/* [out] */ mdFieldDef *token);
@@ -2756,7 +2756,7 @@ class ClrDataTypeDefinition : public IXCLRDataTypeDefinition
/* [out][in] */ CLRDATA_ENUM *handle,
/* [in] */ ULONG32 nameBufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataTypeDefinition **type,
/* [out] */ ULONG32 *flags,
/* [out] */ IXCLRDataModule** tokenScope,
@@ -2791,7 +2791,7 @@ class ClrDataTypeDefinition : public IXCLRDataTypeDefinition
/* [in] */ mdFieldDef token,
/* [in] */ ULONG32 nameBufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataTypeDefinition **type,
/* [out] */ ULONG32* flags);
@@ -2800,7 +2800,7 @@ class ClrDataTypeDefinition : public IXCLRDataTypeDefinition
/* [in] */ mdFieldDef token,
/* [in] */ ULONG32 nameBufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataTypeDefinition **type,
/* [out] */ ULONG32* flags);
@@ -2808,7 +2808,7 @@ class ClrDataTypeDefinition : public IXCLRDataTypeDefinition
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]);
virtual HRESULT STDMETHODCALLTYPE GetTokenAndScope(
/* [out] */ mdTypeDef *token,
@@ -2918,7 +2918,7 @@ class ClrDataTypeInstance : public IXCLRDataTypeInstance
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ mdFieldDef *token);
virtual HRESULT STDMETHODCALLTYPE StartEnumStaticFieldsByName(
@@ -2952,7 +2952,7 @@ class ClrDataTypeInstance : public IXCLRDataTypeInstance
/* [out] */ IXCLRDataValue **value,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataModule** tokenScope,
/* [out] */ mdFieldDef *token);
@@ -2985,7 +2985,7 @@ class ClrDataTypeInstance : public IXCLRDataTypeInstance
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]);
virtual HRESULT STDMETHODCALLTYPE GetStaticFieldByToken2(
/* [in] */ IXCLRDataModule* tokenScope,
@@ -2994,13 +2994,13 @@ class ClrDataTypeInstance : public IXCLRDataTypeInstance
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]);
virtual HRESULT STDMETHODCALLTYPE GetName(
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]);
virtual HRESULT STDMETHODCALLTYPE GetModule(
/* [out] */ IXCLRDataModule **mod);
@@ -3095,7 +3095,7 @@ class ClrDataMethodDefinition : public IXCLRDataMethodDefinition
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]);
virtual HRESULT STDMETHODCALLTYPE GetTokenAndScope(
/* [out] */ mdMethodDef *token,
@@ -3200,7 +3200,7 @@ class ClrDataMethodInstance : public IXCLRDataMethodInstance
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]);
virtual HRESULT STDMETHODCALLTYPE GetFlags(
/* [out] */ ULONG32 *flags);
@@ -3304,7 +3304,7 @@ class ClrDataTask : public IXCLRDataTask
virtual HRESULT STDMETHODCALLTYPE GetName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]);
virtual HRESULT STDMETHODCALLTYPE GetUniqueID(
/* [out] */ ULONG64 *id);
@@ -3500,7 +3500,7 @@ class ClrDataFrame : public IXCLRDataFrame,
/* [out] */ IXCLRDataValue **arg,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]);
virtual HRESULT STDMETHODCALLTYPE GetNumLocalVariables(
/* [out] */ ULONG32 *numLocals);
@@ -3510,7 +3510,7 @@ class ClrDataFrame : public IXCLRDataFrame,
/* [out] */ IXCLRDataValue **localVariable,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]);
virtual HRESULT STDMETHODCALLTYPE GetNumTypeArguments(
/* [out] */ ULONG32 *numTypeArgs);
@@ -3523,7 +3523,7 @@ class ClrDataFrame : public IXCLRDataFrame,
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_opt(bufLen) WCHAR nameBuf[ ]);
+ /* [size_is][out] */ _Out_writes_bytes_opt_(bufLen) WCHAR nameBuf[ ]);
virtual HRESULT STDMETHODCALLTYPE GetMethodInstance(
/* [out] */ IXCLRDataMethodInstance **method);
@@ -3620,7 +3620,7 @@ class ClrDataExceptionState : public IXCLRDataExceptionState
virtual HRESULT STDMETHODCALLTYPE GetString(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *strLen,
- /* [size_is][out] */ __out_ecount_part(bufLen, *strLen) WCHAR str[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *strLen) WCHAR str[ ]);
virtual HRESULT STDMETHODCALLTYPE IsSameState(
/* [in] */ EXCEPTION_RECORD64 *exRecord,
@@ -3724,7 +3724,7 @@ class ClrDataValue : public IXCLRDataValue
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ mdFieldDef *token);
virtual HRESULT STDMETHODCALLTYPE GetNumFields2(
@@ -3742,7 +3742,7 @@ class ClrDataValue : public IXCLRDataValue
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 nameBufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ mdFieldDef *token);
virtual HRESULT STDMETHODCALLTYPE EnumField2(
@@ -3750,7 +3750,7 @@ class ClrDataValue : public IXCLRDataValue
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 nameBufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataModule** tokenScope,
/* [out] */ mdFieldDef *token);
@@ -3783,7 +3783,7 @@ class ClrDataValue : public IXCLRDataValue
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]);
virtual HRESULT STDMETHODCALLTYPE GetFieldByToken2(
/* [in] */ IXCLRDataModule* tokenScope,
@@ -3791,7 +3791,7 @@ class ClrDataValue : public IXCLRDataValue
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]);
virtual HRESULT STDMETHODCALLTYPE GetAssociatedValue(
/* [out] */ IXCLRDataValue **assocValue);
@@ -3802,7 +3802,7 @@ class ClrDataValue : public IXCLRDataValue
virtual HRESULT STDMETHODCALLTYPE GetString(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *strLen,
- /* [size_is][out] */ __out_ecount_part(bufLen, *strLen) WCHAR str[ ]);
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *strLen) WCHAR str[ ]);
virtual HRESULT STDMETHODCALLTYPE GetArrayProperties(
/* [out] */ ULONG32 *rank,
@@ -3844,7 +3844,7 @@ class ClrDataValue : public IXCLRDataValue
IXCLRDataValue** pubValue,
ULONG32 nameBufRetLen,
ULONG32* nameLenRet,
- __out_ecount_part_opt(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ],
+ _Out_writes_to_opt_(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ],
IXCLRDataModule** tokenScopeRet,
mdFieldDef* tokenRet);
@@ -3854,7 +3854,7 @@ class ClrDataValue : public IXCLRDataValue
IXCLRDataValue** pubValue,
ULONG32 nameBufRetLen,
ULONG32* nameLenRet,
- __out_ecount_part_opt(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ],
+ _Out_writes_to_opt_(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ],
IXCLRDataModule** tokenScopeRet,
mdFieldDef* tokenRet)
{
diff --git a/src/coreclr/debug/daccess/inspect.cpp b/src/coreclr/debug/daccess/inspect.cpp
index 21afb220103cb6..0a3138c5b77dbd 100644
--- a/src/coreclr/debug/daccess/inspect.cpp
+++ b/src/coreclr/debug/daccess/inspect.cpp
@@ -574,7 +574,7 @@ ClrDataValue::GetFieldByIndex(
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ mdFieldDef *token)
{
// XXX Microsoft - Obsolete method, never implemented.
@@ -661,7 +661,7 @@ ClrDataValue::EnumField(
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 nameBufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ mdFieldDef *token)
{
return EnumField2(handle, field, nameBufLen, nameLen, nameBuf,
@@ -674,7 +674,7 @@ ClrDataValue::EnumField2(
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 nameBufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataModule** tokenScope,
/* [out] */ mdFieldDef *token)
{
@@ -839,7 +839,7 @@ ClrDataValue::GetFieldByToken(
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ])
{
return GetFieldByToken2(NULL, token, field, bufLen, nameLen, nameBuf);
}
@@ -851,7 +851,7 @@ ClrDataValue::GetFieldByToken2(
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ])
{
HRESULT status;
@@ -1029,7 +1029,7 @@ HRESULT STDMETHODCALLTYPE
ClrDataValue::GetString(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *strLen,
- /* [size_is][out] */ __out_ecount_part(bufLen, *strLen) WCHAR str[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *strLen) WCHAR str[ ])
{
HRESULT status;
@@ -1381,7 +1381,7 @@ ClrDataValue::NewFromFieldDesc(ClrDataAccess* dac,
IXCLRDataValue** pubValue,
ULONG32 nameBufRetLen,
ULONG32 *nameLenRet,
- __out_ecount_part_opt(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ],
+ _Out_writes_to_opt_(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ],
IXCLRDataModule** tokenScopeRet,
mdFieldDef *tokenRet)
{
@@ -1991,7 +1991,7 @@ ClrDataTypeDefinition::EnumField(
/* [out][in] */ CLRDATA_ENUM *handle,
/* [in] */ ULONG32 nameBufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataTypeDefinition **type,
/* [out] */ ULONG32 *flags,
/* [out] */ mdFieldDef *token)
@@ -2005,7 +2005,7 @@ ClrDataTypeDefinition::EnumField2(
/* [out][in] */ CLRDATA_ENUM *handle,
/* [in] */ ULONG32 nameBufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataTypeDefinition **type,
/* [out] */ ULONG32 *flags,
/* [out] */ IXCLRDataModule** tokenScope,
@@ -2180,7 +2180,7 @@ ClrDataTypeDefinition::GetFieldByToken(
/* [in] */ mdFieldDef token,
/* [in] */ ULONG32 nameBufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataTypeDefinition **type,
/* [out] */ ULONG32 *flags)
{
@@ -2194,7 +2194,7 @@ ClrDataTypeDefinition::GetFieldByToken2(
/* [in] */ mdFieldDef token,
/* [in] */ ULONG32 nameBufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataTypeDefinition **type,
/* [out] */ ULONG32 *flags)
{
@@ -2276,7 +2276,7 @@ ClrDataTypeDefinition::GetName(
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ])
{
HRESULT status = S_OK;
@@ -3014,7 +3014,7 @@ ClrDataTypeInstance::GetStaticFieldByIndex(
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ mdFieldDef *token)
{
HRESULT status;
@@ -3186,7 +3186,7 @@ ClrDataTypeInstance::EnumStaticField2(
/* [out] */ IXCLRDataValue **value,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ],
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ],
/* [out] */ IXCLRDataModule** tokenScope,
/* [out] */ mdFieldDef *token)
{
@@ -3351,7 +3351,7 @@ ClrDataTypeInstance::GetStaticFieldByToken(
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ])
{
return GetStaticFieldByToken2(NULL, token, tlsTask, field,
bufLen, nameLen, nameBuf);
@@ -3365,7 +3365,7 @@ ClrDataTypeInstance::GetStaticFieldByToken2(
/* [out] */ IXCLRDataValue **field,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ])
{
HRESULT status;
@@ -3430,7 +3430,7 @@ ClrDataTypeInstance::GetName(
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ])
{
HRESULT status = S_OK;
diff --git a/src/coreclr/debug/daccess/request.cpp b/src/coreclr/debug/daccess/request.cpp
index fe66a8b30b4212..1e327721f4a92d 100644
--- a/src/coreclr/debug/daccess/request.cpp
+++ b/src/coreclr/debug/daccess/request.cpp
@@ -580,7 +580,7 @@ ClrDataAccess::GetStackLimits(CLRDATA_ADDRESS threadPtr, CLRDATA_ADDRESS *lower,
}
HRESULT
-ClrDataAccess::GetRegisterName(int regNum, unsigned int count, __out_z __inout_ecount(count) WCHAR *buffer, unsigned int *pNeeded)
+ClrDataAccess::GetRegisterName(int regNum, unsigned int count, _Inout_updates_z_(count) WCHAR *buffer, unsigned int *pNeeded)
{
if (!buffer && !pNeeded)
return E_POINTER;
@@ -1322,7 +1322,7 @@ ClrDataAccess::GetMethodDescPtrFromIP(CLRDATA_ADDRESS ip, CLRDATA_ADDRESS * ppMD
}
HRESULT
-ClrDataAccess::GetMethodDescName(CLRDATA_ADDRESS methodDesc, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded)
+ClrDataAccess::GetMethodDescName(CLRDATA_ADDRESS methodDesc, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded)
{
if (methodDesc == 0)
return E_INVALIDARG;
@@ -1426,7 +1426,7 @@ ClrDataAccess::GetDomainFromContext(CLRDATA_ADDRESS contextAddr, CLRDATA_ADDRESS
HRESULT
-ClrDataAccess::GetObjectStringData(CLRDATA_ADDRESS obj, unsigned int count, __out_z __inout_ecount(count) WCHAR *stringData, unsigned int *pNeeded)
+ClrDataAccess::GetObjectStringData(CLRDATA_ADDRESS obj, unsigned int count, _Inout_updates_z_(count) WCHAR *stringData, unsigned int *pNeeded)
{
if (obj == 0)
return E_INVALIDARG;
@@ -1478,7 +1478,7 @@ ClrDataAccess::GetObjectStringData(CLRDATA_ADDRESS obj, unsigned int count, __ou
}
HRESULT
-ClrDataAccess::GetObjectClassName(CLRDATA_ADDRESS obj, unsigned int count, __out_z __inout_ecount(count) WCHAR *className, unsigned int *pNeeded)
+ClrDataAccess::GetObjectClassName(CLRDATA_ADDRESS obj, unsigned int count, _Inout_updates_z_(count) WCHAR *className, unsigned int *pNeeded)
{
if (obj == 0)
return E_INVALIDARG;
@@ -1740,7 +1740,7 @@ ClrDataAccess::GetMethodTableData(CLRDATA_ADDRESS mt, struct DacpMethodTableData
}
HRESULT
-ClrDataAccess::GetMethodTableName(CLRDATA_ADDRESS mt, unsigned int count, __out_z __inout_ecount(count) WCHAR *mtName, unsigned int *pNeeded)
+ClrDataAccess::GetMethodTableName(CLRDATA_ADDRESS mt, unsigned int count, _Inout_updates_z_(count) WCHAR *mtName, unsigned int *pNeeded)
{
if (mt == 0)
return E_INVALIDARG;
@@ -2003,7 +2003,7 @@ ClrDataAccess::GetMethodTableForEEClass(CLRDATA_ADDRESS eeClass, CLRDATA_ADDRESS
}
HRESULT
-ClrDataAccess::GetFrameName(CLRDATA_ADDRESS vtable, unsigned int count, __out_z __inout_ecount(count) WCHAR *frameName, unsigned int *pNeeded)
+ClrDataAccess::GetFrameName(CLRDATA_ADDRESS vtable, unsigned int count, _Inout_updates_z_(count) WCHAR *frameName, unsigned int *pNeeded)
{
if (vtable == 0)
return E_INVALIDARG;
@@ -2043,7 +2043,7 @@ ClrDataAccess::GetFrameName(CLRDATA_ADDRESS vtable, unsigned int count, __out_z
}
HRESULT
-ClrDataAccess::GetPEFileName(CLRDATA_ADDRESS addr, unsigned int count, __out_z __inout_ecount(count) WCHAR *fileName, unsigned int *pNeeded)
+ClrDataAccess::GetPEFileName(CLRDATA_ADDRESS addr, unsigned int count, _Inout_updates_z_(count) WCHAR *fileName, unsigned int *pNeeded)
{
if (addr == 0 || (fileName == NULL && pNeeded == NULL) || (fileName != NULL && count == 0))
return E_INVALIDARG;
@@ -2369,7 +2369,7 @@ ClrDataAccess::GetFailedAssemblyData(CLRDATA_ADDRESS assembly, unsigned int *pCo
HRESULT
ClrDataAccess::GetFailedAssemblyLocation(CLRDATA_ADDRESS assembly, unsigned int count,
- __out_z __inout_ecount(count) WCHAR *location, unsigned int *pNeeded)
+ _Inout_updates_z_(count) WCHAR *location, unsigned int *pNeeded)
{
if (assembly == NULL || (location == NULL && pNeeded == NULL) || (location != NULL && count == 0))
return E_INVALIDARG;
@@ -2399,7 +2399,7 @@ ClrDataAccess::GetFailedAssemblyLocation(CLRDATA_ADDRESS assembly, unsigned int
}
HRESULT
-ClrDataAccess::GetFailedAssemblyDisplayName(CLRDATA_ADDRESS assembly, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded)
+ClrDataAccess::GetFailedAssemblyDisplayName(CLRDATA_ADDRESS assembly, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded)
{
if (assembly == NULL || (name == NULL && pNeeded == NULL) || (name != NULL && count == 0))
return E_INVALIDARG;
@@ -2509,7 +2509,7 @@ ClrDataAccess::GetFailedAssemblyList(CLRDATA_ADDRESS appDomain, int count,
}
HRESULT
-ClrDataAccess::GetAppDomainName(CLRDATA_ADDRESS addr, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded)
+ClrDataAccess::GetAppDomainName(CLRDATA_ADDRESS addr, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded)
{
SOSDacEnter();
@@ -2550,7 +2550,7 @@ ClrDataAccess::GetAppDomainName(CLRDATA_ADDRESS addr, unsigned int count, __out_
HRESULT
ClrDataAccess::GetApplicationBase(CLRDATA_ADDRESS appDomain, int count,
- __out_z __inout_ecount(count) WCHAR *base, unsigned int *pNeeded)
+ _Inout_updates_z_(count) WCHAR *base, unsigned int *pNeeded)
{
// Method is not supported on CoreCLR
@@ -2559,7 +2559,7 @@ ClrDataAccess::GetApplicationBase(CLRDATA_ADDRESS appDomain, int count,
HRESULT
ClrDataAccess::GetPrivateBinPaths(CLRDATA_ADDRESS appDomain, int count,
- __out_z __inout_ecount(count) WCHAR *paths, unsigned int *pNeeded)
+ _Inout_updates_z_(count) WCHAR *paths, unsigned int *pNeeded)
{
// Method is not supported on CoreCLR
@@ -2568,7 +2568,7 @@ ClrDataAccess::GetPrivateBinPaths(CLRDATA_ADDRESS appDomain, int count,
HRESULT
ClrDataAccess::GetAppDomainConfigFile(CLRDATA_ADDRESS appDomain, int count,
- __out_z __inout_ecount(count) WCHAR *configFile, unsigned int *pNeeded)
+ _Inout_updates_z_(count) WCHAR *configFile, unsigned int *pNeeded)
{
// Method is not supported on CoreCLR
@@ -2620,7 +2620,7 @@ ClrDataAccess::GetAssemblyData(CLRDATA_ADDRESS cdBaseDomainPtr, CLRDATA_ADDRESS
}
HRESULT
-ClrDataAccess::GetAssemblyName(CLRDATA_ADDRESS assembly, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded)
+ClrDataAccess::GetAssemblyName(CLRDATA_ADDRESS assembly, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded)
{
SOSDacEnter();
Assembly* pAssembly = PTR_Assembly(TO_TADDR(assembly));
@@ -2661,7 +2661,7 @@ ClrDataAccess::GetAssemblyName(CLRDATA_ADDRESS assembly, unsigned int count, __o
}
HRESULT
-ClrDataAccess::GetAssemblyLocation(CLRDATA_ADDRESS assembly, int count, __out_z __inout_ecount(count) WCHAR *location, unsigned int *pNeeded)
+ClrDataAccess::GetAssemblyLocation(CLRDATA_ADDRESS assembly, int count, _Inout_updates_z_(count) WCHAR *location, unsigned int *pNeeded)
{
if ((assembly == NULL) || (location == NULL && pNeeded == NULL) || (location != NULL && count == 0))
{
@@ -3636,7 +3636,7 @@ ClrDataAccess::GetSyncBlockCleanupData(CLRDATA_ADDRESS syncBlock, struct DacpSyn
}
HRESULT
-ClrDataAccess::GetJitHelperFunctionName(CLRDATA_ADDRESS ip, unsigned int count, __out_z __inout_ecount(count) char *name, unsigned int *pNeeded)
+ClrDataAccess::GetJitHelperFunctionName(CLRDATA_ADDRESS ip, unsigned int count, _Inout_updates_z_(count) char *name, unsigned int *pNeeded)
{
SOSDacEnter();
diff --git a/src/coreclr/debug/daccess/stack.cpp b/src/coreclr/debug/daccess/stack.cpp
index 6ced6d60b35391..dfcb16c31523f3 100644
--- a/src/coreclr/debug/daccess/stack.cpp
+++ b/src/coreclr/debug/daccess/stack.cpp
@@ -787,7 +787,7 @@ ClrDataFrame::GetArgumentByIndex(
/* [out] */ IXCLRDataValue **arg,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ])
{
HRESULT status;
@@ -942,7 +942,7 @@ ClrDataFrame::GetLocalVariableByIndex(
/* [out] */ IXCLRDataValue **localVariable,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ])
{
HRESULT status;
@@ -1111,7 +1111,7 @@ ClrDataFrame::GetCodeName(
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *symbolLen,
- /* [size_is][out] */ __out_ecount_opt(bufLen) WCHAR symbolBuf[ ])
+ /* [size_is][out] */ _Out_writes_bytes_opt_(bufLen) WCHAR symbolBuf[ ])
{
HRESULT status = E_FAIL;
diff --git a/src/coreclr/debug/daccess/task.cpp b/src/coreclr/debug/daccess/task.cpp
index 42c4e0becce1c1..30abc5e090cc9e 100644
--- a/src/coreclr/debug/daccess/task.cpp
+++ b/src/coreclr/debug/daccess/task.cpp
@@ -149,7 +149,7 @@ HRESULT STDMETHODCALLTYPE
ClrDataTask::GetName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ])
{
HRESULT status;
@@ -713,7 +713,7 @@ HRESULT STDMETHODCALLTYPE
ClrDataAppDomain::GetName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ])
{
HRESULT status = S_OK;
@@ -1132,7 +1132,7 @@ HRESULT STDMETHODCALLTYPE
ClrDataAssembly::GetName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ])
{
HRESULT status;
@@ -1160,7 +1160,7 @@ HRESULT STDMETHODCALLTYPE
ClrDataAssembly::GetFileName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ])
{
HRESULT status;
@@ -1201,7 +1201,7 @@ HRESULT STDMETHODCALLTYPE
ClrDataAssembly::GetDisplayName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ])
{
HRESULT status;
@@ -2376,7 +2376,7 @@ HRESULT STDMETHODCALLTYPE
ClrDataModule::GetName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ])
{
HRESULT status;
@@ -2404,7 +2404,7 @@ HRESULT STDMETHODCALLTYPE
ClrDataModule::GetFileName(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ])
{
HRESULT status;
@@ -3115,7 +3115,7 @@ ClrDataMethodDefinition::GetName(
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ])
{
HRESULT status;
@@ -3858,7 +3858,7 @@ ClrDataMethodInstance::GetName(
/* [in] */ ULONG32 flags,
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *nameLen,
- /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ])
{
HRESULT status;
@@ -4735,7 +4735,7 @@ HRESULT STDMETHODCALLTYPE
ClrDataExceptionState::GetString(
/* [in] */ ULONG32 bufLen,
/* [out] */ ULONG32 *strLen,
- /* [size_is][out] */ __out_ecount_part(bufLen, *strLen) WCHAR str[ ])
+ /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *strLen) WCHAR str[ ])
{
HRESULT status = E_FAIL;
diff --git a/src/coreclr/debug/dbgutil/machoreader.cpp b/src/coreclr/debug/dbgutil/machoreader.cpp
index d2801547cb9ba9..7fef34e1afb16d 100644
--- a/src/coreclr/debug/dbgutil/machoreader.cpp
+++ b/src/coreclr/debug/dbgutil/machoreader.cpp
@@ -229,9 +229,8 @@ MachOModule::ReadLoadCommands()
m_segments.push_back(segment);
// Calculate the load bias for the module. This is the value to add to the vmaddr of a
- // segment to get the actual address. For shared modules, this is 0 since those segments
- // are absolute address.
- if (segment->fileoff == 0 && segment->filesize > 0)
+ // segment to get the actual address.
+ if (strcmp(segment->segname, SEG_TEXT) == 0)
{
m_loadBias = m_baseAddress - segment->vmaddr;
}
diff --git a/src/coreclr/debug/di/cordb.cpp b/src/coreclr/debug/di/cordb.cpp
index 2c11397fcd3bc7..e195f3731a9e6f 100644
--- a/src/coreclr/debug/di/cordb.cpp
+++ b/src/coreclr/debug/di/cordb.cpp
@@ -443,10 +443,10 @@ STDAPI GetRequestedRuntimeInfo(LPCWSTR pExe,
LPCWSTR pConfigurationFile,
DWORD startupFlags,
DWORD runtimeInfoFlags,
- __out_ecount_opt(dwDirectory) LPWSTR pDirectory,
+ _Out_writes_bytes_opt_(dwDirectory) LPWSTR pDirectory,
DWORD dwDirectory,
DWORD *dwDirectoryLength,
- __out_ecount_opt(cchBuffer) LPWSTR pVersion,
+ _Out_writes_bytes_opt_(cchBuffer) LPWSTR pVersion,
DWORD cchBuffer,
DWORD* dwlength)
{
diff --git a/src/coreclr/debug/di/divalue.cpp b/src/coreclr/debug/di/divalue.cpp
index 2e70a306180c59..b8c9e745260db2 100644
--- a/src/coreclr/debug/di/divalue.cpp
+++ b/src/coreclr/debug/di/divalue.cpp
@@ -2320,7 +2320,7 @@ HRESULT CordbObjectValue::GetLength(ULONG32 *pcchString)
// Return Value: S_OK or CORDBG_E_INVALID_OBJECT, CORDBG_E_OBJECT_NEUTERED, or E_INVALIDARG on failure
HRESULT CordbObjectValue::GetString(ULONG32 cchString,
ULONG32 *pcchString,
- __out_ecount_opt(cchString) WCHAR szString[])
+ _Out_writes_bytes_opt_(cchString) WCHAR szString[])
{
PUBLIC_REENTRANT_API_ENTRY(this);
FAIL_IF_NEUTERED(this);
diff --git a/src/coreclr/debug/di/module.cpp b/src/coreclr/debug/di/module.cpp
index 9951d4a6af305f..6d6a7a55befa2e 100644
--- a/src/coreclr/debug/di/module.cpp
+++ b/src/coreclr/debug/di/module.cpp
@@ -1256,7 +1256,7 @@ HRESULT CordbModule::GetAssembly(ICorDebugAssembly **ppAssembly)
// Public implementation of ICorDebugModule::GetName,
// wrapper around code:GetNameWorker (which throws).
-HRESULT CordbModule::GetName(ULONG32 cchName, ULONG32 *pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[])
+HRESULT CordbModule::GetName(ULONG32 cchName, ULONG32 *pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[])
{
HRESULT hr = S_OK;
PUBLIC_API_BEGIN(this)
@@ -1324,7 +1324,7 @@ HRESULT CordbModule::GetName(ULONG32 cchName, ULONG32 *pcchName, __out_ecount_pa
// Note:
// Filename isn't necessarily the same as the module name in the metadata.
//
-HRESULT CordbModule::GetNameWorker(ULONG32 cchName, ULONG32 *pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[])
+HRESULT CordbModule::GetNameWorker(ULONG32 cchName, ULONG32 *pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[])
{
CONTRACTL
{
diff --git a/src/coreclr/debug/di/process.cpp b/src/coreclr/debug/di/process.cpp
index 9b21fa47e67285..59af4cc8d9c649 100644
--- a/src/coreclr/debug/di/process.cpp
+++ b/src/coreclr/debug/di/process.cpp
@@ -1111,7 +1111,7 @@ HRESULT ShimProcess::CreateProcess(
Cordb * pCordb,
ICorDebugRemoteTarget * pRemoteTarget,
LPCWSTR szProgramName,
- __in_z LPWSTR szProgramArgs,
+ _In_z_ LPWSTR szProgramArgs,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL fInheritHandles,
@@ -8624,7 +8624,7 @@ HRESULT CordbProcess::EnableLogMessages(BOOL fOnOff)
/*
* ModifyLogSwitch modifies the specified switch's severity level.
*/
-COM_METHOD CordbProcess::ModifyLogSwitch(__in_z WCHAR *pLogSwitchName, LONG lLevel)
+COM_METHOD CordbProcess::ModifyLogSwitch(_In_z_ WCHAR *pLogSwitchName, LONG lLevel)
{
PUBLIC_API_ENTRY(this);
FAIL_IF_NEUTERED(this);
@@ -13674,7 +13674,7 @@ void CordbWin32EventThread::ForceDbgContinue(CordbProcess *pProcess, CordbUnmana
HRESULT CordbWin32EventThread::SendCreateProcessEvent(
MachineInfo machineInfo,
LPCWSTR programName,
- __in_z LPWSTR programArgs,
+ _In_z_ LPWSTR programArgs,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
diff --git a/src/coreclr/debug/di/publish.cpp b/src/coreclr/debug/di/publish.cpp
index 23003b980ad9f1..1d7741fb9ea75b 100644
--- a/src/coreclr/debug/di/publish.cpp
+++ b/src/coreclr/debug/di/publish.cpp
@@ -658,7 +658,7 @@ HRESULT AllocateAndReadRemoteString(
HANDLE hProcess,
void * pRemotePtr,
SIZE_T cbSize, // size of buffer to allocate + copy.
- __deref_out_bcount(cbSize) WCHAR * * ppNewLocalBuffer
+ _Outptr_result_bytebuffer_(cbSize) WCHAR * * ppNewLocalBuffer
)
{
// Make sure buffer has right geometry.
@@ -902,7 +902,7 @@ HRESULT CorpubProcess::GetProcessID(unsigned *pid)
*/
HRESULT CorpubProcess::GetDisplayName(ULONG32 cchName,
ULONG32 *pcchName,
- __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[])
+ _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[])
{
VALIDATE_POINTER_TO_OBJECT_ARRAY_OR_NULL(szName, WCHAR, cchName, true, true);
VALIDATE_POINTER_TO_OBJECT_OR_NULL(pcchName, ULONG32 *);
@@ -928,7 +928,7 @@ HRESULT CorpubProcess::GetDisplayName(ULONG32 cchName,
// CorpubAppDomain
// ******************************************
-CorpubAppDomain::CorpubAppDomain (__in LPWSTR szAppDomainName, ULONG Id)
+CorpubAppDomain::CorpubAppDomain (_In_ LPWSTR szAppDomainName, ULONG Id)
: CordbCommonBase (0, enumCorpubAppDomain),
m_pNext (NULL),
m_szAppDomainName (szAppDomainName),
@@ -976,7 +976,7 @@ HRESULT CorpubAppDomain::GetID (ULONG32 *pId)
*/
HRESULT CorpubAppDomain::GetName(ULONG32 cchName,
ULONG32 *pcchName,
- __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[])
+ _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[])
{
VALIDATE_POINTER_TO_OBJECT_ARRAY_OR_NULL(szName, WCHAR, cchName, true, true);
VALIDATE_POINTER_TO_OBJECT_OR_NULL(pcchName, ULONG32 *);
diff --git a/src/coreclr/debug/di/rsappdomain.cpp b/src/coreclr/debug/di/rsappdomain.cpp
index 6b4da4ee206027..081baa95216d5b 100644
--- a/src/coreclr/debug/di/rsappdomain.cpp
+++ b/src/coreclr/debug/di/rsappdomain.cpp
@@ -700,7 +700,7 @@ HRESULT CordbAppDomain::Attach()
*/
HRESULT CordbAppDomain::GetName(ULONG32 cchName,
ULONG32 *pcchName,
- __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[])
+ _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[])
{
HRESULT hr = S_OK;
PUBLIC_API_BEGIN(this)
diff --git a/src/coreclr/debug/di/rsassembly.cpp b/src/coreclr/debug/di/rsassembly.cpp
index b7b7d6756391d7..73c864f6e2159a 100644
--- a/src/coreclr/debug/di/rsassembly.cpp
+++ b/src/coreclr/debug/di/rsassembly.cpp
@@ -202,7 +202,7 @@ HRESULT CordbAssembly::EnumerateModules(ICorDebugModuleEnum **ppModules)
*/
HRESULT CordbAssembly::GetCodeBase(ULONG32 cchName,
ULONG32 *pcchName,
- __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[])
+ _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[])
{
PUBLIC_API_ENTRY(this);
FAIL_IF_NEUTERED(this);
@@ -232,7 +232,7 @@ HRESULT CordbAssembly::GetCodeBase(ULONG32 cchName,
//
HRESULT CordbAssembly::GetName(ULONG32 cchName,
ULONG32 *pcchName,
- __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[])
+ _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[])
{
PUBLIC_API_ENTRY(this);
FAIL_IF_NEUTERED(this);
diff --git a/src/coreclr/debug/di/rsmain.cpp b/src/coreclr/debug/di/rsmain.cpp
index ff49f2186a40ca..5594b299e2d125 100644
--- a/src/coreclr/debug/di/rsmain.cpp
+++ b/src/coreclr/debug/di/rsmain.cpp
@@ -595,7 +595,7 @@ namespace
COM_METHOD CreateConnection(ICorDebugProcess *pProcess,
CONNID dwConnectionId,
- __in_z WCHAR* pConnectionName);
+ _In_z_ WCHAR* pConnectionName);
COM_METHOD ChangeConnection(ICorDebugProcess *pProcess, CONNID dwConnectionId);
COM_METHOD DestroyConnection(ICorDebugProcess *pProcess, CONNID dwConnectionId);
@@ -725,7 +725,7 @@ namespace
HRESULT
DefaultManagedCallback2::CreateConnection(ICorDebugProcess *pProcess,
CONNID dwConnectionId,
- __in_z WCHAR* pConnectionName)
+ _In_z_ WCHAR* pConnectionName)
{
_ASSERTE(!"DefaultManagedCallback2::CreateConnection not implemented");
return E_NOTIMPL;
@@ -1572,7 +1572,7 @@ bool Cordb::IsInteropDebuggingSupported()
//
//---------------------------------------------------------------------------------------
HRESULT Cordb::CreateProcess(LPCWSTR lpApplicationName,
- __in_z LPWSTR lpCommandLine,
+ _In_z_ LPWSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
@@ -1601,7 +1601,7 @@ HRESULT Cordb::CreateProcess(LPCWSTR lpApplicationName,
HRESULT Cordb::CreateProcessCommon(ICorDebugRemoteTarget * pRemoteTarget,
LPCWSTR lpApplicationName,
- __in_z LPWSTR lpCommandLine,
+ _In_z_ LPWSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
@@ -1735,7 +1735,7 @@ HRESULT Cordb::CreateProcessCommon(ICorDebugRemoteTarget * pRemoteTarget,
HRESULT Cordb::CreateProcessEx(ICorDebugRemoteTarget * pRemoteTarget,
LPCWSTR lpApplicationName,
- __in_z LPWSTR lpCommandLine,
+ _In_z_ LPWSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
diff --git a/src/coreclr/debug/di/rsmda.cpp b/src/coreclr/debug/di/rsmda.cpp
index 517e6dcfdeb015..822e9824a1d417 100644
--- a/src/coreclr/debug/di/rsmda.cpp
+++ b/src/coreclr/debug/di/rsmda.cpp
@@ -102,7 +102,7 @@ HRESULT CordbMDA::QueryInterface(REFIID riid, void **ppInterface)
//
// Returns: S_OK on success.
//-----------------------------------------------------------------------------
-HRESULT CopyOutString(LPCWSTR pInputString, ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[])
+HRESULT CopyOutString(LPCWSTR pInputString, ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[])
{
_ASSERTE(pInputString != NULL);
ULONG32 len = (ULONG32) wcslen(pInputString) + 1;
@@ -144,7 +144,7 @@ HRESULT CopyOutString(LPCWSTR pInputString, ULONG32 cchName, ULONG32 * pcchName,
// the type from that based off the schema.
// See CopyOutString for parameter details.
//-----------------------------------------------------------------------------
-HRESULT CordbMDA::GetName(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[])
+HRESULT CordbMDA::GetName(ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[])
{
HRESULT hr = S_OK;
PUBLIC_API_BEGIN(this)
@@ -159,7 +159,7 @@ HRESULT CordbMDA::GetName(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part
// Get a string description of the MDA. This may be empty (0-length).
// See CopyOutString for parameter details.
//-----------------------------------------------------------------------------
-HRESULT CordbMDA::GetDescription(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[])
+HRESULT CordbMDA::GetDescription(ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[])
{
HRESULT hr = S_OK;
PUBLIC_API_BEGIN(this)
@@ -176,7 +176,7 @@ HRESULT CordbMDA::GetDescription(ULONG32 cchName, ULONG32 * pcchName, __out_ecou
// See the MDA documentation for the schema for this XML stream.
// See CopyOutString for parameter details.
//-----------------------------------------------------------------------------
-HRESULT CordbMDA::GetXML(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[])
+HRESULT CordbMDA::GetXML(ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[])
{
HRESULT hr = S_OK;
PUBLIC_API_BEGIN(this)
diff --git a/src/coreclr/debug/di/rspriv.h b/src/coreclr/debug/di/rspriv.h
index a34dd0e6a07288..690917c2795a91 100644
--- a/src/coreclr/debug/di/rspriv.h
+++ b/src/coreclr/debug/di/rspriv.h
@@ -2211,7 +2211,7 @@ class Cordb : public CordbBase, public ICorDebug, public ICorDebugRemote
COM_METHOD SetManagedHandler(ICorDebugManagedCallback *pCallback);
COM_METHOD SetUnmanagedHandler(ICorDebugUnmanagedCallback *pCallback);
COM_METHOD CreateProcess(LPCWSTR lpApplicationName,
- __in_z LPWSTR lpCommandLine,
+ _In_z_ LPWSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
@@ -2243,7 +2243,7 @@ class Cordb : public CordbBase, public ICorDebug, public ICorDebugRemote
COM_METHOD CreateProcessEx(ICorDebugRemoteTarget * pRemoteTarget,
LPCWSTR lpApplicationName,
- __in_z LPWSTR lpCommandLine,
+ _In_z_ LPWSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
@@ -2267,7 +2267,7 @@ class Cordb : public CordbBase, public ICorDebug, public ICorDebugRemote
HRESULT CreateProcessCommon(ICorDebugRemoteTarget * pRemoteTarget,
LPCWSTR lpApplicationName,
- __in_z LPWSTR lpCommandLine,
+ _In_z_ LPWSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
@@ -2463,7 +2463,7 @@ class CordbAppDomain : public CordbBase,
// Returns the friendly name of the AppDomain
COM_METHOD GetName(ULONG32 cchName,
ULONG32 * pcchName,
- __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]);
+ _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]);
/*
* GetObject returns the runtime app domain object.
@@ -2646,12 +2646,12 @@ class CordbAssembly : public CordbBase, public ICorDebugAssembly, ICorDebugAssem
*/
COM_METHOD GetCodeBase(ULONG32 cchName,
ULONG32 * pcchName,
- __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]);
+ _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]);
// returns the filename of the assembly, or "" for in-memory assemblies
COM_METHOD GetName(ULONG32 cchName,
ULONG32 * pcchName,
- __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]);
+ _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]);
//-----------------------------------------------------------
@@ -3079,7 +3079,7 @@ class CordbProcess :
/*
* ModifyLogSwitch modifies the specified switch's severity level.
*/
- COM_METHOD ModifyLogSwitch(__in_z WCHAR *pLogSwitchName, LONG lLevel);
+ COM_METHOD ModifyLogSwitch(_In_z_ WCHAR *pLogSwitchName, LONG lLevel);
COM_METHOD EnumerateAppDomains(ICorDebugAppDomainEnum **ppAppDomains);
COM_METHOD GetObject(ICorDebugValue **ppObject);
@@ -4180,7 +4180,7 @@ class CordbModule : public CordbBase,
COM_METHOD GetProcess(ICorDebugProcess **ppProcess);
COM_METHOD GetBaseAddress(CORDB_ADDRESS *pAddress);
COM_METHOD GetAssembly(ICorDebugAssembly **ppAssembly);
- COM_METHOD GetName(ULONG32 cchName, ULONG32 *pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]);
+ COM_METHOD GetName(ULONG32 cchName, ULONG32 *pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]);
COM_METHOD EnableJITDebugging(BOOL bTrackJITInfo, BOOL bAllowJitOpts);
COM_METHOD EnableClassLoadCallbacks(BOOL bClassLoadCallbacks);
@@ -4252,7 +4252,7 @@ class CordbModule : public CordbBase,
#endif // _DEBUG
// Internal help to get the "name" (filename or pretty name) of the module.
- HRESULT GetNameWorker(ULONG32 cchName, ULONG32 *pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]);
+ HRESULT GetNameWorker(ULONG32 cchName, ULONG32 *pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]);
// Marks that the module's metadata has become invalid and needs to be refetched.
void RefreshMetaData();
@@ -4484,15 +4484,15 @@ class CordbMDA : public CordbBase, public ICorDebugMDA
// Get the string for the type of the MDA. Never empty.
// This is a convenient performant alternative to getting the XML stream and extracting
// the type from that based off the schema.
- COM_METHOD GetName(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]);
+ COM_METHOD GetName(ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]);
// Get a string description of the MDA. This may be empty (0-length).
- COM_METHOD GetDescription(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]);
+ COM_METHOD GetDescription(ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]);
// Get the full associated XML for the MDA. This may be empty.
// This could be a potentially expensive operation if the xml stream is large.
// See the MDA documentation for the schema for this XML stream.
- COM_METHOD GetXML(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]);
+ COM_METHOD GetXML(ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]);
COM_METHOD GetFlags(CorDebugMDAFlags * pFlags);
@@ -9292,7 +9292,7 @@ class CordbObjectValue : public CordbValue,
COM_METHOD GetLength(ULONG32 * pcchString);
COM_METHOD GetString(ULONG32 cchString,
ULONG32 * ppcchStrin,
- __out_ecount_opt(cchString) WCHAR szString[]);
+ _Out_writes_bytes_opt_(cchString) WCHAR szString[]);
//-----------------------------------------------------------
// ICorDebugExceptionObjectValue
@@ -10120,7 +10120,7 @@ class CordbWin32EventThread
HRESULT SendCreateProcessEvent(MachineInfo machineInfo,
LPCWSTR programName,
- __in_z LPWSTR programArgs,
+ _In_z_ LPWSTR programArgs,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
@@ -10811,7 +10811,7 @@ class CorpubProcess : public CordbCommonBase, public ICorPublishProcess
*/
COM_METHOD GetDisplayName(ULONG32 cchName,
ULONG32 *pcchName,
- __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]);
+ _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]);
CorpubProcess *GetNextProcess () { return m_pNext;}
void SetNext (CorpubProcess *pNext) { m_pNext = pNext;}
@@ -10838,7 +10838,7 @@ class CorpubProcess : public CordbCommonBase, public ICorPublishProcess
class CorpubAppDomain : public CordbCommonBase, public ICorPublishAppDomain
{
public:
- CorpubAppDomain (__in LPWSTR szAppDomainName, ULONG Id);
+ CorpubAppDomain (_In_ LPWSTR szAppDomainName, ULONG Id);
virtual ~CorpubAppDomain();
#ifdef _DEBUG
@@ -10873,7 +10873,7 @@ class CorpubAppDomain : public CordbCommonBase, public ICorPublishAppDomain
*/
COM_METHOD GetName (ULONG32 cchName,
ULONG32 *pcchName,
- __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]);
+ _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]);
CorpubAppDomain *GetNextAppDomain () { return m_pNext;}
void SetNext (CorpubAppDomain *pNext) { m_pNext = pNext;}
@@ -11142,7 +11142,7 @@ class CordbEnumFilter : public CordbBase,
void CheckAgainstDAC(CordbFunction * pFunc, void * pIP, mdMethodDef mdExpected);
#endif
-HRESULT CopyOutString(const WCHAR * pInputString, ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]);
+HRESULT CopyOutString(const WCHAR * pInputString, ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]);
diff --git a/src/coreclr/debug/di/shimcallback.cpp b/src/coreclr/debug/di/shimcallback.cpp
index ba5f0771fca49a..4e8f029209def7 100644
--- a/src/coreclr/debug/di/shimcallback.cpp
+++ b/src/coreclr/debug/di/shimcallback.cpp
@@ -659,7 +659,7 @@ HRESULT ShimProxyCallback::DebuggerError(ICorDebugProcess * pProcess, HRESULT er
// Implementation of ICorDebugManagedCallback::LogMessage
-HRESULT ShimProxyCallback::LogMessage(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, LONG lLevel, __in LPWSTR pLogSwitchName, __in LPWSTR pMessage)
+HRESULT ShimProxyCallback::LogMessage(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, LONG lLevel, _In_ LPWSTR pLogSwitchName, _In_ LPWSTR pMessage)
{
m_pShim->PreDispatchEvent();
class LogMessageEvent : public ManagedEvent
@@ -695,7 +695,7 @@ HRESULT ShimProxyCallback::LogMessage(ICorDebugAppDomain * pAppDomain, ICorDebug
// Implementation of ICorDebugManagedCallback::LogSwitch
-HRESULT ShimProxyCallback::LogSwitch(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, LONG lLevel, ULONG ulReason, __in LPWSTR pLogSwitchName, __in LPWSTR pParentName)
+HRESULT ShimProxyCallback::LogSwitch(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, LONG lLevel, ULONG ulReason, _In_ LPWSTR pLogSwitchName, _In_ LPWSTR pParentName)
{
m_pShim->PreDispatchEvent();
class LogSwitchEvent : public ManagedEvent
@@ -1060,7 +1060,7 @@ HRESULT ShimProxyCallback::FunctionRemapOpportunity(ICorDebugAppDomain * pAppDom
// Implementation of ICorDebugManagedCallback2::CreateConnection
-HRESULT ShimProxyCallback::CreateConnection(ICorDebugProcess * pProcess, CONNID dwConnectionId, __in LPWSTR pConnectionName)
+HRESULT ShimProxyCallback::CreateConnection(ICorDebugProcess * pProcess, CONNID dwConnectionId, _In_ LPWSTR pConnectionName)
{
m_pShim->PreDispatchEvent();
class CreateConnectionEvent : public ManagedEvent
diff --git a/src/coreclr/debug/di/shimpriv.h b/src/coreclr/debug/di/shimpriv.h
index 89a0c0d0c79374..26a939ee8a3a8e 100644
--- a/src/coreclr/debug/di/shimpriv.h
+++ b/src/coreclr/debug/di/shimpriv.h
@@ -128,15 +128,15 @@ class ShimProxyCallback :
COM_METHOD LogMessage( ICorDebugAppDomain *pAppDomain,
ICorDebugThread *pThread,
LONG lLevel,
- __in LPWSTR pLogSwitchName,
- __in LPWSTR pMessage);
+ _In_ LPWSTR pLogSwitchName,
+ _In_ LPWSTR pMessage);
COM_METHOD LogSwitch( ICorDebugAppDomain *pAppDomain,
ICorDebugThread *pThread,
LONG lLevel,
ULONG ulReason,
- __in LPWSTR pLogSwitchName,
- __in LPWSTR pParentName);
+ _In_ LPWSTR pLogSwitchName,
+ _In_ LPWSTR pParentName);
COM_METHOD CreateAppDomain(ICorDebugProcess *pProcess,
ICorDebugAppDomain *pAppDomain);
@@ -178,7 +178,7 @@ class ShimProxyCallback :
ICorDebugFunction *pNewFunction,
ULONG32 oldILOffset);
- COM_METHOD CreateConnection(ICorDebugProcess *pProcess, CONNID dwConnectionId, __in LPWSTR pConnName);
+ COM_METHOD CreateConnection(ICorDebugProcess *pProcess, CONNID dwConnectionId, _In_ LPWSTR pConnName);
COM_METHOD ChangeConnection(ICorDebugProcess *pProcess, CONNID dwConnectionId );
@@ -368,7 +368,7 @@ class ShimProcess
Cordb * pCordb,
ICorDebugRemoteTarget * pRemoteTarget,
LPCWSTR programName,
- __in_z LPWSTR programArgs,
+ _In_z_ LPWSTR programArgs,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
diff --git a/src/coreclr/debug/di/symbolinfo.cpp b/src/coreclr/debug/di/symbolinfo.cpp
index 452adbe71f3a7e..37cff967d02fea 100644
--- a/src/coreclr/debug/di/symbolinfo.cpp
+++ b/src/coreclr/debug/di/symbolinfo.cpp
@@ -231,7 +231,7 @@ STDMETHODIMP_(ULONG) SymbolInfo::Release ()
STDMETHODIMP SymbolInfo::GetTypeDefProps ( // S_OK or error.
mdTypeDef td, // [IN] TypeDef token for inquiry.
- __out_ecount_part_opt(cchTypeDef, pchTypeDef)
+ _Out_writes_to_opt_(cchTypeDef, pchTypeDef)
LPWSTR szTypeDef, // [OUT] Put name here.
ULONG cchTypeDef, // [IN] size of name buffer in wide chars.
ULONG *pchTypeDef, // [OUT] put size of name (wide chars) here.
@@ -278,7 +278,7 @@ STDMETHODIMP SymbolInfo::GetTypeDefProps ( // S_OK or error.
STDMETHODIMP SymbolInfo::GetMethodProps (
mdMethodDef mb, // The method for which to get props.
mdTypeDef *pClass, // Put method's class here.
- __out_ecount_part_opt(cchMethod, *pchMethod)
+ _Out_writes_to_opt_(cchMethod, *pchMethod)
LPWSTR szMethod, // Put method's name here.
ULONG cchMethod, // Size of szMethod buffer in wide chars.
ULONG *pchMethod, // Put actual size here
@@ -419,7 +419,7 @@ STDMETHODIMP SymbolInfo::FindTypeDefByName ( // S_OK or error.
}
STDMETHODIMP SymbolInfo::GetScopeProps ( // S_OK or error.
- __out_ecount_part_opt(cchName, *pchName)
+ _Out_writes_to_opt_(cchName, *pchName)
LPWSTR szName, // [OUT] Put the name here.
ULONG cchName, // [IN] Size of name buffer in wide chars.
ULONG *pchName, // [OUT] Put size of name (wide chars) here.
@@ -449,7 +449,7 @@ STDMETHODIMP SymbolInfo::GetInterfaceImplProps ( // S_OK or error.
STDMETHODIMP SymbolInfo::GetTypeRefProps ( // S_OK or error.
mdTypeRef tr, // [IN] TypeRef token.
mdToken *ptkResolutionScope, // [OUT] Resolution scope, ModuleRef or AssemblyRef.
- __out_ecount_part_opt(cchName, *pchName)
+ _Out_writes_to_opt_(cchName, *pchName)
LPWSTR szName, // [OUT] Name of the TypeRef.
ULONG cchName, // [IN] Size of buffer.
ULONG *pchName) // [OUT] Size of Name.
@@ -629,7 +629,7 @@ STDMETHODIMP SymbolInfo::FindMemberRef (
STDMETHODIMP SymbolInfo::GetMemberRefProps ( // S_OK or error.
mdMemberRef mr, // [IN] given memberref
mdToken *ptk, // [OUT] Put classref or classdef here.
- __out_ecount_part_opt(cchMember, *pchMember)
+ _Out_writes_to_opt_(cchMember, *pchMember)
LPWSTR szMember, // [OUT] buffer to fill for member's name
ULONG cchMember, // [IN] the count of char of szMember
ULONG *pchMember, // [OUT] actual count of char in member name
@@ -752,7 +752,7 @@ STDMETHODIMP SymbolInfo::GetSigFromToken ( // S_OK or error.
STDMETHODIMP SymbolInfo::GetModuleRefProps ( // S_OK or error.
mdModuleRef mur, // [IN] moduleref token.
- __out_ecount_part_opt(cchName, *pchName)
+ _Out_writes_to_opt_(cchName, *pchName)
LPWSTR szName, // [OUT] buffer to fill with the moduleref name.
ULONG cchName, // [IN] size of szName in wide characters.
ULONG *pchName) // [OUT] actual count of characters in the name.
@@ -800,7 +800,7 @@ STDMETHODIMP SymbolInfo::EnumUnresolvedMethods ( // S_OK, S_FALSE, or erro
STDMETHODIMP SymbolInfo::GetUserString ( // S_OK or error.
mdString stk, // [IN] String token.
- __out_ecount_part_opt(cchString, *pchString)
+ _Out_writes_to_opt_(cchString, *pchString)
LPWSTR szString, // [OUT] Copy of string.
ULONG cchString, // [IN] Max chars of room in szString.
ULONG *pchString) // [OUT] How many chars in actual string.
@@ -812,7 +812,7 @@ STDMETHODIMP SymbolInfo::GetUserString ( // S_OK or error.
STDMETHODIMP SymbolInfo::GetPinvokeMap ( // S_OK or error.
mdToken tk, // [IN] FieldDef or MethodDef.
DWORD *pdwMappingFlags, // [OUT] Flags used for mapping.
- __out_ecount_part_opt(cchImportName, *pchImportName)
+ _Out_writes_to_opt_(cchImportName, *pchImportName)
LPWSTR szImportName, // [OUT] Import name.
ULONG cchImportName, // [IN] Size of the name buffer.
ULONG *pchImportName, // [OUT] Actual number of characters stored.
@@ -896,7 +896,7 @@ STDMETHODIMP SymbolInfo::FindTypeRef (
STDMETHODIMP SymbolInfo::GetMemberProps (
mdToken mb, // The member for which to get props.
mdTypeDef *pClass, // Put member's class here.
- __out_ecount_part_opt(cchMember, *pchMember)
+ _Out_writes_to_opt_(cchMember, *pchMember)
LPWSTR szMember, // Put member's name here.
ULONG cchMember, // Size of szMember buffer in wide chars.
ULONG *pchMember, // Put actual size here
@@ -916,7 +916,7 @@ STDMETHODIMP SymbolInfo::GetMemberProps (
STDMETHODIMP SymbolInfo::GetFieldProps (
mdFieldDef mb, // The field for which to get props.
mdTypeDef *pClass, // Put field's class here.
- __out_ecount_part_opt(cchField, *pchField)
+ _Out_writes_to_opt_(cchField, *pchField)
LPWSTR szField, // Put field's name here.
ULONG cchField, // Size of szField buffer in wide chars.
ULONG *pchField, // Put actual size here
@@ -957,7 +957,7 @@ STDMETHODIMP SymbolInfo::GetParamProps ( // S_OK or error.
mdParamDef tk, // [IN]The Parameter.
mdMethodDef *pmd, // [OUT] Parent Method token.
ULONG *pulSequence, // [OUT] Parameter sequence.
- __out_ecount_part_opt(cchName, *pchName)
+ _Out_writes_to_opt_(cchName, *pchName)
LPWSTR szName, // [OUT] Put name here.
ULONG cchName, // [OUT] Size of name buffer.
ULONG *pchName, // [OUT] Put actual size of name here.
diff --git a/src/coreclr/debug/di/symbolinfo.h b/src/coreclr/debug/di/symbolinfo.h
index 22deafaaf5d516..5b1291f4cfe598 100644
--- a/src/coreclr/debug/di/symbolinfo.h
+++ b/src/coreclr/debug/di/symbolinfo.h
@@ -104,7 +104,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport
mdTypeDef *ptd); // [OUT] Put the TypeDef token here.
STDMETHOD(GetScopeProps)( // S_OK or error.
- __out_ecount_part_opt(cchName, *pchName)
+ _Out_writes_to_opt_(cchName, *pchName)
LPWSTR szName, // [OUT] Put the name here.
ULONG cchName, // [IN] Size of name buffer in wide chars.
ULONG *pchName, // [OUT] Put size of name (wide chars) here.
@@ -115,7 +115,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport
STDMETHOD(GetTypeDefProps)( // S_OK or error.
mdTypeDef td, // [IN] TypeDef token for inquiry.
- __out_ecount_part_opt(cchTypeDef, *pchTypeDef)
+ _Out_writes_to_opt_(cchTypeDef, *pchTypeDef)
LPWSTR szTypeDef, // [OUT] Put name here.
ULONG cchTypeDef, // [IN] size of name buffer in wide chars.
ULONG *pchTypeDef, // [OUT] put size of name (wide chars) here.
@@ -130,7 +130,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport
STDMETHOD(GetTypeRefProps)( // S_OK or error.
mdTypeRef tr, // [IN] TypeRef token.
mdToken *ptkResolutionScope, // [OUT] Resolution scope, ModuleRef or AssemblyRef.
- __out_ecount_part_opt(cchName, *pchName)
+ _Out_writes_to_opt_(cchName, *pchName)
LPWSTR szName, // [OUT] Name of the TypeRef.
ULONG cchName, // [IN] Size of buffer.
ULONG *pchName); // [OUT] Size of Name.
@@ -244,7 +244,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport
STDMETHOD (GetMethodProps)(
mdMethodDef mb, // The method for which to get props.
mdTypeDef *pClass, // Put method's class here.
- __out_ecount_part_opt(cchMethod, *pchMethod)
+ _Out_writes_to_opt_(cchMethod, *pchMethod)
LPWSTR szMethod, // Put method's name here.
ULONG cchMethod, // Size of szMethod buffer in wide chars.
ULONG *pchMethod, // Put actual size here
@@ -257,7 +257,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport
STDMETHOD(GetMemberRefProps)( // S_OK or error.
mdMemberRef mr, // [IN] given memberref
mdToken *ptk, // [OUT] Put classref or classdef here.
- __out_ecount_part_opt(cchMember, *pchMember)
+ _Out_writes_to_opt_(cchMember, *pchMember)
LPWSTR szMember, // [OUT] buffer to fill for member's name
ULONG cchMember, // [IN] the count of char of szMember
ULONG *pchMember, // [OUT] actual count of char in member name
@@ -336,7 +336,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport
STDMETHOD(GetModuleRefProps)( // S_OK or error.
mdModuleRef mur, // [IN] moduleref token.
- __out_ecount_part_opt(cchName, *pchName)
+ _Out_writes_to_opt_(cchName, *pchName)
LPWSTR szName, // [OUT] buffer to fill with the moduleref name.
ULONG cchName, // [IN] size of szName in wide characters.
ULONG *pchName); // [OUT] actual count of characters in the name.
@@ -364,7 +364,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport
STDMETHOD(GetUserString)( // S_OK or error.
mdString stk, // [IN] String token.
- __out_ecount_part_opt(cchString, *pchString)
+ _Out_writes_to_opt_(cchString, *pchString)
LPWSTR szString, // [OUT] Copy of string.
ULONG cchString, // [IN] Max chars of room in szString.
ULONG *pchString); // [OUT] How many chars in actual string.
@@ -372,7 +372,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport
STDMETHOD(GetPinvokeMap)( // S_OK or error.
mdToken tk, // [IN] FieldDef or MethodDef.
DWORD *pdwMappingFlags, // [OUT] Flags used for mapping.
- __out_ecount_part_opt(cchImportName, *pchImportName)
+ _Out_writes_to_opt_(cchImportName, *pchImportName)
LPWSTR szImportName, // [OUT] Import name.
ULONG cchImportName, // [IN] Size of the name buffer.
ULONG *pchImportName, // [OUT] Actual number of characters stored.
@@ -424,7 +424,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport
STDMETHOD(GetMemberProps)(
mdToken mb, // The member for which to get props.
mdTypeDef *pClass, // Put member's class here.
- __out_ecount_part_opt(cchMember, *pchMember)
+ _Out_writes_to_opt_(cchMember, *pchMember)
LPWSTR szMember, // Put member's name here.
ULONG cchMember, // Size of szMember buffer in wide chars.
ULONG *pchMember, // Put actual size here
@@ -440,7 +440,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport
STDMETHOD(GetFieldProps)(
mdFieldDef mb, // The field for which to get props.
mdTypeDef *pClass, // Put field's class here.
- __out_ecount_part_opt(cchField, *pchField)
+ _Out_writes_to_opt_(cchField, *pchField)
LPWSTR szField, // Put field's name here.
ULONG cchField, // Size of szField buffer in wide chars.
ULONG *pchField, // Put actual size here
@@ -473,7 +473,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport
mdParamDef tk, // [IN]The Parameter.
mdMethodDef *pmd, // [OUT] Parent Method token.
ULONG *pulSequence, // [OUT] Parameter sequence.
- __out_ecount_part_opt(cchName, *pchName)
+ _Out_writes_to_opt_(cchName, *pchName)
LPWSTR szName, // [OUT] Put name here.
ULONG cchName, // [OUT] Size of name buffer.
ULONG *pchName, // [OUT] Put actual size of name here.
diff --git a/src/coreclr/debug/ee/debugger.cpp b/src/coreclr/debug/ee/debugger.cpp
index 8e5200d37d5097..1e326e724250b6 100644
--- a/src/coreclr/debug/ee/debugger.cpp
+++ b/src/coreclr/debug/ee/debugger.cpp
@@ -14341,8 +14341,8 @@ void Debugger::SendRawLogMessage(
// the creation/modification of a LogSwitch
void Debugger::SendLogSwitchSetting(int iLevel,
int iReason,
- __in_z LPCWSTR pLogSwitchName,
- __in_z LPCWSTR pParentSwitchName)
+ _In_z_ LPCWSTR pLogSwitchName,
+ _In_z_ LPCWSTR pParentSwitchName)
{
CONTRACTL
{
@@ -15854,7 +15854,7 @@ BOOL Debugger::IsThreadContextInvalid(Thread *pThread, CONTEXT *pCtx)
// notification when a SQL connection begins
-void Debugger::CreateConnection(CONNID dwConnectionId, __in_z WCHAR *wzName)
+void Debugger::CreateConnection(CONNID dwConnectionId, _In_z_ WCHAR *wzName)
{
CONTRACTL
{
diff --git a/src/coreclr/debug/ee/debugger.h b/src/coreclr/debug/ee/debugger.h
index 3fd9edf68f5d86..084f1da6a5c93f 100644
--- a/src/coreclr/debug/ee/debugger.h
+++ b/src/coreclr/debug/ee/debugger.h
@@ -2201,7 +2201,7 @@ class Debugger : public DebugInterface
void SendInterceptExceptionComplete(Thread *thread);
HRESULT AttachDebuggerForBreakpoint(Thread *thread,
- __in_opt WCHAR *wszLaunchReason);
+ _In_opt_ WCHAR *wszLaunchReason);
void ThreadIsSafe(Thread *thread);
@@ -2424,8 +2424,8 @@ class Debugger : public DebugInterface
void SendLogSwitchSetting (int iLevel,
int iReason,
- __in_z LPCWSTR pLogSwitchName,
- __in_z LPCWSTR pParentSwitchName);
+ _In_z_ LPCWSTR pLogSwitchName,
+ _In_z_ LPCWSTR pParentSwitchName);
bool IsLoggingEnabled (void)
{
@@ -2507,7 +2507,7 @@ class Debugger : public DebugInterface
BOOL IsThreadContextInvalid(Thread *pThread, T_CONTEXT *pCtx);
// notification for SQL fiber debugging support
- void CreateConnection(CONNID dwConnectionId, __in_z WCHAR *wzName);
+ void CreateConnection(CONNID dwConnectionId, _In_z_ WCHAR *wzName);
void DestroyConnection(CONNID dwConnectionId);
void ChangeConnection(CONNID dwConnectionId);
@@ -3704,7 +3704,7 @@ void DbgLogHelper(DebuggerIPCEventType event);
// Helpers for cleanup
// These are various utility functions, mainly where we factor out code.
//-----------------------------------------------------------------------------
-void GetPidDecoratedName(__out_ecount(cBufSizeInChars) WCHAR * pBuf,
+void GetPidDecoratedName(_Out_writes_(cBufSizeInChars) WCHAR * pBuf,
int cBufSizeInChars,
const WCHAR * pPrefix);
diff --git a/src/coreclr/debug/ee/rcthread.cpp b/src/coreclr/debug/ee/rcthread.cpp
index 18c840edbb6984..0f48eb2c95e188 100644
--- a/src/coreclr/debug/ee/rcthread.cpp
+++ b/src/coreclr/debug/ee/rcthread.cpp
@@ -116,7 +116,7 @@ void DebuggerRCThread::CloseIPCHandles()
// cBufSizeInChars - the size of the buffer in characters, including the null.
// pPrefx - The undecorated name of the event.
//-----------------------------------------------------------------------------
-void GetPidDecoratedName(__out_ecount(cBufSizeInChars) WCHAR * pBuf,
+void GetPidDecoratedName(_Out_writes_(cBufSizeInChars) WCHAR * pBuf,
int cBufSizeInChars,
const WCHAR * pPrefix)
{
diff --git a/src/coreclr/debug/inc/common.h b/src/coreclr/debug/inc/common.h
index 2baec963e14f2f..cb8474c7373856 100644
--- a/src/coreclr/debug/inc/common.h
+++ b/src/coreclr/debug/inc/common.h
@@ -45,7 +45,7 @@ void InitEventForDebuggerNotification(DEBUG_EVENT * pDebugEvent,
#endif // (FEATURE_DBGIPC_TRANSPORT_DI || FEATURE_DBGIPC_TRANSPORT_VM)
-void GetPidDecoratedName(__out_z __out_ecount(cBufSizeInChars) WCHAR * pBuf,
+void GetPidDecoratedName(_Out_writes_z_(cBufSizeInChars) WCHAR * pBuf,
int cBufSizeInChars,
const WCHAR * pPrefix,
DWORD pid);
diff --git a/src/coreclr/debug/inc/dbgipcevents.h b/src/coreclr/debug/inc/dbgipcevents.h
index db4a00fca1c865..ddef09554cf80d 100644
--- a/src/coreclr/debug/inc/dbgipcevents.h
+++ b/src/coreclr/debug/inc/dbgipcevents.h
@@ -990,7 +990,7 @@ extern const size_t nameCount;
struct MSLAYOUT IPCENames // We use a class/struct so that the function can remain in a shared header file
{
- static DebuggerIPCEventType GetEventType(__in_z char * strEventType)
+ static DebuggerIPCEventType GetEventType(_In_z_ char * strEventType)
{
// pass in the string of event name and find the matching enum value
// This is a linear search which is pretty slow. However, this is only used
diff --git a/src/coreclr/debug/shared/dbgtransportsession.cpp b/src/coreclr/debug/shared/dbgtransportsession.cpp
index 85fb7901b01c1a..6d3ed5b345cf7c 100644
--- a/src/coreclr/debug/shared/dbgtransportsession.cpp
+++ b/src/coreclr/debug/shared/dbgtransportsession.cpp
@@ -1143,7 +1143,7 @@ DbgTransportSession::Message * DbgTransportSession::RemoveMessageFromSendQueue(D
// Check read and optionally write memory access to the specified range of bytes. Used to check
// ReadProcessMemory and WriteProcessMemory requests.
-HRESULT DbgTransportSession::CheckBufferAccess(__in_ecount(cbBuffer) PBYTE pbBuffer, DWORD cbBuffer, bool fWriteAccess)
+HRESULT DbgTransportSession::CheckBufferAccess(_In_reads_(cbBuffer) PBYTE pbBuffer, DWORD cbBuffer, bool fWriteAccess)
{
// check for integer overflow
if ((pbBuffer + cbBuffer) < pbBuffer)
diff --git a/src/coreclr/debug/shared/utils.cpp b/src/coreclr/debug/shared/utils.cpp
index 85f17b50c44e78..be967b1d1b7fa2 100644
--- a/src/coreclr/debug/shared/utils.cpp
+++ b/src/coreclr/debug/shared/utils.cpp
@@ -126,7 +126,7 @@ void InitEventForDebuggerNotification(DEBUG_EVENT * pDebugEvent,
// cBufSizeInChars - the size of the buffer in characters, including the null.
// pPrefx - The undecorated name of the event.
//-----------------------------------------------------------------------------
-void GetPidDecoratedName(__out_z __out_ecount(cBufSizeInChars) WCHAR * pBuf, int cBufSizeInChars, const WCHAR * pPrefix, DWORD pid)
+void GetPidDecoratedName(_Out_writes_z_(cBufSizeInChars) WCHAR * pBuf, int cBufSizeInChars, const WCHAR * pPrefix, DWORD pid)
{
const WCHAR szGlobal[] = W("Global\\");
int szGlobalLen;
diff --git a/src/coreclr/debug/shim/debugshim.cpp b/src/coreclr/debug/shim/debugshim.cpp
index b86c8eb0cfcc3a..3dcfbcc2510785 100644
--- a/src/coreclr/debug/shim/debugshim.cpp
+++ b/src/coreclr/debug/shim/debugshim.cpp
@@ -427,11 +427,11 @@ HRESULT CLRDebuggingImpl::GetCLRInfo(ICorDebugDataTarget* pDataTarget,
CLR_DEBUGGING_VERSION* pVersion,
DWORD* pdwDbiTimeStamp,
DWORD* pdwDbiSizeOfImage,
- __out_z __inout_ecount(dwDbiNameCharCount) WCHAR* pDbiName,
+ _Inout_updates_z_(dwDbiNameCharCount) WCHAR* pDbiName,
DWORD dwDbiNameCharCount,
DWORD* pdwDacTimeStamp,
DWORD* pdwDacSizeOfImage,
- __out_z __inout_ecount(dwDacNameCharCount) WCHAR* pDacName,
+ _Inout_updates_z_(dwDacNameCharCount) WCHAR* pDacName,
DWORD dwDacNameCharCount)
{
#ifdef HOST_WINDOWS
@@ -629,7 +629,7 @@ HRESULT CLRDebuggingImpl::GetCLRInfo(ICorDebugDataTarget* pDataTarget,
}
// Formats the long name for DAC
-HRESULT CLRDebuggingImpl::FormatLongDacModuleName(__out_z __inout_ecount(cchBuffer) WCHAR * pBuffer,
+HRESULT CLRDebuggingImpl::FormatLongDacModuleName(_Inout_updates_z_(cchBuffer) WCHAR * pBuffer,
DWORD cchBuffer,
DWORD targetImageFileMachine,
VS_FIXEDFILEINFO * pVersion)
diff --git a/src/coreclr/debug/shim/debugshim.h b/src/coreclr/debug/shim/debugshim.h
index 5055d5a11b47d1..93df463867feb5 100644
--- a/src/coreclr/debug/shim/debugshim.h
+++ b/src/coreclr/debug/shim/debugshim.h
@@ -69,14 +69,14 @@ class CLRDebuggingImpl : public ICLRDebugging
CLR_DEBUGGING_VERSION * pVersion,
DWORD * pdwDbiTimeStamp,
DWORD * pdwDbiSizeOfImage,
- __out_z __inout_ecount(dwDbiNameCharCount) WCHAR * pDbiName,
+ _Inout_updates_z_(dwDbiNameCharCount) WCHAR * pDbiName,
DWORD dwDbiNameCharCount,
DWORD * pdwDacTimeStamp,
DWORD * pdwDacSizeOfImage,
- __out_z __inout_ecount(dwDacNameCharCount) WCHAR * pDacName,
+ _Inout_updates_z_(dwDacNameCharCount) WCHAR * pDacName,
DWORD dwDacNameCharCount);
- HRESULT FormatLongDacModuleName(__out_z __inout_ecount(cchBuffer) WCHAR * pBuffer,
+ HRESULT FormatLongDacModuleName(_Inout_updates_z_(cchBuffer) WCHAR * pBuffer,
DWORD cchBuffer,
DWORD targetImageFileMachine,
VS_FIXEDFILEINFO * pVersion);
diff --git a/src/coreclr/dlls/dbgshim/dbgshim.cpp b/src/coreclr/dlls/dbgshim/dbgshim.cpp
index ac1e2d7fe189ac..40e4d7dea4bf26 100644
--- a/src/coreclr/dlls/dbgshim/dbgshim.cpp
+++ b/src/coreclr/dlls/dbgshim/dbgshim.cpp
@@ -79,12 +79,12 @@ if it exists, it will:
DLLEXPORT
HRESULT
CreateProcessForLaunch(
- __in LPWSTR lpCommandLine,
- __in BOOL bSuspendProcess,
- __in LPVOID lpEnvironment,
- __in LPCWSTR lpCurrentDirectory,
- __out PDWORD pProcessId,
- __out HANDLE *pResumeHandle)
+ _In_ LPWSTR lpCommandLine,
+ _In_ BOOL bSuspendProcess,
+ _In_ LPVOID lpEnvironment,
+ _In_ LPCWSTR lpCurrentDirectory,
+ _Out_ PDWORD pProcessId,
+ _Out_ HANDLE *pResumeHandle)
{
PUBLIC_CONTRACT;
@@ -140,7 +140,7 @@ CreateProcessForLaunch(
DLLEXPORT
HRESULT
ResumeProcess(
- __in HANDLE hResumeHandle)
+ _In_ HANDLE hResumeHandle)
{
PUBLIC_CONTRACT;
if (ResumeThread(hResumeHandle) == (DWORD)-1)
@@ -159,7 +159,7 @@ ResumeProcess(
DLLEXPORT
HRESULT
CloseResumeHandle(
- __in HANDLE hResumeHandle)
+ _In_ HANDLE hResumeHandle)
{
PUBLIC_CONTRACT;
if (!CloseHandle(hResumeHandle))
@@ -190,7 +190,7 @@ HRESULT
GetContinueStartupEvent(
DWORD debuggeePID,
LPCWSTR szTelestoFullPath,
- __out HANDLE *phContinueStartupEvent);
+ _Out_ HANDLE *phContinueStartupEvent);
#endif // TARGET_UNIX
@@ -697,10 +697,10 @@ StartupHelperThread(LPVOID p)
DLLEXPORT
HRESULT
RegisterForRuntimeStartup(
- __in DWORD dwProcessId,
- __in PSTARTUP_CALLBACK pfnCallback,
- __in PVOID parameter,
- __out PVOID *ppUnregisterToken)
+ _In_ DWORD dwProcessId,
+ _In_ PSTARTUP_CALLBACK pfnCallback,
+ _In_ PVOID parameter,
+ _Out_ PVOID *ppUnregisterToken)
{
return RegisterForRuntimeStartupEx(dwProcessId, NULL, pfnCallback, parameter, ppUnregisterToken);
}
@@ -738,11 +738,11 @@ RegisterForRuntimeStartup(
DLLEXPORT
HRESULT
RegisterForRuntimeStartupEx(
- __in DWORD dwProcessId,
- __in LPCWSTR lpApplicationGroupId,
- __in PSTARTUP_CALLBACK pfnCallback,
- __in PVOID parameter,
- __out PVOID *ppUnregisterToken)
+ _In_ DWORD dwProcessId,
+ _In_ LPCWSTR lpApplicationGroupId,
+ _In_ PSTARTUP_CALLBACK pfnCallback,
+ _In_ PVOID parameter,
+ _Out_ PVOID *ppUnregisterToken)
{
PUBLIC_CONTRACT;
@@ -787,7 +787,7 @@ RegisterForRuntimeStartupEx(
DLLEXPORT
HRESULT
UnregisterForRuntimeStartup(
- __in PVOID pUnregisterToken)
+ _In_ PVOID pUnregisterToken)
{
PUBLIC_CONTRACT;
@@ -824,8 +824,8 @@ const int cchEventNameBufferSize = (sizeof(StartupNotifyEventNamePrefix) + sizeo
DLLEXPORT
HRESULT
GetStartupNotificationEvent(
- __in DWORD debuggeePID,
- __out HANDLE* phStartupEvent)
+ _In_ DWORD debuggeePID,
+ _Out_ HANDLE* phStartupEvent)
{
PUBLIC_CONTRACT;
@@ -1220,9 +1220,9 @@ DLLEXPORT
HRESULT
EnumerateCLRs(
DWORD debuggeePID,
- __out HANDLE** ppHandleArrayOut,
- __out LPWSTR** ppStringArrayOut,
- __out DWORD* pdwArrayLengthOut)
+ _Out_ HANDLE** ppHandleArrayOut,
+ _Out_ LPWSTR** ppStringArrayOut,
+ _Out_ DWORD* pdwArrayLengthOut)
{
PUBLIC_CONTRACT;
@@ -1357,9 +1357,9 @@ EnumerateCLRs(
DLLEXPORT
HRESULT
CloseCLREnumeration(
- __in HANDLE* pHandleArray,
- __in LPWSTR* pStringArray,
- __in DWORD dwArrayLength)
+ _In_ HANDLE* pHandleArray,
+ _In_ LPWSTR* pStringArray,
+ _In_ DWORD dwArrayLength)
{
PUBLIC_CONTRACT;
@@ -1484,11 +1484,11 @@ const WCHAR *c_versionStrFormat = W("%08x;%08x;%p");
DLLEXPORT
HRESULT
CreateVersionStringFromModule(
- __in DWORD pidDebuggee,
- __in LPCWSTR szModuleName,
- __out_ecount_part(cchBuffer, *pdwLength) LPWSTR pBuffer,
- __in DWORD cchBuffer,
- __out DWORD* pdwLength)
+ _In_ DWORD pidDebuggee,
+ _In_ LPCWSTR szModuleName,
+ _Out_writes_to_opt_(cchBuffer, *pdwLength) LPWSTR pBuffer,
+ _In_ DWORD cchBuffer,
+ _Out_ DWORD* pdwLength)
{
PUBLIC_CONTRACT;
@@ -1719,9 +1719,9 @@ CheckDbiAndRuntimeVersion(
DLLEXPORT
HRESULT
CreateDebuggingInterfaceFromVersionEx(
- __in int iDebuggerVersion,
- __in LPCWSTR szDebuggeeVersion,
- __out IUnknown ** ppCordb)
+ _In_ int iDebuggerVersion,
+ _In_ LPCWSTR szDebuggeeVersion,
+ _Out_ IUnknown ** ppCordb)
{
return CreateDebuggingInterfaceFromVersion2(iDebuggerVersion, szDebuggeeVersion, NULL, ppCordb);
}
@@ -1748,10 +1748,10 @@ CreateDebuggingInterfaceFromVersionEx(
DLLEXPORT
HRESULT
CreateDebuggingInterfaceFromVersion2(
- __in int iDebuggerVersion,
- __in LPCWSTR szDebuggeeVersion,
- __in LPCWSTR szApplicationGroupId,
- __out IUnknown ** ppCordb)
+ _In_ int iDebuggerVersion,
+ _In_ LPCWSTR szDebuggeeVersion,
+ _In_ LPCWSTR szApplicationGroupId,
+ _Out_ IUnknown ** ppCordb)
{
PUBLIC_CONTRACT;
@@ -1880,8 +1880,8 @@ CreateDebuggingInterfaceFromVersion2(
DLLEXPORT
HRESULT
CreateDebuggingInterfaceFromVersion(
- __in LPCWSTR szDebuggeeVersion,
- __out IUnknown ** ppCordb
+ _In_ LPCWSTR szDebuggeeVersion,
+ _Out_ IUnknown ** ppCordb
)
{
PUBLIC_CONTRACT;
@@ -1907,7 +1907,7 @@ HRESULT
GetContinueStartupEvent(
DWORD debuggeePID,
LPCWSTR szTelestoFullPath,
- __out HANDLE* phContinueStartupEvent)
+ _Out_ HANDLE* phContinueStartupEvent)
{
if ((phContinueStartupEvent == NULL) || (szTelestoFullPath == NULL))
return E_INVALIDARG;
diff --git a/src/coreclr/dlls/dbgshim/dbgshim.h b/src/coreclr/dlls/dbgshim/dbgshim.h
index 392cd7b9286a85..004fd2a38128f2 100644
--- a/src/coreclr/dlls/dbgshim/dbgshim.h
+++ b/src/coreclr/dlls/dbgshim/dbgshim.h
@@ -11,81 +11,81 @@ typedef VOID (*PSTARTUP_CALLBACK)(IUnknown *pCordb, PVOID parameter, HRESULT hr)
EXTERN_C HRESULT
CreateProcessForLaunch(
- __in LPWSTR lpCommandLine,
- __in BOOL bSuspendProcess,
- __in LPVOID lpEnvironment,
- __in LPCWSTR lpCurrentDirectory,
- __out PDWORD pProcessId,
- __out HANDLE *pResumeHandle);
+ _In_ LPWSTR lpCommandLine,
+ _In_ BOOL bSuspendProcess,
+ _In_ LPVOID lpEnvironment,
+ _In_ LPCWSTR lpCurrentDirectory,
+ _Out_ PDWORD pProcessId,
+ _Out_ HANDLE *pResumeHandle);
EXTERN_C HRESULT
ResumeProcess(
- __in HANDLE hResumeHandle);
+ _In_ HANDLE hResumeHandle);
EXTERN_C HRESULT
CloseResumeHandle(
- __in HANDLE hResumeHandle);
+ _In_ HANDLE hResumeHandle);
EXTERN_C HRESULT
RegisterForRuntimeStartup(
- __in DWORD dwProcessId,
- __in PSTARTUP_CALLBACK pfnCallback,
- __in PVOID parameter,
- __out PVOID *ppUnregisterToken);
+ _In_ DWORD dwProcessId,
+ _In_ PSTARTUP_CALLBACK pfnCallback,
+ _In_ PVOID parameter,
+ _Out_ PVOID *ppUnregisterToken);
EXTERN_C HRESULT
RegisterForRuntimeStartupEx(
- __in DWORD dwProcessId,
- __in LPCWSTR szApplicationGroupId,
- __in PSTARTUP_CALLBACK pfnCallback,
- __in PVOID parameter,
- __out PVOID *ppUnregisterToken);
+ _In_ DWORD dwProcessId,
+ _In_ LPCWSTR szApplicationGroupId,
+ _In_ PSTARTUP_CALLBACK pfnCallback,
+ _In_ PVOID parameter,
+ _Out_ PVOID *ppUnregisterToken);
EXTERN_C HRESULT
UnregisterForRuntimeStartup(
- __in PVOID pUnregisterToken);
+ _In_ PVOID pUnregisterToken);
EXTERN_C HRESULT
GetStartupNotificationEvent(
- __in DWORD debuggeePID,
- __out HANDLE* phStartupEvent);
+ _In_ DWORD debuggeePID,
+ _Out_ HANDLE* phStartupEvent);
EXTERN_C HRESULT
EnumerateCLRs(DWORD debuggeePID,
- __out HANDLE** ppHandleArrayOut,
- __out LPWSTR** ppStringArrayOut,
- __out DWORD* pdwArrayLengthOut);
+ _Out_ HANDLE** ppHandleArrayOut,
+ _Out_ LPWSTR** ppStringArrayOut,
+ _Out_ DWORD* pdwArrayLengthOut);
EXTERN_C HRESULT
CloseCLREnumeration(
- __in HANDLE* pHandleArray,
- __in LPWSTR* pStringArray,
- __in DWORD dwArrayLength);
+ _In_ HANDLE* pHandleArray,
+ _In_ LPWSTR* pStringArray,
+ _In_ DWORD dwArrayLength);
EXTERN_C HRESULT
CreateVersionStringFromModule(
- __in DWORD pidDebuggee,
- __in LPCWSTR szModuleName,
- __out_ecount_part(cchBuffer, *pdwLength) LPWSTR pBuffer,
- __in DWORD cchBuffer,
- __out DWORD* pdwLength);
+ _In_ DWORD pidDebuggee,
+ _In_ LPCWSTR szModuleName,
+ _Out_writes_to_opt_(cchBuffer, *pdwLength) LPWSTR pBuffer,
+ _In_ DWORD cchBuffer,
+ _Out_ DWORD* pdwLength);
EXTERN_C HRESULT
CreateDebuggingInterfaceFromVersionEx(
- __in int iDebuggerVersion,
- __in LPCWSTR szDebuggeeVersion,
- __out IUnknown ** ppCordb);
+ _In_ int iDebuggerVersion,
+ _In_ LPCWSTR szDebuggeeVersion,
+ _Out_ IUnknown ** ppCordb);
EXTERN_C
DLLEXPORT
HRESULT
CreateDebuggingInterfaceFromVersion2(
- __in int iDebuggerVersion,
- __in LPCWSTR szDebuggeeVersion,
- __in LPCWSTR szApplicationGroupId,
- __out IUnknown ** ppCordb);
+ _In_ int iDebuggerVersion,
+ _In_ LPCWSTR szDebuggeeVersion,
+ _In_ LPCWSTR szApplicationGroupId,
+ _Out_ IUnknown ** ppCordb);
EXTERN_C HRESULT
CreateDebuggingInterfaceFromVersion(
- __in LPCWSTR szDebuggeeVersion,
- __out IUnknown ** ppCordb);
+ _In_ LPCWSTR szDebuggeeVersion,
+ _Out_ IUnknown ** ppCordb);
diff --git a/src/coreclr/dlls/mscordac/CMakeLists.txt b/src/coreclr/dlls/mscordac/CMakeLists.txt
index 8d04b34e48aad7..25c2532358774b 100644
--- a/src/coreclr/dlls/mscordac/CMakeLists.txt
+++ b/src/coreclr/dlls/mscordac/CMakeLists.txt
@@ -47,7 +47,7 @@ else(CLR_CMAKE_HOST_WIN32)
set(REDEFINES_FILE_SCRIPT ${CMAKE_SOURCE_DIR}/generateredefinesfile.sh)
- if (CLR_CMAKE_HOST_ARCH_ARM OR CLR_CMAKE_HOST_ARCH_ARM64)
+ if (CLR_CMAKE_HOST_ARCH_ARM OR CLR_CMAKE_HOST_ARCH_ARM64 OR CLR_CMAKE_HOST_ARCH_LOONGARCH64)
set(JUMP_INSTRUCTION b)
else()
set(JUMP_INSTRUCTION jmp)
diff --git a/src/coreclr/dlls/mscoree/mscoree.cpp b/src/coreclr/dlls/mscoree/mscoree.cpp
index 4e2d87906ad309..c985b88ab30c2e 100644
--- a/src/coreclr/dlls/mscoree/mscoree.cpp
+++ b/src/coreclr/dlls/mscoree/mscoree.cpp
@@ -218,7 +218,7 @@ STDAPI ReOpenMetaDataWithMemoryEx(
static DWORD g_dwSystemDirectory = 0;
static WCHAR * g_pSystemDirectory = NULL;
-HRESULT GetInternalSystemDirectory(__out_ecount_part_opt(*pdwLength,*pdwLength) LPWSTR buffer, __inout DWORD* pdwLength)
+HRESULT GetInternalSystemDirectory(_Out_writes_to_opt_(*pdwLength,*pdwLength) LPWSTR buffer, __inout DWORD* pdwLength)
{
CONTRACTL {
NOTHROW;
@@ -252,7 +252,7 @@ HRESULT GetInternalSystemDirectory(__out_ecount_part_opt(*pdwLength,*pdwLength)
}
-LPCWSTR GetInternalSystemDirectory(__out DWORD* pdwLength)
+LPCWSTR GetInternalSystemDirectory(_Out_ DWORD* pdwLength)
{
LIMITED_METHOD_CONTRACT;
diff --git a/src/coreclr/dlls/mscorpe/ceefilegenwriter.cpp b/src/coreclr/dlls/mscorpe/ceefilegenwriter.cpp
index 6a0ba5a2499475..623f0087d400c0 100644
--- a/src/coreclr/dlls/mscorpe/ceefilegenwriter.cpp
+++ b/src/coreclr/dlls/mscorpe/ceefilegenwriter.cpp
@@ -487,7 +487,7 @@ HRESULT CeeFileGenWriter::generateImage(void **ppImage)
return hr;
} // HRESULT CeeFileGenWriter::generateImage()
-HRESULT CeeFileGenWriter::setOutputFileName(__in LPWSTR fileName)
+HRESULT CeeFileGenWriter::setOutputFileName(_In_ LPWSTR fileName)
{
if (m_outputFileName)
delete[] m_outputFileName;
@@ -498,7 +498,7 @@ HRESULT CeeFileGenWriter::setOutputFileName(__in LPWSTR fileName)
return S_OK;
} // HRESULT CeeFileGenWriter::setOutputFileName()
-HRESULT CeeFileGenWriter::setResourceFileName(__in LPWSTR fileName)
+HRESULT CeeFileGenWriter::setResourceFileName(_In_ LPWSTR fileName)
{
if (m_resourceFileName)
delete[] m_resourceFileName;
@@ -1294,7 +1294,7 @@ HRESULT CeeFileGenWriter::setVTableEntry(ULONG size, ULONG offset)
return setVTableEntry64(size,(void*)(ULONG_PTR)offset);
} // HRESULT CeeFileGenWriter::setVTableEntry()
-HRESULT CeeFileGenWriter::computeSectionOffset(CeeSection §ion, __in char *ptr,
+HRESULT CeeFileGenWriter::computeSectionOffset(CeeSection §ion, _In_ char *ptr,
unsigned *offset)
{
*offset = section.computeOffset(ptr);
@@ -1302,7 +1302,7 @@ HRESULT CeeFileGenWriter::computeSectionOffset(CeeSection §ion, __in char *p
return S_OK;
} // HRESULT CeeFileGenWriter::computeSectionOffset()
-HRESULT CeeFileGenWriter::computeOffset(__in char *ptr,
+HRESULT CeeFileGenWriter::computeOffset(_In_ char *ptr,
CeeSection **pSection, unsigned *offset)
{
TESTANDRETURNPOINTER(pSection);
diff --git a/src/coreclr/dlls/mscorpe/iceefilegen.cpp b/src/coreclr/dlls/mscorpe/iceefilegen.cpp
index 6714d355d0bfc3..6c40d9699fce91 100644
--- a/src/coreclr/dlls/mscorpe/iceefilegen.cpp
+++ b/src/coreclr/dlls/mscorpe/iceefilegen.cpp
@@ -183,7 +183,7 @@ HRESULT ICeeFileGen::AddSectionReloc (HCEESECTION section, ULONG offset, HCEESEC
}
}
-HRESULT ICeeFileGen::SetOutputFileName (HCEEFILE ceeFile, __in LPWSTR outputFileName)
+HRESULT ICeeFileGen::SetOutputFileName (HCEEFILE ceeFile, _In_ LPWSTR outputFileName)
{
TESTANDRETURNPOINTER(ceeFile);
TESTANDRETURNPOINTER(outputFileName);
@@ -192,7 +192,7 @@ HRESULT ICeeFileGen::SetOutputFileName (HCEEFILE ceeFile, __in LPWSTR outputFile
return(gen->setOutputFileName(outputFileName));
}
-__success(return == S_OK) HRESULT ICeeFileGen::GetOutputFileName (HCEEFILE ceeFile, __out LPWSTR *outputFileName)
+__success(return == S_OK) HRESULT ICeeFileGen::GetOutputFileName (HCEEFILE ceeFile, _Out_ LPWSTR *outputFileName)
{
TESTANDRETURNPOINTER(ceeFile);
TESTANDRETURNPOINTER(outputFileName);
@@ -204,7 +204,7 @@ __success(return == S_OK) HRESULT ICeeFileGen::GetOutputFileName (HCEEFILE ceeFi
}
-HRESULT ICeeFileGen::SetResourceFileName (HCEEFILE ceeFile, __in LPWSTR resourceFileName)
+HRESULT ICeeFileGen::SetResourceFileName (HCEEFILE ceeFile, _In_ LPWSTR resourceFileName)
{
TESTANDRETURNPOINTER(ceeFile);
TESTANDRETURNPOINTER(resourceFileName);
@@ -214,7 +214,7 @@ HRESULT ICeeFileGen::SetResourceFileName (HCEEFILE ceeFile, __in LPWSTR resource
}
__success(return == S_OK)
-HRESULT ICeeFileGen::GetResourceFileName (HCEEFILE ceeFile, __out LPWSTR *resourceFileName)
+HRESULT ICeeFileGen::GetResourceFileName (HCEEFILE ceeFile, _Out_ LPWSTR *resourceFileName)
{
TESTANDRETURNPOINTER(ceeFile);
TESTANDRETURNPOINTER(resourceFileName);
@@ -277,7 +277,7 @@ HRESULT ICeeFileGen::GetMethodRVA(HCEEFILE ceeFile, ULONG codeOffset, ULONG *cod
return S_OK;
}
-HRESULT ICeeFileGen::EmitString(HCEEFILE ceeFile, __in LPWSTR strValue, ULONG *strRef)
+HRESULT ICeeFileGen::EmitString(HCEEFILE ceeFile, _In_ LPWSTR strValue, ULONG *strRef)
{
TESTANDRETURNPOINTER(ceeFile);
@@ -429,7 +429,7 @@ HRESULT ICeeFileGen::SetStrongNameEntry(HCEEFILE ceeFile, ULONG size, ULONG offs
return gen->setStrongNameEntry(size, offset);
}
-HRESULT ICeeFileGen::ComputeSectionOffset(HCEESECTION section, __in char *ptr,
+HRESULT ICeeFileGen::ComputeSectionOffset(HCEESECTION section, _In_ char *ptr,
unsigned *offset)
{
TESTANDRETURNPOINTER(section);
@@ -443,7 +443,7 @@ HRESULT ICeeFileGen::ComputeSectionOffset(HCEESECTION section, __in char *ptr,
__success(return == S_OK)
HRESULT ICeeFileGen::ComputeSectionPointer(HCEESECTION section, ULONG offset,
- __out char **ptr)
+ _Out_ char **ptr)
{
TESTANDRETURNPOINTER(section);
@@ -454,7 +454,7 @@ HRESULT ICeeFileGen::ComputeSectionPointer(HCEESECTION section, ULONG offset,
return S_OK;
}
-HRESULT ICeeFileGen::ComputeOffset(HCEEFILE ceeFile, __in char *ptr,
+HRESULT ICeeFileGen::ComputeOffset(HCEEFILE ceeFile, _In_ char *ptr,
HCEESECTION *pSection, unsigned *offset)
{
TESTANDRETURNPOINTER(pSection);
diff --git a/src/coreclr/dlls/mscorpe/pewriter.cpp b/src/coreclr/dlls/mscorpe/pewriter.cpp
index 9add4b56d13b80..b78b00c2853ffb 100644
--- a/src/coreclr/dlls/mscorpe/pewriter.cpp
+++ b/src/coreclr/dlls/mscorpe/pewriter.cpp
@@ -1829,7 +1829,7 @@ HRESULT PEWriter::fixup(CeeGenTokenMapper *pMapper)
return(S_OK); // SUCCESS
}
-HRESULT PEWriter::Open(__in LPCWSTR fileName)
+HRESULT PEWriter::Open(_In_ LPCWSTR fileName)
{
_ASSERTE(m_file == INVALID_HANDLE_VALUE);
HRESULT hr = NOERROR;
@@ -1913,7 +1913,7 @@ HRESULT PEWriter::Close()
}
/******************************************************************/
-HRESULT PEWriter::write(__in LPCWSTR fileName) {
+HRESULT PEWriter::write(_In_ LPCWSTR fileName) {
HRESULT hr;
diff --git a/src/coreclr/dlls/mscorpe/pewriter.h b/src/coreclr/dlls/mscorpe/pewriter.h
index 21817b1d5efc45..84ec61f9275eca 100644
--- a/src/coreclr/dlls/mscorpe/pewriter.h
+++ b/src/coreclr/dlls/mscorpe/pewriter.h
@@ -41,7 +41,7 @@ class PEWriter : public PESectionMan
HRESULT link();
HRESULT fixup(CeeGenTokenMapper *pMapper);
- HRESULT write(__in LPCWSTR fileName);
+ HRESULT write(_In_ LPCWSTR fileName);
HRESULT write(void **ppImage);
// calling these functions is optional
@@ -174,7 +174,7 @@ class PEWriter : public PESectionMan
HRESULT linkPlaceSections(entry * entries, unsigned iEntries);
void setSectionIndex(IMAGE_SECTION_HEADER * h, unsigned sectionIndex);
- HRESULT Open(__in LPCWSTR fileName);
+ HRESULT Open(_In_ LPCWSTR fileName);
HRESULT Write(const void *data, int size);
HRESULT Seek(int offset);
HRESULT Pad(int align);
@@ -257,8 +257,8 @@ class PESeedSection : public PEWriterSection {
int getDirEntry() { _ASSERTE(!"PESeedSection"); return 0; }
HRESULT directoryEntry(unsigned num) { _ASSERTE(!"PESeedSection"); return E_FAIL; }
char * computePointer(unsigned offset) const { _ASSERTE(!"PESeedSection"); return NULL; }
- BOOL containsPointer(__in char *ptr) const { _ASSERTE(!"PESeedSection"); return FALSE; }
- unsigned computeOffset(__in char *ptr) const { _ASSERTE(!"PESeedSection"); return 0; }
+ BOOL containsPointer(_In_ char *ptr) const { _ASSERTE(!"PESeedSection"); return FALSE; }
+ unsigned computeOffset(_In_ char *ptr) const { _ASSERTE(!"PESeedSection"); return 0; }
HRESULT cloneInstance(PESection *destination) { _ASSERTE(!"PESeedSection"); return E_FAIL; }
// PEWriterSection
diff --git a/src/coreclr/dlls/mscorrc/mscorrc.rc b/src/coreclr/dlls/mscorrc/mscorrc.rc
index 2175566c10b610..0e78c99f38d5de 100644
--- a/src/coreclr/dlls/mscorrc/mscorrc.rc
+++ b/src/coreclr/dlls/mscorrc/mscorrc.rc
@@ -580,13 +580,13 @@ BEGIN
IDS_ER_FRAMEWORK_VERSION "CoreCLR Version: "
IDS_ER_UNHANDLEDEXCEPTION "Description: The process was terminated due to an unhandled exception."
IDS_ER_UNHANDLEDEXCEPTIONMSG "Exception Info: "
- IDS_ER_MANAGEDFAILFAST "Description: The application requested process termination through System.Environment.FailFast(string message)."
+ IDS_ER_MANAGEDFAILFAST "Description: The application requested process termination through System.Environment.FailFast."
IDS_ER_MANAGEDFAILFASTMSG "Message: "
IDS_ER_UNMANAGEDFAILFAST "Description: The process was terminated due to an internal error in the .NET Runtime "
IDS_ER_STACK_OVERFLOW "Description: The process was terminated due to stack overflow."
IDS_ER_STACK "Stack:"
IDS_ER_WORDAT "at"
- IDS_ER_UNMANAGEDFAILFASTMSG "at IP %1 (%2) with exit code %3."
+ IDS_ER_UNMANAGEDFAILFASTMSG "at IP 0x%x (0x%x) with exit code 0x%x."
IDS_ER_UNHANDLEDEXCEPTIONINFO "exception code %1, exception address %2"
IDS_ER_MESSAGE_TRUNCATE "The remainder of the message was truncated."
IDS_ER_CODECONTRACT_FAILED "Description: The application encountered a bug. A managed code contract (precondition, postcondition, object invariant, or assert) failed."
diff --git a/src/coreclr/gc/gc.cpp b/src/coreclr/gc/gc.cpp
index ace66eac266709..5a2a9c2c2c20e6 100644
--- a/src/coreclr/gc/gc.cpp
+++ b/src/coreclr/gc/gc.cpp
@@ -2522,6 +2522,8 @@ size_t gc_heap::bgc_loh_size_increased = 0;
size_t gc_heap::bgc_poh_size_increased = 0;
+size_t gc_heap::background_soh_size_end_mark = 0;
+
size_t gc_heap::background_soh_alloc_count = 0;
size_t gc_heap::background_uoh_alloc_count = 0;
@@ -28892,6 +28894,14 @@ void gc_heap::plan_phase (int condemned_gen_number)
{
dprintf (2,( "**** Doing Compacting GC ****"));
+#if defined(USE_REGIONS) && defined(BACKGROUND_GC)
+ if (should_update_end_mark_size())
+ {
+ background_soh_size_end_mark += generation_end_seg_allocated (older_gen) -
+ r_older_gen_end_seg_allocated;
+ }
+#endif //USE_REGIONS && BACKGROUND_GC
+
#ifndef USE_REGIONS
if (should_expand)
{
@@ -29396,6 +29406,13 @@ void gc_heap::fix_generation_bounds (int condemned_gen_number,
}
}
#endif //MULTIPLE_HEAPS
+
+#ifdef BACKGROUND_GC
+ if (should_update_end_mark_size())
+ {
+ background_soh_size_end_mark = generation_size (max_generation);
+ }
+#endif //BACKGROUND_GC
#endif //!USE_REGIONS
{
@@ -29614,6 +29631,14 @@ void gc_heap::thread_final_regions (bool compact_p)
generation_final_regions[gen_idx].tail = generation_tail_region (gen);
}
+#ifdef BACKGROUND_GC
+ heap_segment* max_gen_tail_region = 0;
+ if (should_update_end_mark_size())
+ {
+ max_gen_tail_region = generation_final_regions[max_generation].tail;
+ }
+#endif //BACKGROUND_GC
+
// Step 2: for each region in the condemned generations, we thread it onto its planned generation
// in our generation_final_regions array.
for (int gen_idx = condemned_gen_number; gen_idx >= 0; gen_idx--)
@@ -29664,6 +29689,21 @@ void gc_heap::thread_final_regions (bool compact_p)
}
}
+#ifdef BACKGROUND_GC
+ if (max_gen_tail_region)
+ {
+ max_gen_tail_region = heap_segment_next (max_gen_tail_region);
+
+ while (max_gen_tail_region)
+ {
+ background_soh_size_end_mark += heap_segment_allocated (max_gen_tail_region) -
+ heap_segment_mem (max_gen_tail_region);
+
+ max_gen_tail_region = heap_segment_next (max_gen_tail_region);
+ }
+ }
+#endif //BACKGROUND_GC
+
// Step 4: if a generation doesn't have any regions, we need to get a new one for it;
// otherwise we just set the head region as the start region for that generation.
for (int gen_idx = 0; gen_idx <= max_generation; gen_idx++)
@@ -29779,6 +29819,12 @@ heap_segment* gc_heap::allocate_new_region (gc_heap* hp, int gen_num, bool uoh_p
heap_segment* res = make_heap_segment (start, (end - start), hp, gen_num);
dprintf (REGIONS_LOG, ("got a new region %Ix %Ix->%Ix", (size_t)res, start, end));
+
+ if (res == nullptr)
+ {
+ global_region_allocator.delete_region (start);
+ }
+
return res;
}
@@ -32927,6 +32973,11 @@ void gc_heap::decommit_mark_array_by_seg (heap_segment* seg)
}
}
+bool gc_heap::should_update_end_mark_size()
+{
+ return ((settings.condemned_generation == (max_generation - 1)) && (current_c_gc_state == c_gc_state_planning));
+}
+
void gc_heap::background_mark_phase ()
{
verify_mark_array_cleared();
@@ -33001,6 +33052,7 @@ void gc_heap::background_mark_phase ()
bgc_begin_poh_size = total_poh_size;
bgc_loh_size_increased = 0;
bgc_poh_size_increased = 0;
+ background_soh_size_end_mark = 0;
dprintf (GTC_LOG, ("BM: h%d: loh: %Id, soh: %Id, poh: %Id", heap_number, total_loh_size, total_soh_size, total_poh_size));
@@ -33481,6 +33533,8 @@ void gc_heap::background_mark_phase ()
heap_segment_background_allocated (seg) = heap_segment_allocated (seg);
}
+ background_soh_size_end_mark += heap_segment_background_allocated (seg) - heap_segment_mem (seg);
+
dprintf (3333, ("h%d gen%d seg %Ix (%Ix) background allocated is %Ix",
heap_number, i, (size_t)(seg), heap_segment_mem (seg),
heap_segment_background_allocated (seg)));
@@ -45097,11 +45151,11 @@ size_t GCHeap::GetTotalBytesInUse ()
for (int i = 0; i < gc_heap::n_heaps; i++)
{
GCHeap* Hp = gc_heap::g_heaps [i]->vm_heap;
- tot_size += Hp->ApproxTotalBytesInUse (FALSE);
+ tot_size += Hp->ApproxTotalBytesInUse();
}
return tot_size;
#else
- return ApproxTotalBytesInUse ();
+ return ApproxTotalBytesInUse();
#endif //MULTIPLE_HEAPS
}
@@ -45156,58 +45210,58 @@ size_t GCHeap::ApproxTotalBytesInUse(BOOL small_heap_only)
size_t totsize = 0;
enter_spin_lock (&pGenGCHeap->gc_lock);
- // the complication with the following code is that background GC may
- // remove the ephemeral segment while we are iterating
- // if so, we retry a couple times and ultimately may report a slightly wrong result
- for (int tries = 1; tries <= 3; tries++)
+ // For gen0 it's a bit complicated because we are currently allocating in it. We get the fragmentation first
+ // just so that we don't give a negative number for the resulting size.
+ generation* gen = pGenGCHeap->generation_of (0);
+ size_t gen0_frag = generation_free_list_space (gen) + generation_free_obj_space (gen);
+ uint8_t* current_alloc_allocated = pGenGCHeap->alloc_allocated;
+ heap_segment* current_eph_seg = pGenGCHeap->ephemeral_heap_segment;
+ size_t gen0_size = 0;
+#ifdef USE_REGIONS
+ heap_segment* gen0_seg = generation_start_segment (gen);
+ while (gen0_seg)
{
- heap_segment* eph_seg = generation_allocation_segment (pGenGCHeap->generation_of (0));
- // Get small block heap size info
- totsize = (pGenGCHeap->alloc_allocated - heap_segment_mem (eph_seg));
- heap_segment* seg1 = generation_start_segment (pGenGCHeap->generation_of (max_generation));
- while ((seg1 != eph_seg) && (seg1 != nullptr)
-#ifdef BACKGROUND_GC
- && (seg1 != pGenGCHeap->freeable_soh_segment)
-#endif //BACKGROUND_GC
- )
+ uint8_t* end = in_range_for_segment (current_alloc_allocated, gen0_seg) ?
+ current_alloc_allocated : heap_segment_allocated (gen0_seg);
+ gen0_size += end - heap_segment_mem (gen0_seg);
+
+ if (gen0_seg == current_eph_seg)
{
-#ifdef BACKGROUND_GC
- if (!heap_segment_decommitted_p (seg1))
-#endif //BACKGROUND_GC
- {
- totsize += heap_segment_allocated (seg1) -
- heap_segment_mem (seg1);
- }
- seg1 = heap_segment_next (seg1);
- }
- if (seg1 == eph_seg)
break;
+ }
+
+ gen0_seg = heap_segment_next (gen0_seg);
}
+#else //USE_REGIONS
+ // For segments ephemeral seg does not change.
+ gen0_size = current_alloc_allocated - heap_segment_mem (current_eph_seg);
+#endif //USE_REGIONS
- //discount the fragmentation
- for (int i = 0; i <= max_generation; i++)
+ totsize = gen0_size - gen0_frag;
+
+ int stop_gen_index = max_generation;
+
+ if (gc_heap::current_c_gc_state == c_gc_state_planning)
+ {
+ // During BGC sweep since we can be deleting SOH segments, we avoid walking the segment
+ // list.
+ generation* oldest_gen = pGenGCHeap->generation_of (max_generation);
+ totsize = pGenGCHeap->background_soh_size_end_mark - generation_free_list_space (oldest_gen) - generation_free_obj_space (oldest_gen);
+ stop_gen_index--;
+ }
+
+ for (int i = (max_generation - 1); i <= stop_gen_index; i++)
{
generation* gen = pGenGCHeap->generation_of (i);
- totsize -= (generation_free_list_space (gen) + generation_free_obj_space (gen));
+ totsize += pGenGCHeap->generation_size (i) - generation_free_list_space (gen) - generation_free_obj_space (gen);
}
if (!small_heap_only)
{
for (int i = uoh_start_generation; i < total_generation_count; i++)
{
- heap_segment* seg2 = generation_start_segment (pGenGCHeap->generation_of (i));
-
- while (seg2 != 0)
- {
- totsize += heap_segment_allocated (seg2) -
- heap_segment_mem (seg2);
- seg2 = heap_segment_next (seg2);
- }
-
- //discount the fragmentation
- generation* uoh_gen = pGenGCHeap->generation_of (i);
- size_t frag = generation_free_list_space (uoh_gen) + generation_free_obj_space (uoh_gen);
- totsize -= frag;
+ generation* gen = pGenGCHeap->generation_of (i);
+ totsize += pGenGCHeap->generation_size (i) - generation_free_list_space (gen) - generation_free_obj_space (gen);
}
}
leave_spin_lock (&pGenGCHeap->gc_lock);
diff --git a/src/coreclr/gc/gcpriv.h b/src/coreclr/gc/gcpriv.h
index 081b9a539c073c..14bf3ef2908895 100644
--- a/src/coreclr/gc/gcpriv.h
+++ b/src/coreclr/gc/gcpriv.h
@@ -51,8 +51,8 @@ inline void FATAL_GC_ERROR()
//
// This means any empty regions can be freely used for any generation. For
// Server GC we will balance regions between heaps.
-// For now enable regions by default for only StandAlone GC builds
-#if defined (HOST_64BIT) && defined (BUILD_AS_STANDALONE)
+// For now disable regions StandAlone GC builds
+#if defined (HOST_64BIT) && !defined (BUILD_AS_STANDALONE)
#define USE_REGIONS
#endif //HOST_64BIT && BUILD_AS_STANDALONE
@@ -3440,6 +3440,9 @@ class gc_heap
PER_HEAP
void decommit_mark_array_by_seg (heap_segment* seg);
+ PER_HEAP_ISOLATED
+ bool should_update_end_mark_size();
+
PER_HEAP
void background_mark_phase();
@@ -4268,6 +4271,9 @@ class gc_heap
PER_HEAP
size_t bgc_poh_size_increased;
+ PER_HEAP
+ size_t background_soh_size_end_mark;
+
PER_HEAP
size_t background_soh_alloc_count;
diff --git a/src/coreclr/gc/unix/gcenv.unix.cpp b/src/coreclr/gc/unix/gcenv.unix.cpp
index 895d2afdf395a9..431421afc87e40 100644
--- a/src/coreclr/gc/unix/gcenv.unix.cpp
+++ b/src/coreclr/gc/unix/gcenv.unix.cpp
@@ -98,7 +98,7 @@ extern "C"
# define __NR_membarrier 389
# elif defined(__aarch64__)
# define __NR_membarrier 283
-# elif
+# else
# error Unknown architecture
# endif
# endif
diff --git a/src/coreclr/hosts/corerun/dotenv.cpp b/src/coreclr/hosts/corerun/dotenv.cpp
index ba22f5004713d0..0e0e37c7919b0a 100644
--- a/src/coreclr/hosts/corerun/dotenv.cpp
+++ b/src/coreclr/hosts/corerun/dotenv.cpp
@@ -4,10 +4,13 @@
#include "dotenv.hpp"
#include
#include
-#include
#include
#include
+#ifdef TARGET_WINDOWS
+#include
+#endif
+
namespace
{
pal::string_t convert_to_string_t(std::string str)
diff --git a/src/coreclr/hosts/coreshim/CoreShim.cpp b/src/coreclr/hosts/coreshim/CoreShim.cpp
index 62ab011df12155..23265e5872b3f6 100644
--- a/src/coreclr/hosts/coreshim/CoreShim.cpp
+++ b/src/coreclr/hosts/coreshim/CoreShim.cpp
@@ -375,7 +375,7 @@ HRESULT coreclr::Initialize(
HMODULE mod = ::GetModuleHandleW(W("CoreRun.exe"));
if (mod != NULL)
{
- using GetCurrentClrDetailsFunc = HRESULT(*)(void **clrInstance, unsigned int *appDomainId);
+ using GetCurrentClrDetailsFunc = HRESULT(__cdecl *)(void **clrInstance, unsigned int *appDomainId);
auto getCurrentClrDetails = (GetCurrentClrDetailsFunc)::GetProcAddress(mod, "GetCurrentClrDetails");
RETURN_IF_FAILED(getCurrentClrDetails(&_clrInst, &_appDomainId));
if (_clrInst != nullptr)
diff --git a/src/coreclr/ilasm/asmman.cpp b/src/coreclr/ilasm/asmman.cpp
index 7b5fd474b65157..447267d0b4d252 100644
--- a/src/coreclr/ilasm/asmman.cpp
+++ b/src/coreclr/ilasm/asmman.cpp
@@ -49,7 +49,7 @@ BinStr* BinStrToUnicode(BinStr* pSource, bool Swap)
return NULL;
}
-AsmManFile* AsmMan::GetFileByName(__in __nullterminated char* szFileName)
+AsmManFile* AsmMan::GetFileByName(_In_ __nullterminated char* szFileName)
{
AsmManFile* ret = NULL;
if(szFileName)
@@ -63,14 +63,14 @@ AsmManFile* AsmMan::GetFileByName(__in __nullterminated char* szFileName
return ret;
}
-mdToken AsmMan::GetFileTokByName(__in __nullterminated char* szFileName)
+mdToken AsmMan::GetFileTokByName(_In_ __nullterminated char* szFileName)
{
AsmManFile* tmp = GetFileByName(szFileName);
return(tmp ? tmp->tkTok : mdFileNil);
}
-AsmManComType* AsmMan::GetComTypeByName(__in_opt __nullterminated char* szComTypeName,
- __in_opt __nullterminated char* szComEnclosingTypeName)
+AsmManComType* AsmMan::GetComTypeByName(_In_opt_z_ char* szComTypeName,
+ _In_opt_z_ char* szComEnclosingTypeName)
{
AsmManComType* ret = NULL;
if(szComTypeName)
@@ -102,14 +102,14 @@ AsmManComType* AsmMan::GetComTypeByName(__in_opt __nullterminated char*
}
mdToken AsmMan::GetComTypeTokByName(
- __in_opt __nullterminated char* szComTypeName,
- __in_opt __nullterminated char* szComEnclosingTypeName)
+ _In_opt_z_ char* szComTypeName,
+ _In_opt_z_ char* szComEnclosingTypeName)
{
AsmManComType* tmp = GetComTypeByName(szComTypeName, szComEnclosingTypeName);
return(tmp ? tmp->tkTok : mdExportedTypeNil);
}
-AsmManAssembly* AsmMan::GetAsmRefByName(__in __nullterminated const char* szAsmRefName)
+AsmManAssembly* AsmMan::GetAsmRefByName(_In_ __nullterminated const char* szAsmRefName)
{
AsmManAssembly* ret = NULL;
if(szAsmRefName)
@@ -124,12 +124,12 @@ AsmManAssembly* AsmMan::GetAsmRefByName(__in __nullterminated const char* sz
}
return ret;
}
-mdToken AsmMan::GetAsmRefTokByName(__in __nullterminated const char* szAsmRefName)
+mdToken AsmMan::GetAsmRefTokByName(_In_ __nullterminated const char* szAsmRefName)
{
AsmManAssembly* tmp = GetAsmRefByName(szAsmRefName);
return(tmp ? tmp->tkTok : mdAssemblyRefNil);
}
-AsmManAssembly* AsmMan::GetAsmRefByAsmName(__in __nullterminated const char* szAsmName)
+AsmManAssembly* AsmMan::GetAsmRefByAsmName(_In_ __nullterminated const char* szAsmName)
{
AsmManAssembly* ret = NULL;
if(szAsmName)
@@ -160,7 +160,7 @@ void AsmMan::SetModuleName(__inout_opt __nullterminated char* szName)
}
//==============================================================================================================
-void AsmMan::AddFile(__in __nullterminated char* szName, DWORD dwAttr, BinStr* pHashBlob)
+void AsmMan::AddFile(_In_ __nullterminated char* szName, DWORD dwAttr, BinStr* pHashBlob)
{
AsmManFile* tmp = GetFileByName(szName);
Assembler* pAsm = (Assembler*)m_pAssembler;
@@ -244,7 +244,7 @@ void AsmMan::EmitFiles()
} //end for(i = 0; tmp=m_FileLst.PEEK(i); i++)
}
-void AsmMan::StartAssembly(__in __nullterminated char* szName, __in_opt __nullterminated char* szAlias, DWORD dwAttr, BOOL isRef)
+void AsmMan::StartAssembly(_In_ __nullterminated char* szName, _In_opt_z_ char* szAlias, DWORD dwAttr, BOOL isRef)
{
if(!isRef && (0==strcmp(szName, "mscorlib"))) ((Assembler*)m_pAssembler)->m_fIsMscorlib = TRUE;
if(!isRef && (m_pAssembly != NULL))
@@ -674,7 +674,7 @@ void AsmMan::SetAssemblyAutodetect()
}
}
-void AsmMan::StartComType(__in __nullterminated char* szName, DWORD dwAttr)
+void AsmMan::StartComType(_In_ __nullterminated char* szName, DWORD dwAttr)
{
if((m_pCurComType = new AsmManComType))
{
@@ -732,7 +732,7 @@ void AsmMan::EndComType()
}
}
-void AsmMan::SetComTypeFile(__in __nullterminated char* szFileName)
+void AsmMan::SetComTypeFile(_In_ __nullterminated char* szFileName)
{
if(m_pCurComType)
{
@@ -740,7 +740,7 @@ void AsmMan::SetComTypeFile(__in __nullterminated char* szFileName)
}
}
-void AsmMan::SetComTypeAsmRef(__in __nullterminated char* szAsmRefName)
+void AsmMan::SetComTypeAsmRef(_In_ __nullterminated char* szAsmRefName)
{
if(m_pCurComType)
{
@@ -748,7 +748,7 @@ void AsmMan::SetComTypeAsmRef(__in __nullterminated char* szAsmRefName)
}
}
-void AsmMan::SetComTypeComType(__in __nullterminated char* szComTypeName)
+void AsmMan::SetComTypeComType(_In_ __nullterminated char* szComTypeName)
{
if(m_pCurComType)
{
@@ -780,7 +780,7 @@ BOOL AsmMan::SetComTypeClassTok(mdToken tkClass)
return FALSE;
}
-void AsmMan::StartManifestRes(__in __nullterminated char* szName, __in __nullterminated char* szAlias, DWORD dwAttr)
+void AsmMan::StartManifestRes(_In_ __nullterminated char* szName, _In_ __nullterminated char* szAlias, DWORD dwAttr)
{
if((m_pCurManRes = new AsmManRes))
{
@@ -808,7 +808,7 @@ void AsmMan::EndManifestRes()
}
-void AsmMan::SetManifestResFile(__in __nullterminated char* szFileName, ULONG ulOffset)
+void AsmMan::SetManifestResFile(_In_ __nullterminated char* szFileName, ULONG ulOffset)
{
if(m_pCurManRes)
{
@@ -817,7 +817,7 @@ void AsmMan::SetManifestResFile(__in __nullterminated char* szFileName, ULONG
}
}
-void AsmMan::SetManifestResAsmRef(__in __nullterminated char* szAsmRefName)
+void AsmMan::SetManifestResAsmRef(_In_ __nullterminated char* szAsmRefName)
{
if(m_pCurManRes)
{
diff --git a/src/coreclr/ilasm/asmman.hpp b/src/coreclr/ilasm/asmman.hpp
index 1290c9b2707c8a..972c8382434f8e 100644
--- a/src/coreclr/ilasm/asmman.hpp
+++ b/src/coreclr/ilasm/asmman.hpp
@@ -193,12 +193,12 @@ class AsmMan
ErrorReporter* report;
void* m_pAssembler;
- AsmManFile* GetFileByName(__in __nullterminated char* szFileName);
- AsmManAssembly* GetAsmRefByName(__in __nullterminated const char* szAsmRefName);
- AsmManComType* GetComTypeByName(__in_opt __nullterminated char* szComTypeName,
- __in_opt __nullterminated char* szComEnclosingTypeName = NULL);
- mdToken GetComTypeTokByName(__in_opt __nullterminated char* szComTypeName,
- __in_opt __nullterminated char* szComEnclosingTypeName = NULL);
+ AsmManFile* GetFileByName(_In_ __nullterminated char* szFileName);
+ AsmManAssembly* GetAsmRefByName(_In_ __nullterminated const char* szAsmRefName);
+ AsmManComType* GetComTypeByName(_In_opt_z_ char* szComTypeName,
+ _In_opt_z_ char* szComEnclosingTypeName = NULL);
+ mdToken GetComTypeTokByName(_In_opt_z_ char* szComTypeName,
+ _In_opt_z_ char* szComEnclosingTypeName = NULL);
IMetaDataEmit* m_pEmitter;
@@ -241,11 +241,11 @@ class AsmMan
void SetModuleName(__inout_opt __nullterminated char* szName);
- void AddFile(__in __nullterminated char* szName, DWORD dwAttr, BinStr* pHashBlob);
+ void AddFile(_In_ __nullterminated char* szName, DWORD dwAttr, BinStr* pHashBlob);
void EmitFiles();
void EmitDebuggableAttribute(mdToken tkOwner);
- void StartAssembly(__in __nullterminated char* szName, __in_opt __nullterminated char* szAlias, DWORD dwAttr, BOOL isRef);
+ void StartAssembly(_In_ __nullterminated char* szName, _In_opt_z_ char* szAlias, DWORD dwAttr, BOOL isRef);
void EndAssembly();
void EmitAssemblyRefs();
void EmitAssembly();
@@ -257,27 +257,27 @@ class AsmMan
void SetAssemblyHashBlob(BinStr* pHashBlob);
void SetAssemblyAutodetect();
- void StartComType(__in __nullterminated char* szName, DWORD dwAttr);
+ void StartComType(_In_ __nullterminated char* szName, DWORD dwAttr);
void EndComType();
- void SetComTypeFile(__in __nullterminated char* szFileName);
- void SetComTypeAsmRef(__in __nullterminated char* szAsmRefName);
- void SetComTypeComType(__in __nullterminated char* szComTypeName);
+ void SetComTypeFile(_In_ __nullterminated char* szFileName);
+ void SetComTypeAsmRef(_In_ __nullterminated char* szAsmRefName);
+ void SetComTypeComType(_In_ __nullterminated char* szComTypeName);
BOOL SetComTypeImplementationTok(mdToken tk);
BOOL SetComTypeClassTok(mdToken tkClass);
- void StartManifestRes(__in __nullterminated char* szName, __in __nullterminated char* szAlias, DWORD dwAttr);
+ void StartManifestRes(_In_ __nullterminated char* szName, _In_ __nullterminated char* szAlias, DWORD dwAttr);
void EndManifestRes();
- void SetManifestResFile(__in __nullterminated char* szFileName, ULONG ulOffset);
- void SetManifestResAsmRef(__in __nullterminated char* szAsmRefName);
+ void SetManifestResFile(_In_ __nullterminated char* szFileName, ULONG ulOffset);
+ void SetManifestResAsmRef(_In_ __nullterminated char* szAsmRefName);
- AsmManAssembly* GetAsmRefByAsmName(__in __nullterminated const char* szAsmName);
+ AsmManAssembly* GetAsmRefByAsmName(_In_ __nullterminated const char* szAsmName);
- mdToken GetFileTokByName(__in __nullterminated char* szFileName);
- mdToken GetAsmRefTokByName(__in __nullterminated const char* szAsmRefName);
- mdToken GetAsmTokByName(__in __nullterminated const char* szAsmName)
+ mdToken GetFileTokByName(_In_ __nullterminated char* szFileName);
+ mdToken GetAsmRefTokByName(_In_ __nullterminated const char* szAsmRefName);
+ mdToken GetAsmTokByName(_In_ __nullterminated const char* szAsmName)
{ return (m_pAssembly && (strcmp(m_pAssembly->szName,szAsmName)==0)) ? m_pAssembly->tkTok : 0; };
- mdToken GetModuleRefTokByName(__in __nullterminated char* szName)
+ mdToken GetModuleRefTokByName(_In_ __nullterminated char* szName)
{
if(szName && *szName)
{
diff --git a/src/coreclr/ilasm/asmparse.h b/src/coreclr/ilasm/asmparse.h
index ef377b5e430d7c..e5479202730033 100644
--- a/src/coreclr/ilasm/asmparse.h
+++ b/src/coreclr/ilasm/asmparse.h
@@ -20,11 +20,11 @@ class ReadStream {
virtual ~ReadStream() = default;
- virtual unsigned getAll(__out char** ppch) = 0;
+ virtual unsigned getAll(_Out_ char** ppch) = 0;
// read at most 'buffLen' bytes into 'buff', Return the
// number of characters read. On EOF return 0
- virtual unsigned read(__out_ecount(buffLen) char* buff, unsigned buffLen) = 0;
+ virtual unsigned read(_Out_writes_(buffLen) char* buff, unsigned buffLen) = 0;
// Return the name of the stream, (for error reporting).
//virtual const char* name() = 0;
@@ -49,12 +49,12 @@ class BinStrStream : public ReadStream {
//if(m_pBS)
// delete m_pBS;
};
- unsigned getAll(__out char **ppbuff)
+ unsigned getAll(_Out_ char **ppbuff)
{
*ppbuff = m_pStart;
return m_pBS->length();
};
- unsigned read(__out_ecount(buffLen) char* buff, unsigned buffLen)
+ unsigned read(_Out_writes_(buffLen) char* buff, unsigned buffLen)
{
_ASSERTE(m_pStart != NULL);
unsigned Remainder = (unsigned)(m_pEnd - m_pCurr);
@@ -95,7 +95,7 @@ class BinStrStream : public ReadStream {
/**************************************************************************/
class MappedFileStream : public ReadStream {
public:
- MappedFileStream(__in __nullterminated WCHAR* wFileName)
+ MappedFileStream(_In_ __nullterminated WCHAR* wFileName)
{
fileNameW = wFileName;
m_hFile = INVALID_HANDLE_VALUE;
@@ -124,12 +124,12 @@ class MappedFileStream : public ReadStream {
fileNameW = NULL;
}
}
- unsigned getAll(__out char** pbuff)
+ unsigned getAll(_Out_ char** pbuff)
{
*pbuff = m_pStart;
return m_FileSize;
}
- unsigned read(__out_ecount(buffLen) char* buff, unsigned buffLen)
+ unsigned read(_Out_writes_(buffLen) char* buff, unsigned buffLen)
{
_ASSERTE(m_pStart != NULL);
unsigned Remainder = (unsigned)(m_pEnd - m_pCurr);
@@ -214,29 +214,29 @@ typedef LIFO ARG_NAME_LIST_STACK;
/*--------------------------------------------------------------------------*/
typedef char*(*PFN_NEXTCHAR)(char*);
-char* nextcharU(__in __nullterminated char* pos);
-char* nextcharW(__in __nullterminated char* pos);
+char* nextcharU(_In_ __nullterminated char* pos);
+char* nextcharW(_In_ __nullterminated char* pos);
/*--------------------------------------------------------------------------*/
typedef unsigned(*PFN_SYM)(char*);
-unsigned SymAU(__in __nullterminated char* curPos);
-unsigned SymW(__in __nullterminated char* curPos);
+unsigned SymAU(_In_ __nullterminated char* curPos);
+unsigned SymW(_In_ __nullterminated char* curPos);
/*--------------------------------------------------------------------------*/
typedef char*(*PFN_NEWSTRFROMTOKEN)(char*,size_t);
-char* NewStrFromTokenAU(__in_ecount(tokLen) char* curTok, size_t tokLen);
-char* NewStrFromTokenW(__in_ecount(tokLen) char* curTok, size_t tokLen);
+char* NewStrFromTokenAU(_In_reads_(tokLen) char* curTok, size_t tokLen);
+char* NewStrFromTokenW(_In_reads_(tokLen) char* curTok, size_t tokLen);
/*--------------------------------------------------------------------------*/
typedef char*(*PFN_NEWSTATICSTRFROMTOKEN)(char*,size_t,char*,size_t);
-char* NewStaticStrFromTokenAU(__in_ecount(tokLen) char* curTok, size_t tokLen, __out_ecount(bufSize) char* staticBuf, size_t bufSize);
-char* NewStaticStrFromTokenW(__in_ecount(tokLen) char* curTok, size_t tokLen, __out_ecount(bufSize) char* staticBuf, size_t bufSize);
+char* NewStaticStrFromTokenAU(_In_reads_(tokLen) char* curTok, size_t tokLen, _Out_writes_(bufSize) char* staticBuf, size_t bufSize);
+char* NewStaticStrFromTokenW(_In_reads_(tokLen) char* curTok, size_t tokLen, _Out_writes_(bufSize) char* staticBuf, size_t bufSize);
/*--------------------------------------------------------------------------*/
typedef unsigned(*PFN_GETDOUBLE)(char*,unsigned,double**);
-unsigned GetDoubleAU(__in __nullterminated char* begNum, unsigned L, double** ppRes);
-unsigned GetDoubleW(__in __nullterminated char* begNum, unsigned L, double** ppRes);
+unsigned GetDoubleAU(_In_ __nullterminated char* begNum, unsigned L, double** ppRes);
+unsigned GetDoubleW(_In_ __nullterminated char* begNum, unsigned L, double** ppRes);
/*--------------------------------------------------------------------------*/
struct PARSING_ENVIRONMENT
{
@@ -284,9 +284,9 @@ class AsmParse : public ErrorReporter
virtual void warn(const char* fmt, ...);
virtual void msg(const char* fmt, ...);
char *getLine(int lineNum) { return penv->in->getLine(lineNum); };
- unsigned getAll(__out char** pbuff) { return penv->in->getAll(pbuff); };
+ unsigned getAll(_Out_ char** pbuff) { return penv->in->getAll(pbuff); };
bool Success() {return success; };
- void SetIncludePath(__in WCHAR* wz) { wzIncludePath = wz; };
+ void SetIncludePath(_In_ WCHAR* wz) { wzIncludePath = wz; };
ARG_NAME_LIST_STACK m_ANSFirst;
ARG_NAME_LIST_STACK m_ANSLast;
@@ -298,20 +298,20 @@ class AsmParse : public ErrorReporter
BinStr* MakeTypeClass(CorElementType kind, mdToken tk);
BinStr* MakeTypeArray(CorElementType kind, BinStr* elemType, BinStr* bounds);
- char* fillBuff(__in_opt __nullterminated char* curPos); // refill the input buffer
+ char* fillBuff(_In_opt_z_ char* curPos); // refill the input buffer
HANDLE hstdout;
HANDLE hstderr;
private:
- friend void yyerror(__in __nullterminated const char* str);
+ friend void yyerror(_In_ __nullterminated const char* str);
friend int parse_literal(unsigned curSym, __inout __nullterminated char* &curPos, BOOL translate_escapes);
friend int yyparse();
friend int yylex();
friend Instr* SetupInstr(unsigned short opcode);
friend int findKeyword(const char* name, size_t nameLen, unsigned short* opcode);
- friend TypeDefDescr* findTypedef(__in_ecount(nameLen) char* name, size_t nameLen);
- friend char* skipBlanks(__in __nullterminated char*,unsigned*);
- friend char* nextBlank(__in __nullterminated char*);
+ friend TypeDefDescr* findTypedef(_In_reads_(nameLen) char* name, size_t nameLen);
+ friend char* skipBlanks(_In_ __nullterminated char*,unsigned*);
+ friend char* nextBlank(_In_ __nullterminated char*);
friend int ProcessEOF();
friend unsigned __int8* skipType(unsigned __int8* ptr, BOOL fFixupType);
friend void FixupConstraints();
diff --git a/src/coreclr/ilasm/assem.cpp b/src/coreclr/ilasm/assem.cpp
index e8044d16ab2b7f..e58b8e569d8d34 100644
--- a/src/coreclr/ilasm/assem.cpp
+++ b/src/coreclr/ilasm/assem.cpp
@@ -1039,7 +1039,7 @@ BOOL Assembler::EmitProp(PropDescriptor* pPD)
return TRUE;
}
-Class *Assembler::FindCreateClass(__in __nullterminated const char *pszFQN)
+Class *Assembler::FindCreateClass(_In_ __nullterminated const char *pszFQN)
{
Class *pSearch = NULL;
@@ -1186,7 +1186,7 @@ BOOL Assembler::DoGlobalFixups()
return TRUE;
}
-state_t Assembler::AddGlobalLabel(__in __nullterminated char *pszName, HCEESECTION section)
+state_t Assembler::AddGlobalLabel(_In_ __nullterminated char *pszName, HCEESECTION section)
{
if (FindGlobalLabel(pszName) != NULL)
{
@@ -1213,7 +1213,7 @@ state_t Assembler::AddGlobalLabel(__in __nullterminated char *pszName, HCEESECTI
return m_State;
}
-void Assembler::AddLabel(DWORD CurPC, __in __nullterminated char *pszName)
+void Assembler::AddLabel(DWORD CurPC, _In_ __nullterminated char *pszName)
{
if (m_pCurMethod->FindLabel(pszName) != NULL)
{
@@ -1478,7 +1478,7 @@ acceptable. Do NOT use for cryptographic purposes.
*/
unsigned hash(
- __in_ecount(length) const BYTE *k, /* the key */
+ _In_reads_(length) const BYTE *k, /* the key */
unsigned length, /* the length of the key */
unsigned initval) /* the previous hash, or an arbitrary value */
{
diff --git a/src/coreclr/ilasm/assembler.cpp b/src/coreclr/ilasm/assembler.cpp
index 48f9487656f7cf..85183bfae7542b 100644
--- a/src/coreclr/ilasm/assembler.cpp
+++ b/src/coreclr/ilasm/assembler.cpp
@@ -15,7 +15,7 @@
#define FAIL_UNLESS(x, y) if (!(x)) { report->error y; return; }
/**************************************************************************/
-void Assembler::StartNameSpace(__in __nullterminated char* name)
+void Assembler::StartNameSpace(_In_ __nullterminated char* name)
{
m_NSstack.PUSH(m_szNamespace);
m_szNamespace = name;
@@ -91,7 +91,7 @@ void Assembler::ClearBoundList(void)
m_TyParList = NULL;
}
/**************************************************************************/
-mdToken Assembler::ResolveClassRef(mdToken tkResScope, __in __nullterminated const char *pszFullClassName, Class** ppClass)
+mdToken Assembler::ResolveClassRef(mdToken tkResScope, _In_ __nullterminated const char *pszFullClassName, Class** ppClass)
{
Class *pClass = NULL;
mdToken tkRet = mdTokenNil;
@@ -239,7 +239,7 @@ mdToken Assembler::ResolveTypeSpec(BinStr* typeSpec)
}
/**************************************************************************/
-mdToken Assembler::GetAsmRef(__in __nullterminated const char* szName)
+mdToken Assembler::GetAsmRef(_In_ __nullterminated const char* szName)
{
mdToken tkResScope = 0;
if(strcmp(szName,"*")==0) tkResScope = mdTokenNil;
@@ -330,7 +330,7 @@ mdToken Assembler::GetInterfaceImpl(mdToken tsClass, mdToken tsInterface)
}
/**************************************************************************/
-mdToken Assembler::GetModRef(__in __nullterminated char* szName)
+mdToken Assembler::GetModRef(_In_ __nullterminated char* szName)
{
mdToken tkResScope = 0;
if(!strcmp(szName,m_szScopeName))
@@ -417,7 +417,7 @@ DWORD Assembler::CheckClassFlagsIfNested(Class* pEncloser, DWORD attr)
/**************************************************************************/
-void Assembler::StartClass(__in __nullterminated char* name, DWORD attr, TyParList *typars)
+void Assembler::StartClass(_In_ __nullterminated char* name, DWORD attr, TyParList *typars)
{
Class *pEnclosingClass = m_pCurClass;
char *szFQN;
@@ -607,7 +607,7 @@ void Assembler::SetPinvoke(BinStr* DllName, int Ordinal, BinStr* Alias, int Attr
}
/**************************************************************************/
-void Assembler::StartMethod(__in __nullterminated char* name, BinStr* sig, CorMethodAttr flags, BinStr* retMarshal, DWORD retAttr, TyParList *typars)
+void Assembler::StartMethod(_In_ __nullterminated char* name, BinStr* sig, CorMethodAttr flags, BinStr* retMarshal, DWORD retAttr, TyParList *typars)
{
if (m_pCurMethod != NULL)
{
@@ -801,7 +801,7 @@ void Assembler::EndMethod()
}
/**************************************************************************/
/* rvaLabel is the optional label that indicates this field points at a particular RVA */
-void Assembler::AddField(__inout_z __inout char* name, BinStr* sig, CorFieldAttr flags, __in __nullterminated char* rvaLabel, BinStr* pVal, ULONG ulOffset)
+void Assembler::AddField(__inout_z __inout char* name, BinStr* sig, CorFieldAttr flags, _In_ __nullterminated char* rvaLabel, BinStr* pVal, ULONG ulOffset)
{
FieldDescriptor* pFD;
ULONG i,n;
@@ -1030,7 +1030,7 @@ void Assembler::NewSEHDescriptor(void) //sets m_SEHD
if(m_SEHD == NULL) report->error("Failed to allocate SEH descriptor\n");
}
/**************************************************************************/
-void Assembler::SetTryLabels(__in __nullterminated char * szFrom, __in __nullterminated char *szTo)
+void Assembler::SetTryLabels(_In_ __nullterminated char * szFrom, _In_ __nullterminated char *szTo)
{
if(!m_SEHD) return;
Label *pLbl = m_pCurMethod->FindLabel(szFrom);
@@ -1043,7 +1043,7 @@ void Assembler::SetTryLabels(__in __nullterminated char * szFrom, __in __nullter
else report->error("Undefined 1st label in 'try
diff --git a/src/coreclr/tools/ILVerification/TypeVerifier.cs b/src/coreclr/tools/ILVerification/TypeVerifier.cs
index 9c760c8dd733fb..94672533bdd21f 100644
--- a/src/coreclr/tools/ILVerification/TypeVerifier.cs
+++ b/src/coreclr/tools/ILVerification/TypeVerifier.cs
@@ -99,7 +99,11 @@ public void VerifyInterfaces()
continue;
}
- MethodDesc resolvedMethod = type.ResolveInterfaceMethodTarget(method);
+ if (type.ResolveInterfaceMethodTarget(method) is not MethodDesc resolvedMethod)
+ {
+ type.ResolveInterfaceMethodToDefaultImplementationOnType(method, out resolvedMethod);
+ }
+
if (resolvedMethod is null)
{
VerificationError(VerifierError.InterfaceMethodNotImplemented, Format(type), Format(implementedInterface.InterfaceType, _module, implementedInterface.InterfaceImplementation), Format(method));
diff --git a/src/coreclr/tools/InjectResource/InjectResource.cpp b/src/coreclr/tools/InjectResource/InjectResource.cpp
index 61f49f5d3c7301..cf5c3917df9d2c 100644
--- a/src/coreclr/tools/InjectResource/InjectResource.cpp
+++ b/src/coreclr/tools/InjectResource/InjectResource.cpp
@@ -12,8 +12,8 @@ char* g_appName;
#define MAX(x,y) ((x) > (y) ? (x) : (y))
void
-AddBinaryResourceToDll(__in_z char* dllName,
- __in_z const char* resName,
+AddBinaryResourceToDll(_In_z_ char* dllName,
+ _In_z_ const char* resName,
PVOID resData,
ULONG resDataSize)
{
@@ -59,7 +59,7 @@ AddBinaryResourceToDll(__in_z char* dllName,
}
void
-GetBinFileData(__in_z char* binFileName, PVOID* binData, PULONG binDataSize)
+GetBinFileData(_In_z_ char* binFileName, PVOID* binData, PULONG binDataSize)
{
HANDLE binFileHandle;
PVOID data;
@@ -108,7 +108,7 @@ Usage(void)
}
void __cdecl
-main(int argc, __in_z char** argv)
+main(int argc, _In_z_ char** argv)
{
char* binFile = NULL;
char* dllFile = NULL;
diff --git a/src/coreclr/tools/StressLogAnalyzer/StressLogDump.cpp b/src/coreclr/tools/StressLogAnalyzer/StressLogDump.cpp
index a0e8c877be52f2..f7f22d310c1b33 100644
--- a/src/coreclr/tools/StressLogAnalyzer/StressLogDump.cpp
+++ b/src/coreclr/tools/StressLogAnalyzer/StressLogDump.cpp
@@ -39,7 +39,7 @@ void GcHistAddLog(LPCSTR msg, StressMsg* stressMsg);
/*********************************************************************************/
-static const WCHAR* getTime(const FILETIME* time, __out_ecount (buffLen) WCHAR* buff, int buffLen)
+static const WCHAR* getTime(const FILETIME* time, _Out_writes_ (buffLen) WCHAR* buff, int buffLen)
{
SYSTEMTIME systemTime;
static const WCHAR badTime[] = W("BAD TIME");
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilationBuilder.Aot.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilationBuilder.Aot.cs
index 25cd0bc9b85a6b..fb4ad5ce51b7f6 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilationBuilder.Aot.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilationBuilder.Aot.cs
@@ -22,7 +22,6 @@ partial class CompilationBuilder
protected MethodImportationErrorProvider _methodImportationErrorProvider = new MethodImportationErrorProvider();
protected IInliningPolicy _inliningPolicy;
protected bool _methodBodyFolding;
- protected bool _singleThreaded;
protected InstructionSetSupport _instructionSetSupport;
protected SecurityMitigationOptions _mitigationOptions;
@@ -92,12 +91,6 @@ public CompilationBuilder UseMethodBodyFolding(bool enable)
return this;
}
- public CompilationBuilder UseSingleThread(bool enable)
- {
- _singleThreaded = enable;
- return this;
- }
-
public CompilationBuilder UsePreinitializationManager(PreinitializationManager manager)
{
_preinitializationManager = manager;
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.Aot.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.Aot.cs
index 33305d2011c876..66e6044d418a1f 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.Aot.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.Aot.cs
@@ -14,12 +14,21 @@ namespace ILCompiler
{
partial class CompilerTypeSystemContext
{
+ // Chosen rather arbitrarily. For the app that I was looking at, cutoff point of 7 compiled
+ // more than 10 minutes on a release build of the compiler, and I lost patience.
+ // Cutoff point of 5 produced an 1.7 GB object file.
+ // Cutoff point of 4 produced an 830 MB object file.
+ // Cutoff point of 3 produced an 470 MB object file.
+ // We want this to be high enough so that it doesn't cut off too early. But also not too
+ // high because things that are recursive often end up expanding laterally as well
+ // through various other generic code the deep code calls into.
+ public const int DefaultGenericCycleCutoffPoint = 4;
+
public SharedGenericsConfiguration GenericsConfig
{
get;
}
- private readonly DelegateFeature _delegateFeatures;
private readonly MetadataFieldLayoutAlgorithm _metadataFieldLayoutAlgorithm = new CompilerMetadataFieldLayoutAlgorithm();
private readonly RuntimeDeterminedFieldLayoutAlgorithm _runtimeDeterminedFieldLayoutAlgorithm = new RuntimeDeterminedFieldLayoutAlgorithm();
private readonly VectorOfTFieldLayoutAlgorithm _vectorOfTFieldLayoutAlgorithm;
@@ -29,7 +38,7 @@ public SharedGenericsConfiguration GenericsConfig
private ArrayOfTRuntimeInterfacesAlgorithm _arrayOfTRuntimeInterfacesAlgorithm;
private MetadataType _arrayOfTType;
- public CompilerTypeSystemContext(TargetDetails details, SharedGenericsMode genericsMode, DelegateFeature delegateFeatures)
+ public CompilerTypeSystemContext(TargetDetails details, SharedGenericsMode genericsMode, DelegateFeature delegateFeatures, int genericCycleCutoffPoint = DefaultGenericCycleCutoffPoint)
: base(details)
{
_genericsMode = genericsMode;
@@ -37,7 +46,9 @@ public CompilerTypeSystemContext(TargetDetails details, SharedGenericsMode gener
_vectorOfTFieldLayoutAlgorithm = new VectorOfTFieldLayoutAlgorithm(_metadataFieldLayoutAlgorithm);
_vectorFieldLayoutAlgorithm = new VectorFieldLayoutAlgorithm(_metadataFieldLayoutAlgorithm);
- _delegateFeatures = delegateFeatures;
+ _delegateInfoHashtable = new DelegateInfoHashtable(delegateFeatures);
+
+ _genericCycleDetector = new LazyGenericsSupport.GenericCycleDetector(genericCycleCutoffPoint);
GenericsConfig = new SharedGenericsConfiguration();
}
@@ -165,11 +176,6 @@ protected virtual IEnumerable GetAllMethodsForDelegate(TypeDesc type
yield return m;
}
- protected override DelegateInfo CreateDelegateInfo(TypeDesc delegateType)
- {
- return new DelegateInfo(delegateType, _delegateFeatures);
- }
-
internal DefType GetClosestDefType(TypeDesc type)
{
if (type.IsArray)
@@ -187,7 +193,7 @@ internal DefType GetClosestDefType(TypeDesc type)
return (DefType)type;
}
- private readonly LazyGenericsSupport.GenericCycleDetector _genericCycleDetector = new LazyGenericsSupport.GenericCycleDetector();
+ private readonly LazyGenericsSupport.GenericCycleDetector _genericCycleDetector;
public void DetectGenericCycles(TypeSystemEntity owner, TypeSystemEntity referent)
{
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.BoxedTypes.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.BoxedTypes.cs
index 8be62c3d9950db..39a6bf3490beb0 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.BoxedTypes.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.BoxedTypes.cs
@@ -259,7 +259,8 @@ private partial class BoxedValueType : MetadataType, INonEmittableType
public override string Name => "Boxed_" + ValueTypeRepresented.Name;
public override string Namespace => ValueTypeRepresented.Namespace;
-
+ public override string DiagnosticName => "Boxed_" + ValueTypeRepresented.DiagnosticName;
+ public override string DiagnosticNamespace => ValueTypeRepresented.DiagnosticNamespace;
public override Instantiation Instantiation => ValueTypeRepresented.Instantiation;
public override PInvokeStringFormat PInvokeStringFormat => PInvokeStringFormat.AutoClass;
public override bool IsExplicitLayout => false;
@@ -411,6 +412,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return _targetMethod.DiagnosticName + "_Unbox";
+ }
+ }
+
public override MethodIL EmitIL()
{
if (_owningType.ValueTypeRepresented.IsByRefLike)
@@ -487,6 +496,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return _targetMethod.DiagnosticName + "_Unbox";
+ }
+ }
+
public override MethodIL EmitIL()
{
if (_owningType.ValueTypeRepresented.IsByRefLike)
@@ -574,6 +591,7 @@ public ValueTypeInstanceMethodWithHiddenParameter(MethodDesc methodRepresented)
public override TypeDesc OwningType => _methodRepresented.OwningType;
public override string Name => _methodRepresented.Name;
+ public override string DiagnosticName => _methodRepresented.DiagnosticName;
public override MethodSignature Signature
{
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.DelegateInfo.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.DelegateInfo.cs
similarity index 67%
rename from src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.DelegateInfo.cs
rename to src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.DelegateInfo.cs
index b9a3a3e1fdbbb2..a021e39691d226 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.DelegateInfo.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.DelegateInfo.cs
@@ -4,13 +4,19 @@
using System;
using Internal.IL;
+using Internal.TypeSystem;
-namespace Internal.TypeSystem
+namespace ILCompiler
{
- public abstract partial class TypeSystemContext
+ partial class CompilerTypeSystemContext
{
private class DelegateInfoHashtable : LockFreeReaderHashtable
{
+ private readonly DelegateFeature _delegateFeatures;
+
+ public DelegateInfoHashtable(DelegateFeature features)
+ => _delegateFeatures = features;
+
protected override int GetKeyHashCode(TypeDesc key)
{
return key.GetHashCode();
@@ -29,24 +35,15 @@ protected override bool CompareValueToValue(DelegateInfo value1, DelegateInfo va
}
protected override DelegateInfo CreateValueFromKey(TypeDesc key)
{
- return key.Context.CreateDelegateInfo(key);
+ return new DelegateInfo(key, _delegateFeatures);
}
}
- private DelegateInfoHashtable _delegateInfoHashtable = new DelegateInfoHashtable();
+ private readonly DelegateInfoHashtable _delegateInfoHashtable;
public DelegateInfo GetDelegateInfo(TypeDesc delegateType)
{
return _delegateInfoHashtable.GetOrCreateValue(delegateType);
}
-
- ///
- /// Creates a for a given delegate type.
- ///
- protected virtual DelegateInfo CreateDelegateInfo(TypeDesc key)
- {
- // Type system contexts that support creating delegate infos need to override.
- throw new NotSupportedException();
- }
}
}
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.DynamicInvoke.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.DynamicInvoke.cs
similarity index 85%
rename from src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.DynamicInvoke.cs
rename to src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.DynamicInvoke.cs
index 290f11dd90a508..0ed3d107b3a396 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.DynamicInvoke.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.DynamicInvoke.cs
@@ -2,12 +2,13 @@
// The .NET Foundation licenses this file to you under the MIT license.
using Internal.IL.Stubs;
+using Internal.TypeSystem;
using Debug = System.Diagnostics.Debug;
-namespace Internal.TypeSystem
+namespace ILCompiler
{
- partial class TypeSystemContext
+ partial class CompilerTypeSystemContext
{
private class DynamicInvokeThunkHashtable : LockFreeReaderHashtable
{
@@ -17,7 +18,7 @@ private class DynamicInvokeThunkHashtable : LockFreeReaderHashtable value.TargetSignature.GetHashCode();
protected override DynamicInvokeMethodThunk CreateValueFromKey(DynamicInvokeMethodSignature key)
{
- return new DynamicInvokeMethodThunk(key.Context.GeneratedAssembly.GetGlobalModuleType(), key);
+ return new DynamicInvokeMethodThunk(((CompilerTypeSystemContext)key.Context).GeneratedAssembly.GetGlobalModuleType(), key);
}
}
DynamicInvokeThunkHashtable _dynamicInvokeThunks = new DynamicInvokeThunkHashtable();
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.EnumMethods.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.EnumMethods.cs
similarity index 97%
rename from src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.EnumMethods.cs
rename to src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.EnumMethods.cs
index 0be009f53c7bb3..b777e28a2d144e 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.EnumMethods.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.EnumMethods.cs
@@ -3,13 +3,14 @@
using System.Collections.Generic;
+using Internal.TypeSystem;
using Internal.IL.Stubs;
using Debug = System.Diagnostics.Debug;
-namespace Internal.TypeSystem
+namespace ILCompiler
{
- public abstract partial class TypeSystemContext
+ partial class CompilerTypeSystemContext
{
private class EnumInfo
{
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.GeneratedAssembly.Sorting.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.GeneratedAssembly.Sorting.cs
similarity index 64%
rename from src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.GeneratedAssembly.Sorting.cs
rename to src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.GeneratedAssembly.Sorting.cs
index a2490a4cb196e7..41254150763cf9 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.GeneratedAssembly.Sorting.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.GeneratedAssembly.Sorting.cs
@@ -3,16 +3,18 @@
using System;
-namespace Internal.TypeSystem
+using Internal.TypeSystem;
+
+namespace ILCompiler
{
- partial class TypeSystemContext
+ partial class CompilerTypeSystemContext
{
// Functionality related to determinstic ordering of types and members
partial class CompilerGeneratedType : MetadataType
{
- protected internal override int ClassCode => -1036681447;
+ protected override int ClassCode => -1036681447;
- protected internal override int CompareToImpl(TypeDesc other, TypeSystemComparer comparer)
+ protected override int CompareToImpl(TypeDesc other, TypeSystemComparer comparer)
{
// Should be a singleton
throw new NotSupportedException();
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.GeneratedAssembly.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.GeneratedAssembly.cs
similarity index 94%
rename from src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.GeneratedAssembly.cs
rename to src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.GeneratedAssembly.cs
index a01beba3cea869..280f2d85684a3b 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.GeneratedAssembly.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.GeneratedAssembly.cs
@@ -4,14 +4,16 @@
using System;
using System.Collections.Generic;
+using Internal.TypeSystem;
+
using TypeHashingAlgorithms = Internal.NativeFormat.TypeHashingAlgorithms;
using Interlocked = System.Threading.Interlocked;
using AssemblyName = System.Reflection.AssemblyName;
using Debug = System.Diagnostics.Debug;
-namespace Internal.TypeSystem
+namespace ILCompiler
{
- partial class TypeSystemContext
+ partial class CompilerTypeSystemContext
{
private ModuleDesc _generatedAssembly;
@@ -89,6 +91,14 @@ public override string Name
get;
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return Name;
+ }
+ }
+
public override string Namespace
{
get
@@ -97,6 +107,14 @@ public override string Namespace
}
}
+ public override string DiagnosticNamespace
+ {
+ get
+ {
+ return "Internal.CompilerGenerated";
+ }
+ }
+
public override int GetHashCode()
{
if (_hashcode != 0)
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.IntefaceThunks.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.IntefaceThunks.cs
index ad558ae43bf51b..adc509298c0bbc 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.IntefaceThunks.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.IntefaceThunks.cs
@@ -149,7 +149,7 @@ protected override bool CompareValueToValue(DefaultInterfaceMethodImplementation
}
protected override DefaultInterfaceMethodImplementationInstantiationThunk CreateValueFromKey(DefaultInterfaceMethodImplementationInstantiationThunkHashtableKey key)
{
- TypeDesc owningTypeOfThunks = key.TargetMethod.Context.GeneratedAssembly.GetGlobalModuleType();
+ TypeDesc owningTypeOfThunks = ((CompilerTypeSystemContext)key.TargetMethod.Context).GeneratedAssembly.GetGlobalModuleType();
return new DefaultInterfaceMethodImplementationInstantiationThunk(owningTypeOfThunks, key.TargetMethod, key.InterfaceIndex);
}
}
@@ -194,6 +194,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return _targetMethod.DiagnosticName;
+ }
+ }
+
public MethodDesc BaseMethod => _targetMethod;
public string Prefix => $"__InstantiatingStub_{_interfaceIndex}_";
@@ -274,6 +282,7 @@ public DefaultInterfaceMethodImplementationWithHiddenParameter(MethodDesc method
public override TypeDesc OwningType => _owningType;
public override string Name => _methodRepresented.Name;
+ public override string DiagnosticName => _methodRepresented.DiagnosticName;
public override MethodSignature Signature
{
diff --git a/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.ValueTypeMethods.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.ValueTypeMethods.cs
similarity index 97%
rename from src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.ValueTypeMethods.cs
rename to src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.ValueTypeMethods.cs
index f44bf4b11cf8e2..738b43554182c8 100644
--- a/src/coreclr/tools/Common/TypeSystem/IL/TypeSystemContext.ValueTypeMethods.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.ValueTypeMethods.cs
@@ -3,13 +3,14 @@
using System.Collections.Generic;
+using Internal.TypeSystem;
using Internal.IL.Stubs;
using Debug = System.Diagnostics.Debug;
-namespace Internal.TypeSystem
+namespace ILCompiler
{
- public abstract partial class TypeSystemContext
+ partial class CompilerTypeSystemContext
{
private MethodDesc _objectEqualsMethod;
@@ -154,7 +155,7 @@ private bool ComputeCanCompareValueTypeBits(MetadataType type)
// Would be a suprise if this wasn't a valuetype. We checked ContainsGCPointers above.
Debug.Assert(fieldType.IsValueType);
- MethodDesc objectEqualsMethod = fieldType.Context._objectEqualsMethod;
+ MethodDesc objectEqualsMethod = ((CompilerTypeSystemContext)fieldType.Context)._objectEqualsMethod;
// If the field overrides Equals, we can't use the fast helper because we need to call the method.
if (fieldType.FindVirtualFunctionTargetMethodOnObjectType(objectEqualsMethod).OwningType == fieldType)
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DelegateCreationInfo.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DelegateCreationInfo.cs
index 0195f82d6c3692..dc6cd81fcccf5d 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DelegateCreationInfo.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DelegateCreationInfo.cs
@@ -161,7 +161,7 @@ private DelegateCreationInfo(IMethodNode constructor, MethodDesc targetMethod, T
///
public static DelegateCreationInfo Create(TypeDesc delegateType, MethodDesc targetMethod, NodeFactory factory, bool followVirtualDispatch)
{
- TypeSystemContext context = delegateType.Context;
+ CompilerTypeSystemContext context = factory.TypeSystemContext;
DefType systemDelegate = context.GetWellKnownType(WellKnownType.MulticastDelegate).BaseType;
int paramCountTargetMethod = targetMethod.Signature.Length;
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/CallingConventionConverterKey.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/CallingConventionConverterKey.cs
index 7c94539fb6bb42..40b7281dbba01b 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/CallingConventionConverterKey.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/CallingConventionConverterKey.cs
@@ -78,4 +78,156 @@ public static string GetName(this MethodSignature signature)
return nameBuilder.ToString();
}
}
+
+ public class UniqueTypeNameFormatter : TypeNameFormatter
+ {
+ public static UniqueTypeNameFormatter Instance { get; } = new UniqueTypeNameFormatter();
+
+ public override void AppendName(StringBuilder sb, PointerType type)
+ {
+ AppendName(sb, type.ParameterType);
+ sb.Append('*');
+ }
+
+ public override void AppendName(StringBuilder sb, GenericParameterDesc type)
+ {
+ string prefix = type.Kind == GenericParameterKind.Type ? "!" : "!!";
+ sb.Append(prefix);
+ sb.Append(type.Name);
+ }
+
+ public override void AppendName(StringBuilder sb, SignatureTypeVariable type)
+ {
+ sb.Append("!");
+ sb.Append(type.Index.ToStringInvariant());
+ }
+
+ public override void AppendName(StringBuilder sb, SignatureMethodVariable type)
+ {
+ sb.Append("!!");
+ sb.Append(type.Index.ToStringInvariant());
+ }
+
+ public override void AppendName(StringBuilder sb, FunctionPointerType type)
+ {
+ MethodSignature signature = type.Signature;
+
+ AppendName(sb, signature.ReturnType);
+
+ sb.Append(" (");
+ for (int i = 0; i < signature.Length; i++)
+ {
+ if (i > 0)
+ sb.Append(", ");
+ AppendName(sb, signature[i]);
+ }
+
+ // TODO: Append '...' for vararg methods
+
+ sb.Append(')');
+ }
+
+ public override void AppendName(StringBuilder sb, ByRefType type)
+ {
+ AppendName(sb, type.ParameterType);
+ sb.Append(" ByRef");
+ }
+
+ public override void AppendName(StringBuilder sb, ArrayType type)
+ {
+ AppendName(sb, type.ElementType);
+ sb.Append('[');
+
+ if (type.Rank == 1 && type.IsMdArray)
+ sb.Append('*');
+ sb.Append(',', type.Rank - 1);
+
+ sb.Append(']');
+ }
+
+ protected override void AppendNameForInstantiatedType(StringBuilder sb, DefType type)
+ {
+ AppendName(sb, type.GetTypeDefinition());
+ sb.Append('<');
+
+ for (int i = 0; i < type.Instantiation.Length; i++)
+ {
+ if (i > 0)
+ sb.Append(", ");
+ AppendName(sb, type.Instantiation[i]);
+ }
+
+ sb.Append('>');
+ }
+
+ protected override void AppendNameForNamespaceType(StringBuilder sb, DefType type)
+ {
+ string ns = GetTypeNamespace(type);
+ if (ns.Length > 0)
+ {
+ AppendEscapedIdentifier(sb, ns);
+ sb.Append('.');
+ }
+ AppendEscapedIdentifier(sb, GetTypeName(type));
+
+ if (type is MetadataType)
+ {
+ IAssemblyDesc homeAssembly = ((MetadataType)type).Module as IAssemblyDesc;
+ AppendAssemblyName(sb, homeAssembly);
+ }
+ }
+
+ private void AppendAssemblyName(StringBuilder sb, IAssemblyDesc assembly)
+ {
+ if (assembly == null)
+ return;
+
+ sb.Append(',');
+ AppendEscapedIdentifier(sb, assembly.GetName().Name);
+ }
+
+ protected override void AppendNameForNestedType(StringBuilder sb, DefType nestedType, DefType containingType)
+ {
+ AppendName(sb, containingType);
+
+ sb.Append('+');
+
+ string ns = GetTypeNamespace(nestedType);
+ if (ns.Length > 0)
+ {
+ AppendEscapedIdentifier(sb, ns);
+ sb.Append('.');
+ }
+ AppendEscapedIdentifier(sb, GetTypeName(nestedType));
+ }
+
+ private string GetTypeName(DefType type)
+ {
+ return type.Name;
+ }
+
+ private string GetTypeNamespace(DefType type)
+ {
+ return type.Namespace;
+ }
+
+ private static char[] s_escapedChars = new char[] { ',', '=', '"', ']', '[', '*', '&', '+', '\\' };
+ private void AppendEscapedIdentifier(StringBuilder sb, string identifier)
+ {
+ if (identifier.IndexOfAny(s_escapedChars) < 0)
+ {
+ string escapedIdentifier = identifier;
+ foreach (char escapedChar in s_escapedChars)
+ {
+ string escapedCharString = new string(escapedChar, 1);
+ escapedIdentifier = escapedIdentifier.Replace(escapedCharString, "\\" + escapedCharString);
+ }
+ sb.Append(escapedIdentifier);
+ }
+ else
+ {
+ sb.Append(identifier);
+ }
+ }
+ }
}
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/FatFunctionPointerNode.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/FatFunctionPointerNode.cs
index 9873fb76c78370..2dd04047e594e0 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/FatFunctionPointerNode.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/FatFunctionPointerNode.cs
@@ -35,7 +35,7 @@ public void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb)
}
int ISymbolDefinitionNode.Offset => 0;
- int ISymbolNode.Offset => Method.Context.Target.FatFunctionPointerOffset;
+ int ISymbolNode.Offset => Method.Context.Target.Architecture == TargetArchitecture.Wasm32 ? 1 << 31 : 2;
public override bool IsShareable => true;
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/HardwareIntrinsicHelpers.Aot.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/HardwareIntrinsicHelpers.Aot.cs
index 7c12cf6c8a3da5..188d44c3f65fb8 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/HardwareIntrinsicHelpers.Aot.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/HardwareIntrinsicHelpers.Aot.cs
@@ -95,6 +95,7 @@ private static class XArchIntrinsicConstants
public const int Bmi1 = 0x0400;
public const int Bmi2 = 0x0800;
public const int Lzcnt = 0x1000;
+ public const int AvxVnni = 0x2000;
public static int FromHardwareIntrinsicId(string id)
{
@@ -113,6 +114,7 @@ public static int FromHardwareIntrinsicId(string id)
"Bmi1" => Bmi1,
"Bmi2" => Bmi2,
"Lzcnt" => Lzcnt,
+ "AvxVnni" => AvxVnni,
_ => throw new NotSupportedException(),
};
}
@@ -155,6 +157,8 @@ public static int FromInstructionSetFlags(InstructionSetFlags instructionSets)
InstructionSet.X64_BMI2_X64 => Bmi2,
InstructionSet.X64_LZCNT => Lzcnt,
InstructionSet.X64_LZCNT_X64 => Popcnt,
+ InstructionSet.X64_AVXVNNI => AvxVnni,
+ InstructionSet.X64_AVXVNNI_X64 => AvxVnni,
// SSE and SSE2 are baseline ISAs - they're always available
InstructionSet.X64_SSE => 0,
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ILScanner.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ILScanner.cs
index e10bbe95f07971..ae9e60343dfb42 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ILScanner.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ILScanner.cs
@@ -4,18 +4,18 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
-using System.Threading;
+using System.Threading.Tasks;
using ILCompiler.DependencyAnalysis;
using ILCompiler.DependencyAnalysisFramework;
using Internal.IL;
using Internal.IL.Stubs;
+using Internal.JitInterface;
using Internal.TypeSystem;
using Internal.ReadyToRunConstants;
using Debug = System.Diagnostics.Debug;
-using Internal.JitInterface;
namespace ILCompiler
{
@@ -26,8 +26,7 @@ namespace ILCompiler
///
internal sealed class ILScanner : Compilation, IILScanner
{
- private CountdownEvent _compilationCountdown;
- private readonly bool _singleThreaded;
+ private readonly int _parallelism;
internal ILScanner(
DependencyAnalyzerBase dependencyGraph,
@@ -36,11 +35,11 @@ internal ILScanner(
ILProvider ilProvider,
DebugInformationProvider debugInformationProvider,
Logger logger,
- bool singleThreaded)
+ int parallelism)
: base(dependencyGraph, nodeFactory, roots, ilProvider, debugInformationProvider, null, nodeFactory.CompilationModuleGroup, logger)
{
_helperCache = new HelperCache(this);
- _singleThreaded = singleThreaded;
+ _parallelism = parallelism;
}
protected override void CompileInternal(string outputFile, ObjectDumper dumper)
@@ -78,7 +77,7 @@ protected override void ComputeDependencyNodeDependencies(List methodsToCompile)
Logger.Writer.WriteLine($"Scanning {methodsToCompile.Count} methods...");
}
- WaitCallback compileSingleMethodDelegate = m => CompileSingleMethod((ScannedMethodNode)m);
-
- using (_compilationCountdown = new CountdownEvent(methodsToCompile.Count))
- {
- foreach (ScannedMethodNode methodCodeNodeNeedingCode in methodsToCompile)
- {
- ThreadPool.QueueUserWorkItem(compileSingleMethodDelegate, methodCodeNodeNeedingCode);
- }
-
- _compilationCountdown.Wait();
- _compilationCountdown = null;
- }
+ Parallel.ForEach(
+ methodsToCompile,
+ new ParallelOptions { MaxDegreeOfParallelism = _parallelism },
+ CompileSingleMethod);
}
private void CompileSingleThreaded(List methodsToCompile)
@@ -142,11 +133,6 @@ private void CompileSingleMethod(ScannedMethodNode methodCodeNodeNeedingCode)
{
throw new CodeGenerationFailedException(method, ex);
}
- finally
- {
- if (_compilationCountdown != null)
- _compilationCountdown.Signal();
- }
}
ILScanResults IILScanner.Scan()
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ILScannerBuilder.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ILScannerBuilder.cs
index 27e7e64b6ce193..cf784d458dde24 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ILScannerBuilder.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ILScannerBuilder.cs
@@ -27,7 +27,7 @@ public sealed class ILScannerBuilder
private IEnumerable _compilationRoots = Array.Empty();
private MetadataManager _metadataManager;
private InteropStubManager _interopStubManager = new EmptyInteropStubManager();
- private bool _singleThreaded;
+ private int _parallelism = -1;
internal ILScannerBuilder(CompilerTypeSystemContext context, CompilationModuleGroup compilationGroup, NameMangler mangler, ILProvider ilProvider, PreinitializationManager preinitializationManager)
{
@@ -63,9 +63,9 @@ public ILScannerBuilder UseInteropStubManager(InteropStubManager interopStubMana
return this;
}
- public ILScannerBuilder UseSingleThread(bool enable)
+ public ILScannerBuilder UseParallelism(int parallelism)
{
- _singleThreaded = enable;
+ _parallelism = parallelism;
return this;
}
@@ -74,7 +74,7 @@ public IILScanner ToILScanner()
var nodeFactory = new ILScanNodeFactory(_context, _compilationGroup, _metadataManager, _interopStubManager, _nameMangler, _preinitializationManager);
DependencyAnalyzerBase graph = _dependencyTrackingLevel.CreateDependencyGraph(nodeFactory);
- return new ILScanner(graph, nodeFactory, _compilationRoots, _ilProvider, new NullDebugInformationProvider(), _logger, _singleThreaded);
+ return new ILScanner(graph, nodeFactory, _compilationRoots, _ilProvider, new NullDebugInformationProvider(), _logger, _parallelism);
}
}
}
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/LazyGenerics/ModuleCycleInfo.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/LazyGenerics/ModuleCycleInfo.cs
index 47b1ce7e1d05c0..378af488af0208 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/LazyGenerics/ModuleCycleInfo.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/LazyGenerics/ModuleCycleInfo.cs
@@ -34,18 +34,69 @@ public bool FormsCycle(TypeSystemEntity owner)
TypeDesc ownerType = (owner as EcmaMethod)?.OwningType;
return _entitiesInCycles.Contains(owner) || (ownerType != null && _entitiesInCycles.Contains(ownerType));
}
+ }
+
+ private class CycleInfoHashtable : LockFreeReaderHashtable
+ {
+ protected override bool CompareKeyToValue(EcmaModule key, ModuleCycleInfo value) => key == value.Module;
+ protected override bool CompareValueToValue(ModuleCycleInfo value1, ModuleCycleInfo value2) => value1.Module == value2.Module;
+ protected override int GetKeyHashCode(EcmaModule key) => key.GetHashCode();
+ protected override int GetValueHashCode(ModuleCycleInfo value) => value.Module.GetHashCode();
+
+ protected override ModuleCycleInfo CreateValueFromKey(EcmaModule key)
+ {
+ GraphBuilder gb = new GraphBuilder(key);
+ Graph graph = gb.Graph;
+
+ var formalsNeedingLazyGenerics = graph.ComputeVerticesInvolvedInAFlaggedCycle();
+ var entitiesNeedingLazyGenerics = new HashSet();
+
+ foreach (EcmaGenericParameter formal in formalsNeedingLazyGenerics)
+ {
+ var formalDefinition = key.MetadataReader.GetGenericParameter(formal.Handle);
+ if (formal.Kind == GenericParameterKind.Type)
+ {
+ entitiesNeedingLazyGenerics.Add(key.GetType(formalDefinition.Parent));
+ }
+ else
+ {
+ entitiesNeedingLazyGenerics.Add(key.GetMethod(formalDefinition.Parent));
+ }
+ }
+
+ return new ModuleCycleInfo(key, entitiesNeedingLazyGenerics);
+ }
+ }
+
+ internal class GenericCycleDetector
+ {
+ private readonly CycleInfoHashtable _hashtable = new CycleInfoHashtable();
+
+ private readonly struct EntityPair : IEquatable
+ {
+ public readonly TypeSystemEntity Owner;
+ public readonly TypeSystemEntity Referent;
+ public EntityPair(TypeSystemEntity owner, TypeSystemEntity referent)
+ => (Owner, Referent) = (owner, referent);
+ public bool Equals(EntityPair other) => Owner == other.Owner && Referent == other.Referent;
+ public override bool Equals(object obj) => obj is EntityPair p && Equals(p);
+ public override int GetHashCode() => HashCode.Combine(Owner.GetHashCode(), Referent.GetHashCode());
+ }
+
+ // This is a set of entities that had actual problems that caused us to abort compilation
+ // somewhere.
+ // Would prefer this to be a ConcurrentHashSet but there isn't any. ModuleCycleInfo can be looked up
+ // from the key, but since this is a key/value pair, might as well use the value too...
+ private readonly ConcurrentDictionary _actualProblems = new ConcurrentDictionary();
+
+ private readonly int _cutoffPoint;
+
+ public GenericCycleDetector(int cutoffPoint)
+ {
+ _cutoffPoint = cutoffPoint;
+ }
- // Chosen rather arbitrarily. For the app that I was looking at, cutoff point of 7 compiled
- // more than 10 minutes on a release build of the compiler, and I lost patience.
- // Cutoff point of 5 produced an 1.7 GB object file.
- // Cutoff point of 4 produced an 830 MB object file.
- // Cutoff point of 3 produced an 470 MB object file.
- // We want this to be high enough so that it doesn't cut off too early. But also not too
- // high because things that are recursive often end up expanding laterally as well
- // through various other generic code the deep code calls into.
- private const int CutoffPoint = 4;
-
- public bool IsDeepPossiblyCyclicInstantiation(TypeSystemEntity entity)
+ private bool IsDeepPossiblyCyclicInstantiation(TypeSystemEntity entity)
{
if (entity is TypeDesc type)
{
@@ -57,7 +108,7 @@ public bool IsDeepPossiblyCyclicInstantiation(TypeSystemEntity entity)
}
}
- public bool IsDeepPossiblyCyclicInstantiation(TypeDesc type, List seenTypes = null)
+ private bool IsDeepPossiblyCyclicInstantiation(TypeDesc type, List seenTypes = null)
{
switch (type.Category)
{
@@ -80,7 +131,7 @@ public bool IsDeepPossiblyCyclicInstantiation(TypeDesc type, List seen
count++;
}
- if (count > CutoffPoint)
+ if (count > _cutoffPoint)
{
return true;
}
@@ -112,60 +163,6 @@ public bool IsDeepPossiblyCyclicInstantiation(MethodDesc method)
{
return IsDeepPossiblyCyclicInstantiation(method.Instantiation) || IsDeepPossiblyCyclicInstantiation(method.OwningType);
}
- }
-
- private class CycleInfoHashtable : LockFreeReaderHashtable
- {
- protected override bool CompareKeyToValue(EcmaModule key, ModuleCycleInfo value) => key == value.Module;
- protected override bool CompareValueToValue(ModuleCycleInfo value1, ModuleCycleInfo value2) => value1.Module == value2.Module;
- protected override int GetKeyHashCode(EcmaModule key) => key.GetHashCode();
- protected override int GetValueHashCode(ModuleCycleInfo value) => value.Module.GetHashCode();
-
- protected override ModuleCycleInfo CreateValueFromKey(EcmaModule key)
- {
- GraphBuilder gb = new GraphBuilder(key);
- Graph graph = gb.Graph;
-
- var formalsNeedingLazyGenerics = graph.ComputeVerticesInvolvedInAFlaggedCycle();
- var entitiesNeedingLazyGenerics = new HashSet();
-
- foreach (EcmaGenericParameter formal in formalsNeedingLazyGenerics)
- {
- var formalDefinition = key.MetadataReader.GetGenericParameter(formal.Handle);
- if (formal.Kind == GenericParameterKind.Type)
- {
- entitiesNeedingLazyGenerics.Add(key.GetType(formalDefinition.Parent));
- }
- else
- {
- entitiesNeedingLazyGenerics.Add(key.GetMethod(formalDefinition.Parent));
- }
- }
-
- return new ModuleCycleInfo(key, entitiesNeedingLazyGenerics);
- }
- }
-
- internal class GenericCycleDetector
- {
- private readonly CycleInfoHashtable _hashtable = new CycleInfoHashtable();
-
- private readonly struct EntityPair : IEquatable
- {
- public readonly TypeSystemEntity Owner;
- public readonly TypeSystemEntity Referent;
- public EntityPair(TypeSystemEntity owner, TypeSystemEntity referent)
- => (Owner, Referent) = (owner, referent);
- public bool Equals(EntityPair other) => Owner == other.Owner && Referent == other.Referent;
- public override bool Equals(object obj) => obj is EntityPair p && Equals(p);
- public override int GetHashCode() => HashCode.Combine(Owner.GetHashCode(), Referent.GetHashCode());
- }
-
- // This is a set of entities that had actual problems that caused us to abort compilation
- // somewhere.
- // Would prefer this to be a ConcurrentHashSet but there isn't any. ModuleCycleInfo can be looked up
- // from the key, but since this is a key/value pair, might as well use the value too...
- private readonly ConcurrentDictionary _actualProblems = new ConcurrentDictionary();
public void DetectCycle(TypeSystemEntity owner, TypeSystemEntity referent)
{
@@ -196,7 +193,7 @@ public void DetectCycle(TypeSystemEntity owner, TypeSystemEntity referent)
{
// Just the presence of a cycle is not a problem, but once we start getting too deep,
// we need to cut our losses.
- if (cycleInfo.IsDeepPossiblyCyclicInstantiation(referent))
+ if (IsDeepPossiblyCyclicInstantiation(referent))
{
_actualProblems.TryAdd(new EntityPair(owner, referent), cycleInfo);
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/MultiFileCompilationModuleGroup.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/MultiFileCompilationModuleGroup.cs
index 9f93ae3ea87a13..a7c4b27afd274f 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/MultiFileCompilationModuleGroup.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/MultiFileCompilationModuleGroup.cs
@@ -15,7 +15,7 @@ public abstract class MultiFileCompilationModuleGroup : CompilationModuleGroup
{
private HashSet _compilationModuleSet;
- public MultiFileCompilationModuleGroup(TypeSystemContext context, IEnumerable compilationModuleSet)
+ public MultiFileCompilationModuleGroup(CompilerTypeSystemContext context, IEnumerable compilationModuleSet)
{
_compilationModuleSet = new HashSet(compilationModuleSet);
@@ -94,7 +94,7 @@ public override bool CanHaveReferenceThroughImportTable
///
public class MultiFileSharedCompilationModuleGroup : MultiFileCompilationModuleGroup
{
- public MultiFileSharedCompilationModuleGroup(TypeSystemContext context, IEnumerable compilationModuleSet)
+ public MultiFileSharedCompilationModuleGroup(CompilerTypeSystemContext context, IEnumerable compilationModuleSet)
: base(context, compilationModuleSet)
{
}
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/AppContextInitializerMethod.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/AppContextInitializerMethod.cs
index d4b53340b55301..ed40a5f6fcc75c 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/AppContextInitializerMethod.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/AppContextInitializerMethod.cs
@@ -54,6 +54,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return "SetAppContextSwitches";
+ }
+ }
+
public override MethodIL EmitIL()
{
ILEmitter emitter = new ILEmitter();
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/NativeLibraryStartupMethod.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/NativeLibraryStartupMethod.cs
index 7138804bb23138..4240af2427d154 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/NativeLibraryStartupMethod.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/NativeLibraryStartupMethod.cs
@@ -48,6 +48,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return "NativeLibraryStartup";
+ }
+ }
+
public override MethodIL EmitIL()
{
ILEmitter emitter = new ILEmitter();
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/StartupCodeMainMethod.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/StartupCodeMainMethod.cs
index b18b9435491343..2c91f888c4dc05 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/StartupCodeMainMethod.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/IL/Stubs/StartupCode/StartupCodeMainMethod.cs
@@ -53,6 +53,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return "StartupCodeMain";
+ }
+ }
+
public override MethodIL EmitIL()
{
ILEmitter emitter = new ILEmitter();
@@ -229,6 +237,14 @@ public override string Name
}
}
+ public override string DiagnosticName
+ {
+ get
+ {
+ return "MainMethodWrapper";
+ }
+ }
+
public override MethodSignature Signature
{
get
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj b/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj
index 3273d2cc58f567..3420564b0715ef 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj
@@ -23,6 +23,147 @@
+
+ IL\DelegateInfo.cs
+
+
+ IL\Stubs\DelegateThunks.Sorting.cs
+
+
+ IL\Stubs\DynamicInvokeMethodThunk.cs
+
+
+ IL\Stubs\DynamicInvokeMethodThunk.Sorting.cs
+
+
+ IL\Stubs\EnumThunks.cs
+
+
+ IL\Stubs\EnumThunks.Sorting.cs
+
+
+ IL\Stubs\PInvokeLazyFixupField.cs
+
+
+ IL\Stubs\PInvokeLazyFixupField.Sorting.cs
+
+
+ IL\Stubs\StructMarshallingThunk.Sorting.cs
+
+
+ IL\Stubs\ValueTypeGetFieldHelperMethodOverride.cs
+
+
+ IL\Stubs\ValueTypeGetFieldHelperMethodOverride.Sorting.cs
+
+
+ TypeSystem\Interop\IL\InlineArrayType.Sorting.cs
+
+
+ Interop\IL\MarshalHelpers.cs
+
+
+ Interop\IL\MarshalHelpers.Aot.cs
+
+
+ Interop\IL\MarshalUtils.cs
+
+
+ Interop\IL\Marshaller.cs
+
+
+ Interop\IL\Marshaller.Aot.cs
+
+
+ Interop\IL\MarshallerKind.cs
+
+
+ TypeSystem\Interop\IL\NativeStructType.Sorting.cs
+
+
+ Interop\IL\PInvokeILEmitterConfiguration.cs
+
+
+ IL\Stubs\PInvokeILEmitter.cs
+
+
+ IL\Stubs\PInvokeILCodeStreams.cs
+
+
+ IL\Stubs\DebuggerSteppingHelpers.cs
+
+
+ IL\Stubs\CalliMarshallingMethodThunk.cs
+
+
+ IL\Stubs\CalliMarshallingMethodThunk.Mangling.cs
+
+
+ IL\Stubs\CalliMarshallingMethodThunk.Sorting.cs
+
+
+ IL\Stubs\DelegateMarshallingMethodThunk.cs
+
+
+ IL\Stubs\DelegateMarshallingMethodThunk.Mangling.cs
+
+
+ IL\Stubs\DelegateMarshallingMethodThunk.Sorting.cs
+
+
+ IL\Stubs\ForwardDelegateCreationThunk.cs
+
+
+ IL\Stubs\ForwardDelegateCreationThunk.Mangling.cs
+
+
+ IL\Stubs\ForwardDelegateCreationThunk.Sorting.cs
+
+
+ IL\Stubs\DelegateThunks.cs
+
+
+ IL\Stubs\StructMarshallingThunk.cs
+
+
+ IL\Stubs\StructMarshallingThunk.Mangling.cs
+
+
+ TypeSystem\Interop\IL\NativeStructType.cs
+
+
+ TypeSystem\Interop\IL\NativeStructType.Mangling.cs
+
+
+ TypeSystem\Interop\IL\PInvokeDelegateWrapper.cs
+
+
+ TypeSystem\Interop\IL\PInvokeDelegateWrapper.Mangling.cs
+
+
+ TypeSystem\Interop\IL\PInvokeDelegateWrapper.Sorting.cs
+
+
+ TypeSystem\Interop\IL\PInvokeDelegateWrapperConstructor.cs
+
+
+ TypeSystem\Interop\IL\PInvokeDelegateWrapperConstructor.Sorting.cs
+
+
+ TypeSystem\Interop\IL\InlineArrayType.cs
+
+
+ TypeSystem\Interop\InteropTypes.cs
+
+
+ TypeSystem\Interop\InteropStateManager.cs
+
+
+ TypeSystem\CodeGen\INonEmittableType.cs
+
+
+ TypeSystem\CodeGen\NativeStructType.CodeGen.cs
+
Compiler\Logging\CompilerGeneratedState.cs
@@ -179,6 +320,12 @@
+
+
+
+
+
+
diff --git a/src/coreclr/tools/aot/ILCompiler.DependencyAnalysisFramework/EventSourceLogStrategy.cs b/src/coreclr/tools/aot/ILCompiler.DependencyAnalysisFramework/EventSourceLogStrategy.cs
index 4595d0ab07e53d..e7615ad545fbfa 100644
--- a/src/coreclr/tools/aot/ILCompiler.DependencyAnalysisFramework/EventSourceLogStrategy.cs
+++ b/src/coreclr/tools/aot/ILCompiler.DependencyAnalysisFramework/EventSourceLogStrategy.cs
@@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System;
+using System.Diagnostics.CodeAnalysis;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -28,10 +29,16 @@ public class Keywords
// with the name of the event (method name) as well as the names and types of all the parameters.
[Event(1, Keywords = Keywords.Graph, Level = EventLevel.Informational)]
public void Graph(int id, string name) { WriteEvent(1, id, name); }
+ [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:UnrecognizedReflectionPattern",
+ Justification = "Parameters to this method are primitive and are trimmer safe")]
[Event(2, Keywords = Keywords.Graph, Level = EventLevel.Informational)]
public void Node(int id, int index, string name) { WriteEvent(2, id, index, name); }
+ [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:UnrecognizedReflectionPattern",
+ Justification = "Parameters to this method are primitive and are trimmer safe")]
[Event(3, Keywords = Keywords.Graph, Level = EventLevel.Informational)]
public void Edge(int id, int dependentIndex, int dependencyIndex, string reason) { WriteEvent(3, id, dependentIndex, dependencyIndex, reason); }
+ [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:UnrecognizedReflectionPattern",
+ Justification = "Parameters to this method are primitive and are trimmer safe")]
[Event(4, Keywords = Keywords.Graph, Level = EventLevel.Informational)]
public void ConditionalEdge(int id, int dependentIndex1, int dependentIndex2, int dependencyIndex, string reason) { WriteEvent(4, id, dependentIndex1, dependentIndex2, dependencyIndex, reason); }
diff --git a/src/coreclr/tools/aot/ILCompiler.DependencyAnalysisFramework/ILCompiler.DependencyAnalysisFramework.csproj b/src/coreclr/tools/aot/ILCompiler.DependencyAnalysisFramework/ILCompiler.DependencyAnalysisFramework.csproj
index c98ffb07608364..17f44699ea3cb6 100644
--- a/src/coreclr/tools/aot/ILCompiler.DependencyAnalysisFramework/ILCompiler.DependencyAnalysisFramework.csproj
+++ b/src/coreclr/tools/aot/ILCompiler.DependencyAnalysisFramework/ILCompiler.DependencyAnalysisFramework.csproj
@@ -3,7 +3,7 @@
LibraryILCompiler.DependencyAnalysisFrameworkILCompiler.DependencyAnalysisFramework
- netstandard2.0
+ net5.0falsex64;x86AnyCPU
diff --git a/src/coreclr/tools/aot/ILCompiler.Diagnostics/ILCompiler.Diagnostics.csproj b/src/coreclr/tools/aot/ILCompiler.Diagnostics/ILCompiler.Diagnostics.csproj
index 8fe3bd1982d475..97c97bb7de720d 100644
--- a/src/coreclr/tools/aot/ILCompiler.Diagnostics/ILCompiler.Diagnostics.csproj
+++ b/src/coreclr/tools/aot/ILCompiler.Diagnostics/ILCompiler.Diagnostics.csproj
@@ -18,7 +18,7 @@
-
+
diff --git a/src/coreclr/tools/aot/ILCompiler.MetadataTransform/ILCompiler.MetadataTransform.csproj b/src/coreclr/tools/aot/ILCompiler.MetadataTransform/ILCompiler.MetadataTransform.csproj
index ca6174b66dab13..83ab3456fb5e31 100644
--- a/src/coreclr/tools/aot/ILCompiler.MetadataTransform/ILCompiler.MetadataTransform.csproj
+++ b/src/coreclr/tools/aot/ILCompiler.MetadataTransform/ILCompiler.MetadataTransform.csproj
@@ -2,7 +2,7 @@
LibraryILCompiler.MetadataTransform
- netstandard2.0
+ net5.0true$(DefineConstants);NATIVEFORMAT_PUBLICWRITER;NETFX_45false
diff --git a/src/coreclr/tools/aot/ILCompiler.MetadataTransform/Internal/Metadata/NativeFormat/Writer/NativeMetadataWriter.cs b/src/coreclr/tools/aot/ILCompiler.MetadataTransform/Internal/Metadata/NativeFormat/Writer/NativeMetadataWriter.cs
index 01bef848d2b36b..c31437d0dd2c45 100644
--- a/src/coreclr/tools/aot/ILCompiler.MetadataTransform/Internal/Metadata/NativeFormat/Writer/NativeMetadataWriter.cs
+++ b/src/coreclr/tools/aot/ILCompiler.MetadataTransform/Internal/Metadata/NativeFormat/Writer/NativeMetadataWriter.cs
@@ -965,18 +965,14 @@ public override string ToString()
public static class EnumHelpers
{
- public static string FlagsToString(this T value) where T : IConvertible
+ public static string FlagsToString(this T value) where T : struct, Enum, IConvertible
{
- if (!(value is Enum))
- throw new ArgumentException();
-
- var eType = value.GetType();
- var flags = ((T[])Enum.GetValues(eType)).Where(
+ var flags = Enum.GetValues().Where(
eVal => (((IConvertible)eVal).ToInt32(null) != 0) && ((((IConvertible)value).ToInt32(null) & ((IConvertible)eVal).ToInt32(null)) == ((IConvertible)eVal).ToInt32(null)));
if (flags.Count() == 0)
return "";
else
- return "[" + String.Join(" | ", flags.Select(eVal => Enum.GetName(eType, eVal))) + "] ";
+ return "[" + String.Join(" | ", flags.Select(eVal => Enum.GetName(eVal))) + "] ";
}
}
diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ArgIterator.cs b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ArgIterator.cs
index b9671aa4850223..28d10f23a28f06 100644
--- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ArgIterator.cs
+++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ArgIterator.cs
@@ -1606,9 +1606,8 @@ private void ForceSigWalk()
int byteArgSize = GetArgSize();
- // Composites greater than 16bytes are passed by reference
- TypeHandle dummy;
- if (GetArgType(out dummy) == CorElementType.ELEMENT_TYPE_VALUETYPE && GetArgSize() > _transitionBlock.EnregisteredParamTypeMaxSize)
+ // On ARM64 some composites are implicitly passed by reference.
+ if (IsArgPassedByRef())
{
byteArgSize = _transitionBlock.PointerSize;
}
diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilationBuilder.cs b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilationBuilder.cs
index 34aced76b44b01..8f468f78b39771 100644
--- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilationBuilder.cs
+++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilationBuilder.cs
@@ -33,7 +33,6 @@ public sealed class ReadyToRunCodegenCompilationBuilder : CompilationBuilder
private string _perfMapPath;
private int _perfMapFormatVersion;
private bool _generateProfileFile;
- private int _parallelism;
Func _printReproInstructions;
private InstructionSetSupport _instructionSetSupport;
private ProfileDataManager _profileData;
@@ -170,12 +169,6 @@ public ReadyToRunCodegenCompilationBuilder UseProfileFile(bool generateProfileFi
return this;
}
- public ReadyToRunCodegenCompilationBuilder UseParallelism(int parallelism)
- {
- _parallelism = parallelism;
- return this;
- }
-
public ReadyToRunCodegenCompilationBuilder UsePrintReproInstructions(Func printReproInstructions)
{
_printReproInstructions = printReproInstructions;
diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj
index 40f19bfefc78a5..5154db358a8b8e 100644
--- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj
+++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj
@@ -20,7 +20,7 @@
-
+
@@ -44,6 +44,7 @@
+
diff --git a/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ILCompiler.Reflection.ReadyToRun.csproj b/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ILCompiler.Reflection.ReadyToRun.csproj
index 86644068f3c172..b57b5be6d076bb 100644
--- a/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ILCompiler.Reflection.ReadyToRun.csproj
+++ b/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ILCompiler.Reflection.ReadyToRun.csproj
@@ -31,6 +31,6 @@
-
+
diff --git a/src/coreclr/tools/aot/ILCompiler.RyuJit/Compiler/RyuJitCompilation.cs b/src/coreclr/tools/aot/ILCompiler.RyuJit/Compiler/RyuJitCompilation.cs
index e794bdd1a94790..0d8b11c51f82e2 100644
--- a/src/coreclr/tools/aot/ILCompiler.RyuJit/Compiler/RyuJitCompilation.cs
+++ b/src/coreclr/tools/aot/ILCompiler.RyuJit/Compiler/RyuJitCompilation.cs
@@ -5,6 +5,7 @@
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Threading;
+using System.Threading.Tasks;
using ILCompiler.DependencyAnalysis;
using ILCompiler.DependencyAnalysisFramework;
@@ -21,10 +22,10 @@ public sealed class RyuJitCompilation : Compilation
private readonly ConditionalWeakTable _corinfos = new ConditionalWeakTable();
internal readonly RyuJitCompilationOptions _compilationOptions;
private readonly ExternSymbolMappedField _hardwareIntrinsicFlags;
- private CountdownEvent _compilationCountdown;
private readonly Dictionary _instructionSetMap;
private readonly ProfileDataManager _profileDataManager;
private readonly MethodImportationErrorProvider _methodImportationErrorProvider;
+ private readonly int _parallelism;
public InstructionSetSupport InstructionSetSupport { get; }
@@ -40,7 +41,8 @@ internal RyuJitCompilation(
InstructionSetSupport instructionSetSupport,
ProfileDataManager profileDataManager,
MethodImportationErrorProvider errorProvider,
- RyuJitCompilationOptions options)
+ RyuJitCompilationOptions options,
+ int parallelism)
: base(dependencyGraph, nodeFactory, roots, ilProvider, debugInformationProvider, devirtualizationManager, inliningPolicy, logger)
{
_compilationOptions = options;
@@ -59,6 +61,8 @@ internal RyuJitCompilation(
_profileDataManager = profileDataManager;
_methodImportationErrorProvider = errorProvider;
+
+ _parallelism = parallelism;
}
public ProfileDataManager ProfileData => _profileDataManager;
@@ -125,7 +129,7 @@ protected override void ComputeDependencyNodeDependencies(List methodsToCompile)
Logger.Writer.WriteLine($"Compiling {methodsToCompile.Count} methods...");
}
- WaitCallback compileSingleMethodDelegate = m =>
- {
- CorInfoImpl corInfo = _corinfos.GetValue(Thread.CurrentThread, thread => new CorInfoImpl(this));
- CompileSingleMethod(corInfo, (MethodCodeNode)m);
- };
-
- using (_compilationCountdown = new CountdownEvent(methodsToCompile.Count))
- {
-
- foreach (MethodCodeNode methodCodeNodeNeedingCode in methodsToCompile)
- {
- ThreadPool.QueueUserWorkItem(compileSingleMethodDelegate, methodCodeNodeNeedingCode);
- }
-
- _compilationCountdown.Wait();
- _compilationCountdown = null;
- }
+ Parallel.ForEach(
+ methodsToCompile,
+ new ParallelOptions { MaxDegreeOfParallelism = _parallelism },
+ CompileSingleMethod);
}
@@ -176,52 +167,50 @@ private void CompileSingleThreaded(List methodsToCompile)
}
}
+ private void CompileSingleMethod(MethodCodeNode methodCodeNodeNeedingCode)
+ {
+ CorInfoImpl corInfo = _corinfos.GetValue(Thread.CurrentThread, thread => new CorInfoImpl(this));
+ CompileSingleMethod(corInfo, methodCodeNodeNeedingCode);
+ }
+
private void CompileSingleMethod(CorInfoImpl corInfo, MethodCodeNode methodCodeNodeNeedingCode)
{
- try
- {
- MethodDesc method = methodCodeNodeNeedingCode.Method;
+ MethodDesc method = methodCodeNodeNeedingCode.Method;
- TypeSystemException exception = _methodImportationErrorProvider.GetCompilationError(method);
+ TypeSystemException exception = _methodImportationErrorProvider.GetCompilationError(method);
- // If we previously failed to import the method, do not try to import it again and go
- // directly to the error path.
- if (exception == null)
+ // If we previously failed to import the method, do not try to import it again and go
+ // directly to the error path.
+ if (exception == null)
+ {
+ try
{
- try
- {
- corInfo.CompileMethod(methodCodeNodeNeedingCode);
- }
- catch (TypeSystemException ex)
- {
- exception = ex;
- }
+ corInfo.CompileMethod(methodCodeNodeNeedingCode);
}
-
- if (exception != null)
+ catch (TypeSystemException ex)
{
- // TODO: fail compilation if a switch was passed
-
- // Try to compile the method again, but with a throwing method body this time.
- MethodIL throwingIL = TypeSystemThrowingILEmitter.EmitIL(method, exception);
- corInfo.CompileMethod(methodCodeNodeNeedingCode, throwingIL);
-
- if (exception is TypeSystemException.InvalidProgramException
- && method.OwningType is MetadataType mdOwningType
- && mdOwningType.HasCustomAttribute("System.Runtime.InteropServices", "ClassInterfaceAttribute"))
- {
- Logger.LogWarning("COM interop is not supported with full ahead of time compilation", 3052, method, MessageSubCategory.AotAnalysis);
- }
- else
- {
- Logger.LogWarning($"Method will always throw because: {exception.Message}", 1005, method, MessageSubCategory.AotAnalysis);
- }
+ exception = ex;
}
}
- finally
+
+ if (exception != null)
{
- if (_compilationCountdown != null)
- _compilationCountdown.Signal();
+ // TODO: fail compilation if a switch was passed
+
+ // Try to compile the method again, but with a throwing method body this time.
+ MethodIL throwingIL = TypeSystemThrowingILEmitter.EmitIL(method, exception);
+ corInfo.CompileMethod(methodCodeNodeNeedingCode, throwingIL);
+
+ if (exception is TypeSystemException.InvalidProgramException
+ && method.OwningType is MetadataType mdOwningType
+ && mdOwningType.HasCustomAttribute("System.Runtime.InteropServices", "ClassInterfaceAttribute"))
+ {
+ Logger.LogWarning("COM interop is not supported with full ahead of time compilation", 3052, method, MessageSubCategory.AotAnalysis);
+ }
+ else
+ {
+ Logger.LogWarning($"Method will always throw because: {exception.Message}", 1005, method, MessageSubCategory.AotAnalysis);
+ }
}
}
@@ -252,7 +241,6 @@ public override MethodIL GetMethodIL(MethodDesc method)
public enum RyuJitCompilationOptions
{
MethodBodyFolding = 0x1,
- SingleThreadedCompilation = 0x2,
- ControlFlowGuardAnnotations = 0x4,
+ ControlFlowGuardAnnotations = 0x2,
}
}
diff --git a/src/coreclr/tools/aot/ILCompiler.RyuJit/Compiler/RyuJitCompilationBuilder.cs b/src/coreclr/tools/aot/ILCompiler.RyuJit/Compiler/RyuJitCompilationBuilder.cs
index 162f1a39e86bbc..8b753c71039942 100644
--- a/src/coreclr/tools/aot/ILCompiler.RyuJit/Compiler/RyuJitCompilationBuilder.cs
+++ b/src/coreclr/tools/aot/ILCompiler.RyuJit/Compiler/RyuJitCompilationBuilder.cs
@@ -107,9 +107,6 @@ public override ICompilation ToCompilation()
if (_methodBodyFolding)
options |= RyuJitCompilationOptions.MethodBodyFolding;
- if (_singleThreaded)
- options |= RyuJitCompilationOptions.SingleThreadedCompilation;
-
if ((_mitigationOptions & SecurityMitigationOptions.ControlFlowGuardAnnotations) != 0)
options |= RyuJitCompilationOptions.ControlFlowGuardAnnotations;
@@ -117,7 +114,7 @@ public override ICompilation ToCompilation()
JitConfigProvider.Initialize(_context.Target, jitFlagBuilder.ToArray(), _ryujitOptions);
DependencyAnalyzerBase graph = CreateDependencyGraph(factory, new ObjectNode.ObjectNodeComparer(new CompilerComparer()));
- return new RyuJitCompilation(graph, factory, _compilationRoots, _ilProvider, _debugInformationProvider, _logger, _devirtualizationManager, _inliningPolicy ?? _compilationGroup, _instructionSetSupport, _profileDataManager, _methodImportationErrorProvider, options);
+ return new RyuJitCompilation(graph, factory, _compilationRoots, _ilProvider, _debugInformationProvider, _logger, _devirtualizationManager, _inliningPolicy ?? _compilationGroup, _instructionSetSupport, _profileDataManager, _methodImportationErrorProvider, options, _parallelism);
}
}
}
diff --git a/src/coreclr/tools/aot/ILCompiler.RyuJit/ILCompiler.RyuJit.csproj b/src/coreclr/tools/aot/ILCompiler.RyuJit/ILCompiler.RyuJit.csproj
index efff02a77708c0..cecc90d6da81b0 100644
--- a/src/coreclr/tools/aot/ILCompiler.RyuJit/ILCompiler.RyuJit.csproj
+++ b/src/coreclr/tools/aot/ILCompiler.RyuJit/ILCompiler.RyuJit.csproj
@@ -3,7 +3,7 @@
LibraryILCompilerILCompiler.RyuJit
- net5.0
+ net6.0truefalsex64;x86
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj b/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj
deleted file mode 100644
index 86b9c06a6cf0d2..00000000000000
--- a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj
+++ /dev/null
@@ -1,647 +0,0 @@
-
-
- Library
- Internal.TypeSystem
- ILCompiler.TypeSystem.ReadyToRun
- true
- netstandard2.0
- false
- x64;x86
- AnyCPU
- false
- true
- $(DefineConstants);DISABLE_UNMANAGED_PDB_SYMBOLS
-
-
- false
- Debug;Release;Checked
-
-
-
-
- Internal.TypeSystem.Strings.resources
-
-
-
-
-
- $(SystemReflectionMetadataVersion)
-
-
- 1.3.0
-
-
-
-
- TypeSystem\Common\ArrayMethod.Diagnostic.cs
-
-
- TypeSystem\Canon\ArrayType.Canon.cs
-
-
- TypeSystem\Canon\ByRefType.Canon.cs
-
-
- TypeSystem\Canon\CanonTypes.cs
-
-
- TypeSystem\Canon\CanonTypes.Diagnostic.cs
-
-
- TypeSystem\Canon\CanonTypes.Interop.cs
-
-
- TypeSystem\Canon\CanonTypes.Sorting.cs
-
-
- TypeSystem\Canon\FunctionPointerType.Canon.cs
-
-
- TypeSystem\Canon\GenericParameterDesc.Canon.cs
-
-
- TypeSystem\Canon\StandardCanonicalizationAlgorithm.cs
-
-
- TypeSystem\Canon\DefType.Canon.cs
-
-
- TypeSystem\Canon\InstantiatedMethod.Canon.cs
-
-
- TypeSystem\Canon\InstantiatedType.Canon.cs
-
-
- TypeSystem\Canon\MetadataType.Canon.cs
-
-
- TypeSystem\Canon\MethodDelegator.Canon.cs
-
-
- TypeSystem\Canon\MethodDesc.Canon.cs
-
-
- TypeSystem\Canon\MethodForInstantiatedType.Canon.cs
-
-
- TypeSystem\Canon\ParameterizedType.Canon.cs
-
-
- TypeSystem\Canon\PointerType.Canon.cs
-
-
- TypeSystem\Canon\SignatureVariable.Canon.cs
-
-
- TypeSystem\Canon\TypeDesc.Canon.cs
-
-
- TypeSystem\Canon\TypeSystemContext.Canon.cs
-
-
- TypeSystem\CodeGen\FieldDesc.CodeGen.cs
-
-
- TypeSystem\CodeGen\MethodDelegator.CodeGen.cs
-
-
- TypeSystem\CodeGen\MethodDesc.CodeGen.cs
-
-
- TypeSystem\CodeGen\TargetDetails.CodeGen.cs
-
-
- TypeSystem\CodeGen\TypeDesc.CodeGen.cs
-
-
- Utilities\AlignmentHelper.cs
-
-
- Utilities\ArrayOfTRuntimeInterfacesAlgorithm.cs
-
-
- TypeSystem\Common\CastingHelper.cs
-
-
- TypeSystem\Common\ConstructedTypeRewritingHelpers.cs
-
-
- TypeSystem\Common\ExplicitLayoutValidator.cs
-
-
- TypeSystem\Common\FunctionPointerType.cs
-
-
- TypeSystem\Common\IAssemblyDesc.cs
-
-
- TypeSystem\Common\IModuleResolver.cs
-
-
- TypeSystem\Common\Instantiation.cs
-
-
- TypeSystem\Common\ModuleDesc.cs
-
-
- TypeSystem\Common\NotFoundBehavior.cs
-
-
- TypeSystem\Common\ResolutionFailure.cs
-
-
- TypeSystem\Common\TypeSystemEntity.cs
-
-
- TypeSystem\Common\TypeSystemException.cs
-
-
- TypeSystem\Common\TypeSystemException.Resources.cs
-
-
- TypeSystem\Common\ThrowHelper.cs
-
-
- TypeSystem\Common\ThrowHelper.Common.cs
-
-
- TypeSystem\Common\UniversalCanonLayoutAlgorithm.cs
-
-
- Utilities\CustomAttributeTypeNameFormatter.cs
-
-
- Utilities\CustomAttributeTypeNameParser.cs
-
-
- Utilities\GCPointerMap.Algorithm.cs
-
-
- Utilities\GCPointerMap.cs
-
-
- Utilities\DebugNameFormatter.cs
-
-
- Utilities\LockFreeReaderHashtable.cs
-
-
- TypeSystem\Common\ArrayType.cs
-
-
- TypeSystem\Common\BaseTypeRuntimeInterfacesAlgorithm.cs
-
-
- TypeSystem\Common\ByRefType.cs
-
-
- TypeSystem\Common\GenericParameterDesc.cs
-
-
- TypeSystem\Common\GenericParameterDesc.Diagnostic.cs
-
-
- TypeSystem\Common\ExceptionStringID.cs
-
-
- TypeSystem\Common\FieldForInstantiatedType.cs
-
-
- TypeSystem\Common\FieldDesc.cs
-
-
- TypeSystem\Common\FieldDesc.ToString.cs
-
-
- TypeSystem\Common\FieldDesc.FieldLayout.cs
-
-
- TypeSystem\Common\FieldLayoutAlgorithm.cs
-
-
- TypeSystem\Common\InstantiatedMethod.cs
-
-
- TypeSystem\Common\InstantiatedMethod.Diagnostic.cs
-
-
- TypeSystem\Common\InstantiatedType.cs
-
-
- TypeSystem\Common\InstantiatedType.Diagnostic.cs
-
-
- TypeSystem\Common\InstantiatedType.Interfaces.cs
-
-
- TypeSystem\Common\InstantiatedType.MethodImpls.cs
-
-
- TypeSystem\Common\LayoutInt.cs
-
-
- TypeSystem\Common\LinqPoison.cs
-
-
- TypeSystem\Common\MetadataType.cs
-
-
- TypeSystem\Common\DefType.Diagnostic.cs
-
-
- TypeSystem\Common\MetadataType.Interfaces.cs
-
-
- TypeSystem\Common\MetadataType.MethodImpls.cs
-
-
- TypeSystem\Common\MetadataFieldLayoutAlgorithm.cs
-
-
- TypeSystem\Common\MetadataRuntimeInterfacesAlgorithm.cs
-
-
- TypeSystem\Common\MetadataTypeSystemContext.cs
-
-
- TypeSystem\Common\MethodForInstantiatedType.cs
-
-
- TypeSystem\Common\MethodForInstantiatedType.Diagnostic.cs
-
-
- TypeSystem\Common\ParameterizedType.cs
-
-
- TypeSystem\Common\PointerType.cs
-
-
- TypeSystem\Common\PropertySignature.cs
-
-
- TypeSystem\Common\SignatureVariable.cs
-
-
- TypeSystem\Common\TargetArchitecture.cs
-
-
- TypeSystem\Common\TargetDetails.cs
-
-
- TypeSystem\Common\TargetDetails.ToString.cs
-
-
- TypeSystem\Common\ThreadSafeFlags.cs
-
-
- TypeSystem\Common\TypeFlags.cs
-
-
- TypeSystem\Common\TypeHashingAlgorithms.cs
-
-
- TypeSystem\Common\TypeSystemConstraintsHelpers.cs
-
-
- TypeSystem\Common\TypeSystemContext.cs
-
-
- TypeSystem\Common\TypeSystemHelpers.cs
-
-
- Utilities\ExceptionTypeNameFormatter.cs
-
-
- Utilities\ExceptionTypeNameFormatter.Metadata.cs
-
-
- Utilities\TypeNameFormatter.cs
-
-
- TypeSystem\Common\WellKnownType.cs
-
-
- TypeSystem\Common\VirtualMethodAlgorithm.cs
-
-
- TypeSystem\Common\MethodDelegator.cs
-
-
- TypeSystem\Common\MethodDelegator.Diagnostic.cs
-
-
- TypeSystem\Common\MethodDesc.cs
-
-
- TypeSystem\Common\MethodDesc.Diagnostic.cs
-
-
- TypeSystem\Common\MethodDesc.ToString.cs
-
-
- TypeSystem\Common\StandardVirtualMethodAlgorithm.cs
-
-
- TypeSystem\Common\TypeDesc.cs
-
-
- TypeSystem\Common\TypeDesc.ToString.cs
-
-
- TypeSystem\Common\TypeDesc.Interfaces.cs
-
-
- TypeSystem\Common\DefType.cs
-
-
- TypeSystem\Common\DefType.FieldLayout.cs
-
-
- TypeSystem\Common\RuntimeInterfacesAlgorithm.cs
-
-
- Ecma\CustomAttributeTypeProvider.cs
-
-
- Ecma\EcmaAssembly.cs
-
-
- Ecma\EcmaAssembly.Symbols.cs
-
-
- Ecma\EcmaField.Sorting.cs
-
-
- Ecma\EcmaField.CodeGen.cs
-
-
- Ecma\EcmaField.Serialization.cs
-
-
- Ecma\EcmaGenericParameter.Sorting.cs
-
-
- Ecma\EcmaMethod.Sorting.cs
-
-
- Ecma\EcmaModule.Sorting.cs
-
-
- Ecma\EcmaType.Serialization.cs
-
-
- Ecma\EcmaType.Sorting.cs
-
-
- Ecma\PrimitiveTypeProvider.cs
-
-
- Ecma\EcmaModule.Symbols.cs
-
-
- Ecma\SymbolReader\PdbSymbolReader.cs
-
-
- Ecma\SymbolReader\PortablePdbSymbolReader.cs
-
-
- Ecma\SymbolReader\UnmanagedPdbSymbolReader.cs
-
-
- Ecma\EcmaField.cs
-
-
- Ecma\EcmaGenericParameter.cs
-
-
- Ecma\EcmaGenericParameter.Diagnostic.cs
-
-
- Ecma\EcmaMethod.cs
-
-
- Ecma\EcmaMethod.cs
-
-
- Ecma\EcmaModule.cs
-
-
- Ecma\EcmaSignatureParser.cs
-
-
- Ecma\EcmaType.cs
-
-
- Ecma\EcmaType.Diagnostic.cs
-
-
- Ecma\EcmaType.MethodImpls.cs
-
-
- Ecma\EcmaType.Interfaces.cs
-
-
- Ecma\MetadataExtensions.cs
-
-
- Ecma\IMetadataStringDecoderProvider.cs
-
-
- Ecma\CachingMetadataStringDecoder.cs
-
-
- IL\EcmaMethodIL.cs
-
-
- IL\EcmaMethodIL.Symbols.cs
-
-
- IL\MethodIL.cs
-
-
- IL\MethodIL.Symbols.cs
-
-
- IL\MethodILDebugView.cs
-
-
- IL\ILDisassembler.cs
-
-
- IL\InstantiatedMethodIL.cs
-
-
- IL\ILStackHelper.cs
-
-
- IL\ILOpcode.cs
-
-
- IL\ILOpcodeHelper.cs
-
-
- IL\Stubs\ILEmitter.cs
-
-
- IL\Stubs\PInvokeTargetNativeMethod.cs
-
-
- IL\Stubs\PInvokeTargetNativeMethod.Diagnostic.cs
-
-
- IL\Stubs\PInvokeTargetNativeMethod.Mangling.cs
-
-
- IL\Stubs\PInvokeTargetNativeMethod.Sorting.cs
-
-
- TypeSystem\CodeGen\FieldDesc.Serialization.cs
-
-
- TypeSystem\CodeGen\TypeDesc.Serialization.cs
-
-
- TypeSystem\Sorting\FieldDesc.Sorting.cs
-
-
- TypeSystem\Sorting\FieldForInstantiatedType.Sorting.cs
-
-
- TypeSystem\Sorting\InstantiatedMethod.Sorting.cs
-
-
- TypeSystem\Sorting\MethodDesc.Sorting.cs
-
-
- TypeSystem\Sorting\MethodForInstantiatedType.Sorting.cs
-
-
- TypeSystem\Interop\FieldDesc.Interop.cs
-
-
- TypeSystem\Interop\InstantiatedType.Interop.cs
-
-
- TypeSystem\Interop\MetadataType.Interop.cs
-
-
- TypeSystem\Interop\MethodDelegator.Interop.cs
-
-
- TypeSystem\Interop\MethodDesc.Interop.cs
-
-
- TypeSystem\Interop\MarshalAsDescriptor.cs
-
-
- TypeSystem\Mangling\IPrefixMangledMethod.cs
-
-
- TypeSystem\Mangling\IPrefixMangledType.cs
-
-
- TypeSystem\Mangling\IPrefixMangledSignature.cs
-
-
- Utilities\ArrayBuilder.cs
-
-
- TypeSystem\Common\LocalVariableDefinition.cs
-
-
- TypeSystem\RuntimeDetermined\ArrayType.RuntimeDetermined.cs
-
-
- TypeSystem\RuntimeDetermined\ByRefType.RuntimeDetermined.cs
-
-
- TypeSystem\RuntimeDetermined\FieldDesc.RuntimeDetermined.cs
-
-
- TypeSystem\RuntimeDetermined\FunctionPointerType.RuntimeDetermined.cs
-
-
- TypeSystem\RuntimeDetermined\MethodDesc.RuntimeDetermined.cs
-
-
- TypeSystem\RuntimeDetermined\PointerType.RuntimeDetermined.cs
-
-
- TypeSystem\RuntimeDetermined\MethodForRuntimeDeterminedType.cs
-
-
- TypeSystem\RuntimeDetermined\MethodForRuntimeDeterminedType.cs
-
-
- TypeSystem\RuntimeDetermined\MethodForRuntimeDeterminedType.Sorting.cs
-
-
- TypeSystem\RuntimeDetermined\RuntimeDeterminedCanonicalizationAlgorithm.cs
-
-
- TypeSystem\RuntimeDetermined\RuntimeDeterminedFieldLayoutAlgorithm.cs
-
-
- TypeSystem\RuntimeDetermined\DefType.RuntimeDetermined.cs
-
-
- TypeSystem\RuntimeDetermined\GenericParameterDesc.RuntimeDetermined.cs
-
-
- TypeSystem\RuntimeDetermined\ParameterizedType.RuntimeDetermined.cs
-
-
- TypeSystem\RuntimeDetermined\RuntimeDeterminedType.cs
-
-
- TypeSystem\RuntimeDetermined\RuntimeDeterminedType.Diagnostic.cs
-
-
- TypeSystem\RuntimeDetermined\RuntimeDeterminedType.Sorting.cs
-
-
- TypeSystem\RuntimeDetermined\RuntimeDeterminedTypeUtilities.cs
-
-
- TypeSystem\RuntimeDetermined\SignatureVariable.RuntimeDetermined.cs
-
-
- TypeSystem\RuntimeDetermined\TypeDesc.RuntimeDetermined.cs
-
-
- TypeSystem\RuntimeDetermined\TypeSystemContext.RuntimeDetermined.cs
-
-
- Common\System\FormattingHelpers.cs
-
-
- TypeSystem\Sorting\ArrayType.Sorting.cs
-
-
- TypeSystem\Sorting\ByRefType.Sorting.cs
-
-
- TypeSystem\Sorting\FunctionPointerType.Sorting.cs
-
-
- TypeSystem\Sorting\InstantiatedType.Sorting.cs
-
-
- TypeSystem\Sorting\MethodSignature.Sorting.cs
-
-
- TypeSystem\Sorting\PointerType.Sorting.cs
-
-
- TypeSystem\Sorting\SignatureVariable.Sorting.cs
-
-
- TypeSystem\Sorting\TypeDesc.Sorting.cs
-
-
- TypeSystem\Sorting\TypeSystemComparer.cs
-
-
-
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ArchitectureSpecificFieldLayoutTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ArchitectureSpecificFieldLayoutTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ArchitectureSpecificFieldLayoutTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ArchitectureSpecificFieldLayoutTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CanonicalizationTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CanonicalizationTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CanonicalizationTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CanonicalizationTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CastingTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CastingTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CastingTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CastingTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ConstraintsValidationTest.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ConstraintsValidationTest.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ConstraintsValidationTest.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ConstraintsValidationTest.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/Canonicalization.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/Canonicalization.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/Canonicalization.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/Canonicalization.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/Casting.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/Casting.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/Casting.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/Casting.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/CoreTestAssembly.csproj b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/CoreTestAssembly.csproj
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/CoreTestAssembly.csproj
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/CoreTestAssembly.csproj
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/GCPointerMap.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/GCPointerMap.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/GCPointerMap.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/GCPointerMap.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/GenericConstraints.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/GenericConstraints.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/GenericConstraints.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/GenericConstraints.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/GenericTypes.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/GenericTypes.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/GenericTypes.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/GenericTypes.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/Hashcode.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/Hashcode.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/Hashcode.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/Hashcode.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/InstanceFieldLayout.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/InstanceFieldLayout.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/InstanceFieldLayout.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/InstanceFieldLayout.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/InterfaceArrangements.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/InterfaceArrangements.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/InterfaceArrangements.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/InterfaceArrangements.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/Marshalling.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/Marshalling.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/Marshalling.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/Marshalling.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/Platform.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/Platform.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/Platform.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/Platform.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/StaticFieldLayout.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/StaticFieldLayout.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/StaticFieldLayout.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/StaticFieldLayout.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/SyntheticVirtualOverride.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/SyntheticVirtualOverride.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/SyntheticVirtualOverride.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/SyntheticVirtualOverride.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/TypeNameParsing.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/TypeNameParsing.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/TypeNameParsing.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/TypeNameParsing.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/ValueTypeShapeCharacteristics.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/ValueTypeShapeCharacteristics.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/ValueTypeShapeCharacteristics.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/ValueTypeShapeCharacteristics.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/VirtualFunctionOverride.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/VirtualFunctionOverride.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/VirtualFunctionOverride.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/CoreTestAssembly/VirtualFunctionOverride.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/DefType.FieldLayoutTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/DefType.FieldLayoutTests.cs
similarity index 98%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/DefType.FieldLayoutTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/DefType.FieldLayoutTests.cs
index c82f6c21a85be8..f41f4a7ea63068 100644
--- a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/DefType.FieldLayoutTests.cs
+++ b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/DefType.FieldLayoutTests.cs
@@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
using Internal.TypeSystem;
-using Internal.TypeSystem.Interop;
using Xunit;
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ExceptionStringTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ExceptionStringTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ExceptionStringTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ExceptionStringTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/GCPointerMapTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/GCPointerMapTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/GCPointerMapTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/GCPointerMapTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/GenericTypeAndMethodTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/GenericTypeAndMethodTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/GenericTypeAndMethodTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/GenericTypeAndMethodTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/HashcodeTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/HashcodeTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/HashcodeTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/HashcodeTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILCompiler.TypeSystem.ReadyToRun.Tests.csproj b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILCompiler.TypeSystem.Tests.csproj
similarity index 78%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILCompiler.TypeSystem.ReadyToRun.Tests.csproj
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILCompiler.TypeSystem.Tests.csproj
index 558daa29f76b70..767680f651aacd 100644
--- a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILCompiler.TypeSystem.ReadyToRun.Tests.csproj
+++ b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILCompiler.TypeSystem.Tests.csproj
@@ -1,6 +1,6 @@
- ILCompiler.TypeSystem.ReadyToRun.Tests
+ ILCompiler.TypeSystem.Tests$(NetCoreAppToolCurrent)Debug;Release;Checked
@@ -14,6 +14,9 @@
AnyCPU;x64AnyCPUtrue
+
+
+ READYTORUN;$(DefineConstants)
@@ -23,8 +26,7 @@
-
-
+ false
@@ -40,6 +42,11 @@
+
+
+
+
+
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILDisassemblerTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILDisassemblerTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILDisassemblerTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILDisassemblerTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/ILDisassembler.il b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/ILDisassembler.il
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/ILDisassembler.il
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/ILDisassembler.il
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/ILTestAssembly.ilproj b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/ILTestAssembly.ilproj
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/ILTestAssembly.ilproj
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/ILTestAssembly.ilproj
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/InstanceFieldLayout.il b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/InstanceFieldLayout.il
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/InstanceFieldLayout.il
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/InstanceFieldLayout.il
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/MDArrayFunctionResolution.il b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/MDArrayFunctionResolution.il
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/MDArrayFunctionResolution.il
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/MDArrayFunctionResolution.il
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/Main.il b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/Main.il
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/Main.il
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/Main.il
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/MethodImplOverride1.il b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/MethodImplOverride1.il
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/MethodImplOverride1.il
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/MethodImplOverride1.il
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/Signature.il b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/Signature.il
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/Signature.il
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/Signature.il
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/StaticFieldLayout.il b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/StaticFieldLayout.il
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/StaticFieldLayout.il
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/StaticFieldLayout.il
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/VirtualFunctionOverride.il b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/VirtualFunctionOverride.il
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/VirtualFunctionOverride.il
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ILTestAssembly/VirtualFunctionOverride.il
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/InstanceFieldLayoutTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/InstanceFieldLayoutTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/InstanceFieldLayoutTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/InstanceFieldLayoutTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/InterfacesTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/InterfacesTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/InterfacesTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/InterfacesTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/MarshalUtilsTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/MarshalUtilsTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/MarshalUtilsTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/MarshalUtilsTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/RuntimeDeterminedTypesTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/RuntimeDeterminedTypesTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/RuntimeDeterminedTypesTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/RuntimeDeterminedTypesTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/SignatureTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/SignatureTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/SignatureTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/SignatureTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/StaticFieldLayoutTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/StaticFieldLayoutTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/StaticFieldLayoutTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/StaticFieldLayoutTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/SyntheticVirtualOverrideTests.DiagnosticName.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/SyntheticVirtualOverrideTests.DiagnosticName.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/SyntheticVirtualOverrideTests.DiagnosticName.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/SyntheticVirtualOverrideTests.DiagnosticName.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/SyntheticVirtualOverrideTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/SyntheticVirtualOverrideTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/SyntheticVirtualOverrideTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/SyntheticVirtualOverrideTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/TestMetadataFieldLayoutAlgorithm.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/TestMetadataFieldLayoutAlgorithm.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/TestMetadataFieldLayoutAlgorithm.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/TestMetadataFieldLayoutAlgorithm.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/TestTypeSystemContext.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/TestTypeSystemContext.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/TestTypeSystemContext.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/TestTypeSystemContext.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/TypeNameParsingTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/TypeNameParsingTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/TypeNameParsingTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/TypeNameParsingTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/UniversalGenericFieldLayoutTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/UniversalGenericFieldLayoutTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/UniversalGenericFieldLayoutTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/UniversalGenericFieldLayoutTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ValueTypeShapeCharacteristicsTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ValueTypeShapeCharacteristicsTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ValueTypeShapeCharacteristicsTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/ValueTypeShapeCharacteristicsTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/VirtualFunctionOverrideTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/VirtualFunctionOverrideTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/VirtualFunctionOverrideTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/VirtualFunctionOverrideTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/WellKnownTypeTests.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/WellKnownTypeTests.cs
similarity index 100%
rename from src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/WellKnownTypeTests.cs
rename to src/coreclr/tools/aot/ILCompiler.TypeSystem.Tests/WellKnownTypeTests.cs
diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj b/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj
index 4aa53fd19c5e11..bf9a6275d972b7 100644
--- a/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj
+++ b/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj
@@ -9,6 +9,8 @@
x64;x86AnyCPUfalse
+ true
+ $(DefineConstants);DISABLE_UNMANAGED_PDB_SYMBOLS
- win-$(TargetArchitecture)
- linux-$(TargetArchitecture)
- osx-$(TargetArchitecture)
+ $(ToolsRID)
diff --git a/src/coreclr/tools/aot/ILCompiler/Program.cs b/src/coreclr/tools/aot/ILCompiler/Program.cs
index 007c3787df15f5..5d774ce90c0117 100644
--- a/src/coreclr/tools/aot/ILCompiler/Program.cs
+++ b/src/coreclr/tools/aot/ILCompiler/Program.cs
@@ -57,9 +57,10 @@ internal class Program
private bool _reflectedOnly;
private bool _scanReflection;
private bool _methodBodyFolding;
- private bool _singleThreaded;
+ private int _parallelism = Environment.ProcessorCount;
private string _instructionSet;
private string _guard;
+ private int _maxGenericCycle = CompilerTypeSystemContext.DefaultGenericCycleCutoffPoint;
private string _singleMethodTypeName;
private string _singleMethodName;
@@ -205,7 +206,7 @@ private ArgumentSyntax ParseCommandLine(string[] args)
syntax.DefineOptionList("appcontextswitch", ref _appContextSwitches, "System.AppContext switches to set (format: 'Key=Value')");
syntax.DefineOptionList("feature", ref _featureSwitches, "Feature switches to apply (format: 'Namespace.Name=[true|false]'");
syntax.DefineOptionList("runtimeopt", ref _runtimeOptions, "Runtime options to set");
- syntax.DefineOption("singlethreaded", ref _singleThreaded, "Run compilation on a single thread");
+ syntax.DefineOption("parallelism", ref _parallelism, "Maximum number of threads to use during compilation");
syntax.DefineOption("instructionset", ref _instructionSet, "Instruction set to allow or disallow");
syntax.DefineOption("guard", ref _guard, "Enable mitigations. Options: 'cf': CFG (Control Flow Guard, Windows only)");
syntax.DefineOption("preinitstatics", ref _preinitStatics, "Interpret static constructors at compile time if possible (implied by -O)");
@@ -216,7 +217,7 @@ private ArgumentSyntax ParseCommandLine(string[] args)
syntax.DefineOptionList("nosinglewarnassembly", ref _singleWarnDisabledAssemblies, "Expand AOT/trimming warnings for given assembly");
syntax.DefineOptionList("directpinvoke", ref _directPInvokes, "PInvoke to call directly");
syntax.DefineOptionList("directpinvokelist", ref _directPInvokeLists, "File with list of PInvokes to call directly");
-
+ syntax.DefineOption("maxgenericcycle", ref _maxGenericCycle, "Max depth of generic cycle");
syntax.DefineOptionList("root", ref _rootedAssemblies, "Fully generate given assembly");
syntax.DefineOptionList("conditionalroot", ref _conditionallyRootedAssemblies, "Fully generate given assembly if it's used");
syntax.DefineOptionList("trim", ref _trimmedAssemblies, "Trim the specified assembly");
@@ -270,7 +271,7 @@ private ArgumentSyntax ParseCommandLine(string[] args)
return argSyntax;
}
- private IReadOnlyCollection CreateInitializerList(TypeSystemContext context)
+ private IReadOnlyCollection CreateInitializerList(CompilerTypeSystemContext context)
{
List assembliesWithInitalizers = new List();
@@ -278,7 +279,7 @@ private IReadOnlyCollection CreateInitializerList(TypeSystemContext
// any user code runs.
foreach (string initAssemblyName in _initAssemblies)
{
- ModuleDesc assembly = context.ResolveAssembly(new AssemblyName(initAssemblyName));
+ ModuleDesc assembly = context.ResolveAssembly(new AssemblyName(initAssemblyName), throwIfNotFound: true);
assembliesWithInitalizers.Add(assembly);
}
@@ -419,13 +420,14 @@ private int Run(string[] args)
optimisticInstructionSetSupportBuilder.AddSupportedInstructionSet("popcnt");
optimisticInstructionSetSupportBuilder.AddSupportedInstructionSet("lzcnt");
- // If AVX was enabled, we can opportunistically enable FMA/BMI
+ // If AVX was enabled, we can opportunistically enable FMA/BMI/VNNI
Debug.Assert(InstructionSet.X64_AVX == InstructionSet.X86_AVX);
if (supportedInstructionSet.HasInstructionSet(InstructionSet.X64_AVX))
{
optimisticInstructionSetSupportBuilder.AddSupportedInstructionSet("fma");
optimisticInstructionSetSupportBuilder.AddSupportedInstructionSet("bmi");
optimisticInstructionSetSupportBuilder.AddSupportedInstructionSet("bmi2");
+ optimisticInstructionSetSupportBuilder.AddSupportedInstructionSet("avxvnni");
}
}
else if (_targetArchitecture == TargetArchitecture.ARM64)
@@ -460,7 +462,7 @@ private int Run(string[] args)
var targetAbi = TargetAbi.CoreRT;
var targetDetails = new TargetDetails(_targetArchitecture, _targetOS, targetAbi, simdVectorLength);
CompilerTypeSystemContext typeSystemContext =
- new CompilerTypeSystemContext(targetDetails, genericsMode, supportsReflection ? DelegateFeature.All : 0);
+ new CompilerTypeSystemContext(targetDetails, genericsMode, supportsReflection ? DelegateFeature.All : 0, _maxGenericCycle);
//
// TODO: To support our pre-compiled test tree, allow input files that aren't managed assemblies since
@@ -730,7 +732,7 @@ static string ILLinkify(string rootedAssembly)
ILScannerBuilder scannerBuilder = builder.GetILScannerBuilder()
.UseCompilationRoots(compilationRoots)
.UseMetadataManager(metadataManager)
- .UseSingleThread(enable: _singleThreaded)
+ .UseParallelism(_parallelism)
.UseInteropStubManager(interopStubManager);
if (_scanDgmlLogFileName != null)
@@ -759,7 +761,7 @@ static string ILLinkify(string rootedAssembly)
.UseInstructionSetSupport(instructionSetSupport)
.UseBackendOptions(_codegenOptions)
.UseMethodBodyFolding(enable: _methodBodyFolding)
- .UseSingleThread(enable: _singleThreaded)
+ .UseParallelism(_parallelism)
.UseMetadataManager(metadataManager)
.UseInteropStubManager(interopStubManager)
.UseLogger(logger)
diff --git a/src/coreclr/tools/aot/ILCompiler/repro/repro.csproj b/src/coreclr/tools/aot/ILCompiler/repro/repro.csproj
index 0194a7f6e43201..52b0f44fc48918 100644
--- a/src/coreclr/tools/aot/ILCompiler/repro/repro.csproj
+++ b/src/coreclr/tools/aot/ILCompiler/repro/repro.csproj
@@ -9,6 +9,7 @@
linux-x64;win-x64;osx-x64Debug;Release;Checkedtrue
+ 649;169;414 inFilePaths, Instru
.UsePdbFile(_commandLineOptions.Pdb, _commandLineOptions.PdbPath)
.UsePerfMapFile(_commandLineOptions.PerfMap, _commandLineOptions.PerfMapPath, _commandLineOptions.PerfMapFormatVersion)
.UseProfileFile(jsonProfile != null)
- .UseParallelism(_commandLineOptions.Parallelism)
.UseProfileData(profileDataManager)
.FileLayoutAlgorithms(_methodLayout, _fileLayout)
.UseCompositeImageSettings(compositeImageSettings)
@@ -748,6 +747,7 @@ private void RunSingleCompilation(Dictionary inFilePaths, Instru
.UseILProvider(ilProvider)
.UseBackendOptions(_commandLineOptions.CodegenOptions)
.UseLogger(logger)
+ .UseParallelism(_commandLineOptions.Parallelism)
.UseDependencyTracking(trackingLevel)
.UseCompilationRoots(compilationRoots)
.UseOptimizationMode(optimizationMode);
diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2.props b/src/coreclr/tools/aot/crossgen2/crossgen2.props
index e69b66ceecb3e2..2d6e9dff4072d9 100644
--- a/src/coreclr/tools/aot/crossgen2/crossgen2.props
+++ b/src/coreclr/tools/aot/crossgen2/crossgen2.props
@@ -29,7 +29,7 @@
-
+
diff --git a/src/coreclr/tools/aot/ilc.sln b/src/coreclr/tools/aot/ilc.sln
index be90b9bc202d73..b1c7181908a26d 100644
--- a/src/coreclr/tools/aot/ilc.sln
+++ b/src/coreclr/tools/aot/ilc.sln
@@ -20,6 +20,8 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ILLink.Shared", "ILLink.Sha
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILCompiler.Compiler.Tests", "ILCompiler.Compiler.Tests\ILCompiler.Compiler.Tests.csproj", "{24CBA9C6-EDBA-47D6-A0B5-04417BDE5FE3}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILCompiler.TypeSystem.Tests", "ILCompiler.TypeSystem.Tests\ILCompiler.TypeSystem.Tests.csproj", "{740CDFF4-B8EC-4A37-951B-C9FE9980EF2A}"
+EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
ILLink.Shared\ILLink.Shared.projitems*{ff598e93-8e9e-4091-9f50-61a7572663ae}*SharedItemsImports = 13
@@ -160,6 +162,24 @@ Global
{24CBA9C6-EDBA-47D6-A0B5-04417BDE5FE3}.Release|x64.Build.0 = Release|x64
{24CBA9C6-EDBA-47D6-A0B5-04417BDE5FE3}.Release|x86.ActiveCfg = Release|x86
{24CBA9C6-EDBA-47D6-A0B5-04417BDE5FE3}.Release|x86.Build.0 = Release|x86
+ {740CDFF4-B8EC-4A37-951B-C9FE9980EF2A}.Checked|Any CPU.ActiveCfg = Checked|Any CPU
+ {740CDFF4-B8EC-4A37-951B-C9FE9980EF2A}.Checked|Any CPU.Build.0 = Checked|Any CPU
+ {740CDFF4-B8EC-4A37-951B-C9FE9980EF2A}.Checked|x64.ActiveCfg = Checked|x64
+ {740CDFF4-B8EC-4A37-951B-C9FE9980EF2A}.Checked|x64.Build.0 = Checked|x64
+ {740CDFF4-B8EC-4A37-951B-C9FE9980EF2A}.Checked|x86.ActiveCfg = Checked|Any CPU
+ {740CDFF4-B8EC-4A37-951B-C9FE9980EF2A}.Checked|x86.Build.0 = Checked|Any CPU
+ {740CDFF4-B8EC-4A37-951B-C9FE9980EF2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {740CDFF4-B8EC-4A37-951B-C9FE9980EF2A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {740CDFF4-B8EC-4A37-951B-C9FE9980EF2A}.Debug|x64.ActiveCfg = Debug|x64
+ {740CDFF4-B8EC-4A37-951B-C9FE9980EF2A}.Debug|x64.Build.0 = Debug|x64
+ {740CDFF4-B8EC-4A37-951B-C9FE9980EF2A}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {740CDFF4-B8EC-4A37-951B-C9FE9980EF2A}.Debug|x86.Build.0 = Debug|Any CPU
+ {740CDFF4-B8EC-4A37-951B-C9FE9980EF2A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {740CDFF4-B8EC-4A37-951B-C9FE9980EF2A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {740CDFF4-B8EC-4A37-951B-C9FE9980EF2A}.Release|x64.ActiveCfg = Release|x64
+ {740CDFF4-B8EC-4A37-951B-C9FE9980EF2A}.Release|x64.Build.0 = Release|x64
+ {740CDFF4-B8EC-4A37-951B-C9FE9980EF2A}.Release|x86.ActiveCfg = Release|Any CPU
+ {740CDFF4-B8EC-4A37-951B-C9FE9980EF2A}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/src/coreclr/tools/aot/jitinterface/jitinterface.h b/src/coreclr/tools/aot/jitinterface/jitinterface.h
index f0158199fea1a3..14286588063b23 100644
--- a/src/coreclr/tools/aot/jitinterface/jitinterface.h
+++ b/src/coreclr/tools/aot/jitinterface/jitinterface.h
@@ -159,7 +159,6 @@ struct JitInterfaceCallbacks
InfoAccessType (* constructStringLiteral)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_MODULE_HANDLE module, unsigned int metaTok, void** ppValue);
InfoAccessType (* emptyStringLiteral)(void * thisHandle, CorInfoExceptionClass** ppException, void** ppValue);
uint32_t (* getFieldThreadLocalStoreID)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_FIELD_HANDLE field, void** ppIndirection);
- void (* setOverride)(void * thisHandle, CorInfoExceptionClass** ppException, ICorDynamicInfo* pOverride, CORINFO_METHOD_HANDLE currentMethod);
void (* addActiveDependency)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_MODULE_HANDLE moduleFrom, CORINFO_MODULE_HANDLE moduleTo);
CORINFO_METHOD_HANDLE (* GetDelegateCtor)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_METHOD_HANDLE methHnd, CORINFO_CLASS_HANDLE clsHnd, CORINFO_METHOD_HANDLE targetMethodHnd, DelegateCtorArgs* pCtorData);
void (* MethodCompileComplete)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_METHOD_HANDLE methHnd);
@@ -1617,15 +1616,6 @@ class JitInterfaceWrapper : public ICorJitInfo
return temp;
}
- virtual void setOverride(
- ICorDynamicInfo* pOverride,
- CORINFO_METHOD_HANDLE currentMethod)
-{
- CorInfoExceptionClass* pException = nullptr;
- _callbacks->setOverride(_thisHandle, &pException, pOverride, currentMethod);
- if (pException != nullptr) throw pException;
-}
-
virtual void addActiveDependency(
CORINFO_MODULE_HANDLE moduleFrom,
CORINFO_MODULE_HANDLE moduleTo)
diff --git a/src/coreclr/tools/dotnet-pgo/dotnet-pgo.csproj b/src/coreclr/tools/dotnet-pgo/dotnet-pgo.csproj
index c957bcd1b8a9e5..5e27eb6011b4cd 100644
--- a/src/coreclr/tools/dotnet-pgo/dotnet-pgo.csproj
+++ b/src/coreclr/tools/dotnet-pgo/dotnet-pgo.csproj
@@ -56,7 +56,7 @@
-
+
diff --git a/src/coreclr/tools/dotnet-pgo/dotnet-pgo.sln b/src/coreclr/tools/dotnet-pgo/dotnet-pgo.sln
index 3d5a6f3b1ad1d7..45bc67bf401400 100644
--- a/src/coreclr/tools/dotnet-pgo/dotnet-pgo.sln
+++ b/src/coreclr/tools/dotnet-pgo/dotnet-pgo.sln
@@ -1,13 +1,13 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.30114.105
+# Visual Studio Version 17
+VisualStudioVersion = 17.0.32014.148
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-pgo", "dotnet-pgo.csproj", "{7DA4CC22-F01D-4505-845F-57C06E5C3F9F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILCompiler.Reflection.ReadyToRun", "..\aot\ILCompiler.Reflection.ReadyToRun\ILCompiler.Reflection.ReadyToRun.csproj", "{ED3FE303-74EB-43D1-BEA1-14484A14B22E}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILCompiler.TypeSystem.ReadyToRun", "..\aot\ILCompiler.TypeSystem.ReadyToRun\ILCompiler.TypeSystem.ReadyToRun.csproj", "{D6BA6C4F-F7DF-4414-94BE-8E124CDDDEE6}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILCompiler.TypeSystem", "..\aot\ILCompiler.TypeSystem\ILCompiler.TypeSystem.csproj", "{8A811180-D605-469B-9693-EC3915B3E0DC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -58,21 +58,24 @@ Global
{ED3FE303-74EB-43D1-BEA1-14484A14B22E}.Release|x64.Build.0 = Release|x64
{ED3FE303-74EB-43D1-BEA1-14484A14B22E}.Release|x86.ActiveCfg = Release|Any CPU
{ED3FE303-74EB-43D1-BEA1-14484A14B22E}.Release|x86.Build.0 = Release|Any CPU
- {D6BA6C4F-F7DF-4414-94BE-8E124CDDDEE6}.Checked|Any CPU.ActiveCfg = Checked|x86
- {D6BA6C4F-F7DF-4414-94BE-8E124CDDDEE6}.Checked|x64.ActiveCfg = Checked|x64
- {D6BA6C4F-F7DF-4414-94BE-8E124CDDDEE6}.Checked|x64.Build.0 = Checked|x64
- {D6BA6C4F-F7DF-4414-94BE-8E124CDDDEE6}.Checked|x86.ActiveCfg = Checked|x86
- {D6BA6C4F-F7DF-4414-94BE-8E124CDDDEE6}.Checked|x86.Build.0 = Checked|x86
- {D6BA6C4F-F7DF-4414-94BE-8E124CDDDEE6}.Debug|Any CPU.ActiveCfg = Debug|x86
- {D6BA6C4F-F7DF-4414-94BE-8E124CDDDEE6}.Debug|x64.ActiveCfg = Debug|x64
- {D6BA6C4F-F7DF-4414-94BE-8E124CDDDEE6}.Debug|x64.Build.0 = Debug|x64
- {D6BA6C4F-F7DF-4414-94BE-8E124CDDDEE6}.Debug|x86.ActiveCfg = Debug|x86
- {D6BA6C4F-F7DF-4414-94BE-8E124CDDDEE6}.Debug|x86.Build.0 = Debug|x86
- {D6BA6C4F-F7DF-4414-94BE-8E124CDDDEE6}.Release|Any CPU.ActiveCfg = Release|x86
- {D6BA6C4F-F7DF-4414-94BE-8E124CDDDEE6}.Release|x64.ActiveCfg = Release|x64
- {D6BA6C4F-F7DF-4414-94BE-8E124CDDDEE6}.Release|x64.Build.0 = Release|x64
- {D6BA6C4F-F7DF-4414-94BE-8E124CDDDEE6}.Release|x86.ActiveCfg = Release|x86
- {D6BA6C4F-F7DF-4414-94BE-8E124CDDDEE6}.Release|x86.Build.0 = Release|x86
+ {8A811180-D605-469B-9693-EC3915B3E0DC}.Checked|Any CPU.ActiveCfg = Checked|x64
+ {8A811180-D605-469B-9693-EC3915B3E0DC}.Checked|Any CPU.Build.0 = Checked|x64
+ {8A811180-D605-469B-9693-EC3915B3E0DC}.Checked|x64.ActiveCfg = Checked|x64
+ {8A811180-D605-469B-9693-EC3915B3E0DC}.Checked|x64.Build.0 = Checked|x64
+ {8A811180-D605-469B-9693-EC3915B3E0DC}.Checked|x86.ActiveCfg = Checked|x86
+ {8A811180-D605-469B-9693-EC3915B3E0DC}.Checked|x86.Build.0 = Checked|x86
+ {8A811180-D605-469B-9693-EC3915B3E0DC}.Debug|Any CPU.ActiveCfg = Debug|x64
+ {8A811180-D605-469B-9693-EC3915B3E0DC}.Debug|Any CPU.Build.0 = Debug|x64
+ {8A811180-D605-469B-9693-EC3915B3E0DC}.Debug|x64.ActiveCfg = Debug|x64
+ {8A811180-D605-469B-9693-EC3915B3E0DC}.Debug|x64.Build.0 = Debug|x64
+ {8A811180-D605-469B-9693-EC3915B3E0DC}.Debug|x86.ActiveCfg = Debug|x86
+ {8A811180-D605-469B-9693-EC3915B3E0DC}.Debug|x86.Build.0 = Debug|x86
+ {8A811180-D605-469B-9693-EC3915B3E0DC}.Release|Any CPU.ActiveCfg = Release|x64
+ {8A811180-D605-469B-9693-EC3915B3E0DC}.Release|Any CPU.Build.0 = Release|x64
+ {8A811180-D605-469B-9693-EC3915B3E0DC}.Release|x64.ActiveCfg = Release|x64
+ {8A811180-D605-469B-9693-EC3915B3E0DC}.Release|x64.Build.0 = Release|x64
+ {8A811180-D605-469B-9693-EC3915B3E0DC}.Release|x86.ActiveCfg = Release|x86
+ {8A811180-D605-469B-9693-EC3915B3E0DC}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/src/coreclr/tools/metainfo/mdinfo.cpp b/src/coreclr/tools/metainfo/mdinfo.cpp
index 24c782b4076d9e..8351b8de24bf1b 100644
--- a/src/coreclr/tools/metainfo/mdinfo.cpp
+++ b/src/coreclr/tools/metainfo/mdinfo.cpp
@@ -204,7 +204,7 @@ void MDInfo::InitSigBuffer()
// helper to append a string into the signature buffer. If size of signature buffer is not big enough,
// we will grow it.
-HRESULT MDInfo::AddToSigBuffer(__in_z __in const char *string)
+HRESULT MDInfo::AddToSigBuffer(_In_z_ const char *string)
{
HRESULT hr;
size_t LL = strlen((LPSTR)m_sigBuf.Ptr()) + strlen(string) + 1;
@@ -368,7 +368,7 @@ void MDInfo::DisplayMD()
WriteLine("===========================================================");
} // MDVEHandlerClass()
-int MDInfo::WriteLine(__in_z __in const char *str)
+int MDInfo::WriteLine(_In_z_ const char *str)
{
ULONG32 count = (ULONG32) strlen(str);
@@ -377,7 +377,7 @@ int MDInfo::WriteLine(__in_z __in const char *str)
return count;
} // int MDInfo::WriteLine()
-int MDInfo::Write(__in_z __in const char *str)
+int MDInfo::Write(_In_z_ const char *str)
{
ULONG32 count = (ULONG32) strlen(str);
@@ -385,7 +385,7 @@ int MDInfo::Write(__in_z __in const char *str)
return count;
} // int MDInfo::Write()
-int MDInfo::VWriteLine(__in_z __in const char *str, ...)
+int MDInfo::VWriteLine(_In_z_ const char *str, ...)
{
va_list marker;
int count;
@@ -397,7 +397,7 @@ int MDInfo::VWriteLine(__in_z __in const char *str, ...)
return count;
} // int MDInfo::VWriteLine()
-int MDInfo::VWrite(__in_z __in const char *str, ...)
+int MDInfo::VWrite(_In_z_ const char *str, ...)
{
va_list marker;
int count;
@@ -408,7 +408,7 @@ int MDInfo::VWrite(__in_z __in const char *str, ...)
return count;
} // int MDInfo::VWrite()
-int MDInfo::VWriteMarker(__in_z __in const char *str, va_list marker)
+int MDInfo::VWriteMarker(_In_z_ const char *str, va_list marker)
{
HRESULT hr;
int count = -1;
@@ -561,7 +561,7 @@ const char *MDInfo::TokenTypeName(mdToken inToken)
// Prints out name of the given memberref
//
-LPCWSTR MDInfo::MemberRefName(mdMemberRef inMemRef, __out_ecount(bufLen) LPWSTR buffer, ULONG bufLen)
+LPCWSTR MDInfo::MemberRefName(mdMemberRef inMemRef, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen)
{
HRESULT hr;
@@ -829,7 +829,7 @@ void MDInfo::DisplaySignatureInfo(mdSignature inSignature)
// member in wide characters
//
-LPCWSTR MDInfo::MemberName(mdToken inToken, __out_ecount(bufLen) LPWSTR buffer, ULONG bufLen)
+LPCWSTR MDInfo::MemberName(mdToken inToken, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen)
{
HRESULT hr;
@@ -1312,7 +1312,7 @@ void MDInfo::DisplayGenericParamInfo(mdGenericParam tkParam, const char *prefix)
DisplayCustomAttributes(tkParam, newprefix);
}
-LPCWSTR MDInfo::TokenName(mdToken inToken, __out_ecount(bufLen) LPWSTR buffer, ULONG bufLen)
+LPCWSTR MDInfo::TokenName(mdToken inToken, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen)
{
LPCUTF8 pName; // Token name in UTF8.
@@ -1329,7 +1329,7 @@ LPCWSTR MDInfo::TokenName(mdToken inToken, __out_ecount(bufLen) LPWSTR buffer, U
// prints out name of typeref or typedef
//
-LPCWSTR MDInfo::TypeDeforRefName(mdToken inToken, __out_ecount(bufLen) LPWSTR buffer, ULONG bufLen)
+LPCWSTR MDInfo::TypeDeforRefName(mdToken inToken, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen)
{
if (RidFromToken(inToken))
{
@@ -1346,7 +1346,7 @@ LPCWSTR MDInfo::TypeDeforRefName(mdToken inToken, __out_ecount(bufLen) LPWSTR bu
return W("");
} // LPCWSTR MDInfo::TypeDeforRefName()
-LPCWSTR MDInfo::MemberDeforRefName(mdToken inToken, __out_ecount(bufLen) LPWSTR buffer, ULONG bufLen)
+LPCWSTR MDInfo::MemberDeforRefName(mdToken inToken, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen)
{
if (RidFromToken(inToken))
{
@@ -1365,7 +1365,7 @@ LPCWSTR MDInfo::MemberDeforRefName(mdToken inToken, __out_ecount(bufLen) LPWSTR
//
//
-LPCWSTR MDInfo::TypeDefName(mdTypeDef inTypeDef, __out_ecount(bufLen) LPWSTR buffer, ULONG bufLen)
+LPCWSTR MDInfo::TypeDefName(mdTypeDef inTypeDef, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen)
{
HRESULT hr;
@@ -1439,7 +1439,7 @@ void MDInfo::DisplayTypeDefProps(mdTypeDef inTypeDef)
// Prints out the name of the given TypeRef
//
-LPCWSTR MDInfo::TypeRefName(mdTypeRef tr, __out_ecount(bufLen) LPWSTR buffer, ULONG bufLen)
+LPCWSTR MDInfo::TypeRefName(mdTypeRef tr, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen)
{
HRESULT hr;
@@ -1543,7 +1543,7 @@ void MDInfo::DisplayMethodSpecInfo(mdMethodSpec ms, const char *preFix)
// associated with the class.
//
-char *MDInfo::ClassFlags(DWORD flags, __out_ecount(STRING_BUFFER_LEN) char *sFlags)
+char *MDInfo::ClassFlags(DWORD flags, _Out_writes_(STRING_BUFFER_LEN) char *sFlags)
{
sFlags[0] = 0;
ISFLAG(Td, NotPublic);
@@ -2169,7 +2169,7 @@ void MDInfo::DisplayPermissionInfo(mdPermission inPermission, const char *preFix
// simply prints out the given GUID in standard form
-LPWSTR MDInfo::GUIDAsString(GUID inGuid, __out_ecount(bufLen) LPWSTR guidString, ULONG bufLen)
+LPWSTR MDInfo::GUIDAsString(GUID inGuid, _Out_writes_(bufLen) LPWSTR guidString, ULONG bufLen)
{
StringFromGUID2(inGuid, guidString, bufLen);
return guidString;
diff --git a/src/coreclr/tools/metainfo/mdinfo.h b/src/coreclr/tools/metainfo/mdinfo.h
index 04002fdb267ffb..ff60b31ae3c492 100644
--- a/src/coreclr/tools/metainfo/mdinfo.h
+++ b/src/coreclr/tools/metainfo/mdinfo.h
@@ -67,20 +67,20 @@ class MDInfo {
void DisplaySignatures(void);
void DisplaySignatureInfo(mdSignature inSignature);
- LPCWSTR TokenName(mdToken inToken, __out_ecount(bufLen) LPWSTR buffer, ULONG bufLen);
+ LPCWSTR TokenName(mdToken inToken, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen);
- LPCWSTR TypeDeforRefName(mdToken inToken, __out_ecount(bufLen) LPWSTR buffer, ULONG bufLen);
- LPCWSTR TypeDefName(mdTypeDef inTypeDef, __out_ecount(bufLen) LPWSTR buffer, ULONG bufLen);
- LPCWSTR TypeRefName(mdTypeRef tr, __out_ecount(bufLen) LPWSTR buffer, ULONG bufLen);
+ LPCWSTR TypeDeforRefName(mdToken inToken, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen);
+ LPCWSTR TypeDefName(mdTypeDef inTypeDef, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen);
+ LPCWSTR TypeRefName(mdTypeRef tr, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen);
- LPCWSTR MemberDeforRefName(mdToken inToken, __out_ecount(bufLen) LPWSTR buffer, ULONG bufLen);
- LPCWSTR MemberRefName(mdToken inMemRef, __out_ecount(bufLen) LPWSTR buffer, ULONG bufLen);
- LPCWSTR MemberName(mdToken inMember, __out_ecount(bufLen) LPWSTR buffer, ULONG bufLen);
+ LPCWSTR MemberDeforRefName(mdToken inToken, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen);
+ LPCWSTR MemberRefName(mdToken inMemRef, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen);
+ LPCWSTR MemberName(mdToken inMember, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen);
- LPCWSTR MethodName(mdMethodDef inToken, __out_ecount(bufLen) LPWSTR buffer, ULONG bufLen);
- LPCWSTR FieldName(mdFieldDef inToken, __out_ecount(bufLen) LPWSTR buffer, ULONG bufLen);
+ LPCWSTR MethodName(mdMethodDef inToken, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen);
+ LPCWSTR FieldName(mdFieldDef inToken, _Out_writes_(bufLen) LPWSTR buffer, ULONG bufLen);
- char *ClassFlags(DWORD flags, __out_ecount(STRING_BUFFER_LEN) char *sFlags);
+ char *ClassFlags(DWORD flags, _Out_writes_(STRING_BUFFER_LEN) char *sFlags);
void DisplayTypeRefs(void);
void DisplayTypeRefInfo(mdTypeRef tr);
@@ -96,7 +96,7 @@ class MDInfo {
void DisplayInterfaceImpls(mdTypeDef inTypeDef);
void DisplayInterfaceImplInfo(mdInterfaceImpl inImpl);
- LPWSTR GUIDAsString(GUID inGuid, __out_ecount(bufLen) LPWSTR guidString, ULONG bufLen);
+ LPWSTR GUIDAsString(GUID inGuid, _Out_writes_(bufLen) LPWSTR guidString, ULONG bufLen);
const char *TokenTypeName(mdToken inToken);
@@ -170,15 +170,15 @@ class MDInfo {
int DumpHex(const char *szPrefix, const void *pvData, ULONG cbData, int bText=true, ULONG nLine=16);
- int Write(__in_z __in const char *str);
- int WriteLine(__in_z __in const char *str);
+ int Write(_In_z_ const char *str);
+ int WriteLine(_In_z_ const char *str);
- int VWrite(__in_z __in const char *str, ...);
- int VWriteLine(__in_z __in const char *str, ...);
- int VWriteMarker(__in_z __in const char *str, va_list marker);
+ int VWrite(_In_z_ const char *str, ...);
+ int VWriteLine(_In_z_ const char *str, ...);
+ int VWriteMarker(_In_z_ const char *str, va_list marker);
void InitSigBuffer();
- HRESULT AddToSigBuffer(__in_z __in const char *string);
+ HRESULT AddToSigBuffer(_In_z_ const char *string);
IMetaDataImport2 *m_pRegImport;
IMetaDataImport2 *m_pImport;
diff --git a/src/coreclr/tools/metainfo/mdobj.cpp b/src/coreclr/tools/metainfo/mdobj.cpp
index c8851a85228fd7..5bb4689410bb04 100644
--- a/src/coreclr/tools/metainfo/mdobj.cpp
+++ b/src/coreclr/tools/metainfo/mdobj.cpp
@@ -57,7 +57,7 @@ static HRESULT FindObjMetaData(PVOID pImage, PVOID *ppMetaData, long *pcbMetaDat
// This function returns the address to the MapView of file and file size.
-void GetMapViewOfFile(__in WCHAR *szFile, PBYTE *ppbMap, DWORD *pdwFileSize)
+void GetMapViewOfFile(_In_ WCHAR *szFile, PBYTE *ppbMap, DWORD *pdwFileSize)
{
HANDLE hMapFile;
DWORD dwHighSize;
@@ -161,7 +161,7 @@ char *GetNameOfObj(PBYTE pbLongNames, PIMAGE_ARCHIVE_MEMBER_HEADER pMemHdr, char
//
// Opens the .LIB file, and displays the metadata in the specified object files.
-void DisplayArchive(__in_z __in WCHAR* szFile, ULONG DumpFilter, __in_z __in_opt WCHAR* szObjName, strPassBackFn pDisplayString)
+void DisplayArchive(_In_z_ WCHAR* szFile, ULONG DumpFilter, _In_opt_z_ WCHAR* szObjName, strPassBackFn pDisplayString)
{
PBYTE pbMapAddress;
PBYTE pbStartAddress;
@@ -249,7 +249,7 @@ void DisplayArchive(__in_z __in WCHAR* szFile, ULONG DumpFilter, __in_z __in_opt
// Opens the meta data content of a .EXE, .CLB, .CLASS, .TLB, .DLL or .LIB file, and
// calls RawDisplay()
-void DisplayFile(__in_z __in WCHAR* szFile, BOOL isFile, ULONG DumpFilter, __in_z __in_opt WCHAR* szObjName, strPassBackFn pDisplayString)
+void DisplayFile(_In_z_ WCHAR* szFile, BOOL isFile, ULONG DumpFilter, _In_opt_z_ WCHAR* szObjName, strPassBackFn pDisplayString)
{
// Open the emit scope
diff --git a/src/coreclr/tools/r2rdump/CoreDisTools.cs b/src/coreclr/tools/r2rdump/CoreDisTools.cs
index 75029e04a163c9..8c917662014141 100644
--- a/src/coreclr/tools/r2rdump/CoreDisTools.cs
+++ b/src/coreclr/tools/r2rdump/CoreDisTools.cs
@@ -396,17 +396,17 @@ private void ProbeX64Quirks(RuntimeFunction rtf, int imageOffset, int rtfOffset,
{
if (targetName != null)
{
- translated.AppendFormat("[{0}]", targetName);
+ translated.Append($"[{targetName}]");
}
else
{
- translated.AppendFormat("[0x{0:x4}]", target);
+ translated.Append($"[0x{target:x4}]");
}
translated.Append(instruction, rightBracketPlusOne, instruction.Length - rightBracketPlusOne);
}
else
{
- translated.AppendFormat("[0x{0:x4}]", target);
+ translated.Append($"[0x{target:x4}]");
translated.Append(instruction, rightBracketPlusOne, instruction.Length - rightBracketPlusOne);
if (targetName != null)
{
@@ -449,17 +449,17 @@ private void ProbeX86Quirks(RuntimeFunction rtf, int imageOffset, int rtfOffset,
{
if (targetName != null)
{
- translated.AppendFormat("[{0}]", targetName);
+ translated.Append($"[{targetName}]");
}
else
{
- translated.AppendFormat("[0x{0:x4}]", target);
+ translated.Append($"[0x{target:x4}]");
}
translated.Append(instruction, rightBracketPlusOne, instruction.Length - rightBracketPlusOne);
}
else
{
- translated.AppendFormat("[0x{0:x4}]", target);
+ translated.Append($"[0x{target:x4}]");
translated.Append(instruction, rightBracketPlusOne, instruction.Length - rightBracketPlusOne);
if (targetName != null)
{
@@ -818,7 +818,7 @@ private void ProbeArm64Quirks(RuntimeFunction rtf, int imageOffset, int rtfOffse
}
else
{
- translated.AppendFormat("#0x{0:x4}", targetPage);
+ translated.Append($"#0x{targetPage:x4}");
}
instruction = translated.ToString();
@@ -843,7 +843,7 @@ private void ProbeArm64Quirks(RuntimeFunction rtf, int imageOffset, int rtfOffse
}
else
{
- translated.AppendFormat("#0x{0:x}", target & 0xfff);
+ translated.Append($"#0x{target & 0xfff:x}");
if (targetName != null)
{
AppendComment(translated, "import{" + targetName + "}");
diff --git a/src/coreclr/tools/r2rdump/R2RDiff.cs b/src/coreclr/tools/r2rdump/R2RDiff.cs
index 91962d3ee929af..9bea8d860f202d 100644
--- a/src/coreclr/tools/r2rdump/R2RDiff.cs
+++ b/src/coreclr/tools/r2rdump/R2RDiff.cs
@@ -281,7 +281,7 @@ private void ShowDiff(Dictionary leftObjects, Dictionary leftObjects, Dictionary leftObjects, DictionaryReserved[2]) & ~DBHX64_IS_RESTART_FLAG) | \
((_IsRestart) ? DBHX64_IS_RESTART_FLAG : 0))
-DbsX64StackUnwinder::DbsX64StackUnwinder(__in_opt DbsStackServices* Services)
+DbsX64StackUnwinder::DbsX64StackUnwinder(_In_opt_ DbsStackServices* Services)
: DbsStackUnwinder(Services, "x64", IMAGE_FILE_MACHINE_AMD64,
sizeof(m_Context),
sizeof(_IMAGE_RUNTIME_FUNCTION_ENTRY),
@@ -1265,7 +1265,7 @@ DbsX64StackUnwinder::Unwind(void)
DWORD
DbsX64StackUnwinder::
-GetFullUnwindInfoSize(__in PVOID InfoHeader)
+GetFullUnwindInfoSize(_In_ PVOID InfoHeader)
{
PAMD64_UNWIND_INFO UnwindInfo = (PAMD64_UNWIND_INFO)InfoHeader;
@@ -1289,9 +1289,9 @@ GetFullUnwindInfoSize(__in PVOID InfoHeader)
HRESULT
DbsX64StackUnwinder::DbhStart(__inout LPSTACKFRAME64 StackFrame,
- __in DWORD DbhVersion,
- __in_bcount(DbhStorageBytes) PVOID DbhStorage,
- __in DWORD DbhStorageBytes,
+ _In_ DWORD DbhVersion,
+ _In_reads_bytes_(DbhStorageBytes) PVOID DbhStorage,
+ _In_ DWORD DbhStorageBytes,
__inout PVOID Context)
{
HRESULT Status;
@@ -1343,9 +1343,9 @@ DbsX64StackUnwinder::DbhStart(__inout LPSTACKFRAME64 StackFrame,
HRESULT
DbsX64StackUnwinder::
DbhContinue(__inout LPSTACKFRAME64 StackFrame,
- __in DWORD DbhVersion,
- __in_bcount(DbhStorageBytes) PVOID DbhStorage,
- __in DWORD DbhStorageBytes,
+ _In_ DWORD DbhVersion,
+ _In_reads_bytes_(DbhStorageBytes) PVOID DbhStorage,
+ _In_ DWORD DbhStorageBytes,
__inout PVOID Context)
{
HRESULT Status;
@@ -1385,7 +1385,7 @@ DbsX64StackUnwinder::DbhUpdatePreUnwind(__inout LPSTACKFRAME64 StackFrame)
HRESULT
DbsX64StackUnwinder::DbhUpdatePostUnwind(__inout LPSTACKFRAME64 StackFrame,
- __in HRESULT UnwindStatus)
+ _In_ HRESULT UnwindStatus)
{
HRESULT Status;
diff --git a/src/coreclr/unwinder/amd64/unwinder_amd64.cpp b/src/coreclr/unwinder/amd64/unwinder_amd64.cpp
index ef1c5e0b5b54bb..fc3c746d875260 100644
--- a/src/coreclr/unwinder/amd64/unwinder_amd64.cpp
+++ b/src/coreclr/unwinder/amd64/unwinder_amd64.cpp
@@ -321,13 +321,13 @@ UNWIND_INFO * OOPStackUnwinderAMD64::GetUnwindInfo(TADDR taUnwindInfo)
// returned.
//
PEXCEPTION_ROUTINE RtlVirtualUnwind_Unsafe(
- __in ULONG HandlerType,
- __in ULONG64 ImageBase,
- __in ULONG64 ControlPc,
- __in PT_RUNTIME_FUNCTION FunctionEntry,
- __in OUT PCONTEXT ContextRecord,
- __out PVOID *HandlerData,
- __out PULONG64 EstablisherFrame,
+ _In_ ULONG HandlerType,
+ _In_ ULONG64 ImageBase,
+ _In_ ULONG64 ControlPc,
+ _In_ PT_RUNTIME_FUNCTION FunctionEntry,
+ _In_ OUT PCONTEXT ContextRecord,
+ _Out_ PVOID *HandlerData,
+ _Out_ PULONG64 EstablisherFrame,
__inout_opt PKNONVOLATILE_CONTEXT_POINTERS ContextPointers
)
{
@@ -395,10 +395,10 @@ PEXCEPTION_ROUTINE RtlVirtualUnwind_Unsafe(
HRESULT
OOPStackUnwinderAMD64::UnwindEpilogue(
- __in ULONG64 ImageBase,
- __in ULONG64 ControlPc,
- __in ULONG EpilogueOffset,
- __in _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
+ _In_ ULONG64 ImageBase,
+ _In_ ULONG64 ControlPc,
+ _In_ ULONG EpilogueOffset,
+ _In_ _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
__inout PCONTEXT ContextRecord,
__inout_opt PKNONVOLATILE_CONTEXT_POINTERS ContextPointers
)
@@ -634,13 +634,13 @@ HRESULT.
HRESULT
OOPStackUnwinderAMD64::UnwindPrologue(
- __in ULONG64 ImageBase,
- __in ULONG64 ControlPc,
- __in ULONG64 FrameBase,
- __in _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
+ _In_ ULONG64 ImageBase,
+ _In_ ULONG64 ControlPc,
+ _In_ ULONG64 FrameBase,
+ _In_ _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
__inout PCONTEXT ContextRecord,
__inout_opt PKNONVOLATILE_CONTEXT_POINTERS ContextPointers,
- __deref_out _PIMAGE_RUNTIME_FUNCTION_ENTRY *FinalFunctionEntry
+ _Outptr_ _PIMAGE_RUNTIME_FUNCTION_ENTRY *FinalFunctionEntry
)
/*++
@@ -1012,15 +1012,15 @@ Return Value:
HRESULT
OOPStackUnwinderAMD64::VirtualUnwind(
- __in DWORD HandlerType,
- __in ULONG64 ImageBase,
- __in ULONG64 ControlPc,
- __in _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
+ _In_ DWORD HandlerType,
+ _In_ ULONG64 ImageBase,
+ _In_ ULONG64 ControlPc,
+ _In_ _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
__inout PCONTEXT ContextRecord,
- __out PVOID *HandlerData,
- __out PULONG64 EstablisherFrame,
+ _Out_ PVOID *HandlerData,
+ _Out_ PULONG64 EstablisherFrame,
__inout_opt PKNONVOLATILE_CONTEXT_POINTERS ContextPointers,
- __deref_opt_out_opt PEXCEPTION_ROUTINE *HandlerRoutine
+ _Outptr_opt_result_maybenull_ PEXCEPTION_ROUTINE *HandlerRoutine
)
/*++
@@ -1663,8 +1663,8 @@ Routine Description:
_PIMAGE_RUNTIME_FUNCTION_ENTRY
OOPStackUnwinderAMD64::LookupPrimaryFunctionEntry(
- __in _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
- __in ULONG64 ImageBase
+ _In_ _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
+ _In_ ULONG64 ImageBase
)
@@ -1732,9 +1732,9 @@ Return Value:
_PIMAGE_RUNTIME_FUNCTION_ENTRY
OOPStackUnwinderAMD64::SameFunction(
- __in _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
- __in ULONG64 ImageBase,
- __in ULONG64 ControlPc
+ _In_ _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
+ _In_ ULONG64 ImageBase,
+ _In_ ULONG64 ControlPc
)
/*++
@@ -1812,7 +1812,7 @@ Return Value:
}
}
-ULONG OOPStackUnwinderAMD64::UnwindOpSlots(__in UNWIND_CODE UnwindCode)
+ULONG OOPStackUnwinderAMD64::UnwindOpSlots(_In_ UNWIND_CODE UnwindCode)
/*++
Routine Description:
diff --git a/src/coreclr/unwinder/amd64/unwinder_amd64.h b/src/coreclr/unwinder/amd64/unwinder_amd64.h
index 48e67f6702187c..c7a7683813ac09 100644
--- a/src/coreclr/unwinder/amd64/unwinder_amd64.h
+++ b/src/coreclr/unwinder/amd64/unwinder_amd64.h
@@ -24,43 +24,43 @@ class OOPStackUnwinderAMD64 : public OOPStackUnwinder
// Everything below comes from dbghelp.dll.
//
- static HRESULT VirtualUnwind(__in DWORD HandlerType,
- __in DWORD64 ImageBase,
- __in DWORD64 ControlPc,
- __in _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
+ static HRESULT VirtualUnwind(_In_ DWORD HandlerType,
+ _In_ DWORD64 ImageBase,
+ _In_ DWORD64 ControlPc,
+ _In_ _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
__inout PCONTEXT ContextRecord,
- __out PVOID *HandlerData,
- __out PDWORD64 EstablisherFrame,
+ _Out_ PVOID *HandlerData,
+ _Out_ PDWORD64 EstablisherFrame,
__inout_opt PKNONVOLATILE_CONTEXT_POINTERS ContextPointers,
- __deref_opt_out_opt PEXCEPTION_ROUTINE *HandlerRoutine);
+ _Outptr_opt_result_maybenull_ PEXCEPTION_ROUTINE *HandlerRoutine);
protected:
- static ULONG UnwindOpSlots(__in UNWIND_CODE UnwindCode);
+ static ULONG UnwindOpSlots(_In_ UNWIND_CODE UnwindCode);
- static HRESULT UnwindEpilogue(__in ULONG64 ImageBase,
- __in ULONG64 ControlPc,
- __in ULONG EpilogueOffset,
- __in _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
+ static HRESULT UnwindEpilogue(_In_ ULONG64 ImageBase,
+ _In_ ULONG64 ControlPc,
+ _In_ ULONG EpilogueOffset,
+ _In_ _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
__inout PCONTEXT ContextRecord,
__inout_opt PKNONVOLATILE_CONTEXT_POINTERS ContextPointers);
- static HRESULT UnwindPrologue(__in DWORD64 ImageBase,
- __in DWORD64 ControlPc,
- __in DWORD64 FrameBase,
- __in _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
+ static HRESULT UnwindPrologue(_In_ DWORD64 ImageBase,
+ _In_ DWORD64 ControlPc,
+ _In_ DWORD64 FrameBase,
+ _In_ _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
__inout PCONTEXT ContextRecord,
__inout_opt PKNONVOLATILE_CONTEXT_POINTERS ContextPointers,
- __deref_out _PIMAGE_RUNTIME_FUNCTION_ENTRY *FinalFunctionEntry);
+ _Outptr_ _PIMAGE_RUNTIME_FUNCTION_ENTRY *FinalFunctionEntry);
static _PIMAGE_RUNTIME_FUNCTION_ENTRY LookupPrimaryFunctionEntry
- (__in _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
- __in DWORD64 ImageBase);
+ (_In_ _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
+ _In_ DWORD64 ImageBase);
static _PIMAGE_RUNTIME_FUNCTION_ENTRY SameFunction
- (__in _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
- __in DWORD64 ImageBase,
- __in DWORD64 ControlPc);
+ (_In_ _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
+ _In_ DWORD64 ImageBase,
+ _In_ DWORD64 ControlPc);
static UNWIND_INFO * GetUnwindInfo(TADDR taUnwindInfo);
};
diff --git a/src/coreclr/unwinder/arm/unwinder_arm.cpp b/src/coreclr/unwinder/arm/unwinder_arm.cpp
index 5c8de353422680..2ad5d3de94a7a7 100644
--- a/src/coreclr/unwinder/arm/unwinder_arm.cpp
+++ b/src/coreclr/unwinder/arm/unwinder_arm.cpp
@@ -258,8 +258,8 @@ static const ULONG RegisterMaskLookup[1 << 6] =
NTSTATUS
RtlpUnwindCustom(
__inout PT_CONTEXT ContextRecord,
- __in BYTE Opcode,
- __in PARM_UNWIND_PARAMS UnwindParams
+ _In_ BYTE Opcode,
+ _In_ PARM_UNWIND_PARAMS UnwindParams
)
/*++
@@ -385,9 +385,9 @@ Return Value:
NTSTATUS
RtlpPopVfpRegisterRange(
__inout PT_CONTEXT ContextRecord,
- __in ULONG RegStart,
- __in ULONG RegStop,
- __in PARM_UNWIND_PARAMS UnwindParams
+ _In_ ULONG RegStart,
+ _In_ ULONG RegStop,
+ _In_ PARM_UNWIND_PARAMS UnwindParams
)
/*++
@@ -445,9 +445,9 @@ Return Value:
FORCEINLINE
WORD
RtlpRangeToMask(
- __in ULONG Start,
- __in ULONG Stop,
- __in ULONG Lr
+ _In_ ULONG Start,
+ _In_ ULONG Stop,
+ _In_ ULONG Lr
)
/*++
@@ -485,8 +485,8 @@ Return Value:
NTSTATUS
RtlpPopRegisterMask(
__inout PT_CONTEXT ContextRecord,
- __in WORD RegMask,
- __in PARM_UNWIND_PARAMS UnwindParams
+ _In_ WORD RegMask,
+ _In_ PARM_UNWIND_PARAMS UnwindParams
)
/*++
@@ -556,8 +556,8 @@ Return Value:
FORCEINLINE
BOOLEAN
RtlpCheckCondition(
- __in PT_CONTEXT ContextRecord,
- __in ULONG Condition
+ _In_ PT_CONTEXT ContextRecord,
+ _In_ ULONG Condition
)
/*++
@@ -585,10 +585,10 @@ Return Value:
ULONG
RtlpComputeScopeSize(
- __in ULONG UnwindCodePtr,
- __in ULONG UnwindCodesEndPtr,
- __in BOOLEAN IsEpilog,
- __in PVOID UnwindParams
+ _In_ ULONG UnwindCodePtr,
+ _In_ ULONG UnwindCodesEndPtr,
+ _In_ BOOLEAN IsEpilog,
+ _In_ PVOID UnwindParams
)
/*++
@@ -647,13 +647,13 @@ Return Value:
HRESULT
RtlpUnwindFunctionCompact(
- __in ULONG ControlPcRva,
- __in PT_RUNTIME_FUNCTION FunctionEntry,
+ _In_ ULONG ControlPcRva,
+ _In_ PT_RUNTIME_FUNCTION FunctionEntry,
__inout PT_CONTEXT ContextRecord,
- __out PULONG EstablisherFrame,
- __deref_opt_out_opt PEXCEPTION_ROUTINE *HandlerRoutine,
- __out PVOID *HandlerData,
- __in PARM_UNWIND_PARAMS UnwindParams
+ _Out_ PULONG EstablisherFrame,
+ _Outptr_opt_result_maybenull_ PEXCEPTION_ROUTINE *HandlerRoutine,
+ _Out_ PVOID *HandlerData,
+ _In_ PARM_UNWIND_PARAMS UnwindParams
)
{
ULONG CBit;
@@ -916,14 +916,14 @@ RtlpUnwindFunctionCompact(
HRESULT
RtlpUnwindFunctionFull(
- __in ULONG ControlPcRva,
- __in ULONG ImageBase,
- __in PT_RUNTIME_FUNCTION FunctionEntry,
+ _In_ ULONG ControlPcRva,
+ _In_ ULONG ImageBase,
+ _In_ PT_RUNTIME_FUNCTION FunctionEntry,
__inout PT_CONTEXT ContextRecord,
- __out PULONG EstablisherFrame,
- __deref_opt_out_opt PEXCEPTION_ROUTINE *HandlerRoutine,
- __out PVOID *HandlerData,
- __in PARM_UNWIND_PARAMS UnwindParams
+ _Out_ PULONG EstablisherFrame,
+ _Outptr_opt_result_maybenull_ PEXCEPTION_ROUTINE *HandlerRoutine,
+ _Out_ PVOID *HandlerData,
+ _In_ PARM_UNWIND_PARAMS UnwindParams
)
/*++
@@ -1499,13 +1499,13 @@ BOOL DacUnwindStackFrame(T_CONTEXT *pContext, T_KNONVOLATILE_CONTEXT_POINTERS* p
#if defined(HOST_UNIX)
PEXCEPTION_ROUTINE RtlVirtualUnwind(
- __in ULONG HandlerType,
- __in ULONG ImageBase,
- __in ULONG ControlPc,
- __in PT_RUNTIME_FUNCTION FunctionEntry,
- __in OUT PCONTEXT ContextRecord,
- __out PVOID *HandlerData,
- __out PULONG EstablisherFrame,
+ _In_ ULONG HandlerType,
+ _In_ ULONG ImageBase,
+ _In_ ULONG ControlPc,
+ _In_ PT_RUNTIME_FUNCTION FunctionEntry,
+ _In_ OUT PCONTEXT ContextRecord,
+ _Out_ PVOID *HandlerData,
+ _Out_ PULONG EstablisherFrame,
__inout_opt PT_KNONVOLATILE_CONTEXT_POINTERS ContextPointers
)
{
diff --git a/src/coreclr/unwinder/arm/unwinder_arm.h b/src/coreclr/unwinder/arm/unwinder_arm.h
index 1a8e52fa9a3df3..cb73307448c019 100644
--- a/src/coreclr/unwinder/arm/unwinder_arm.h
+++ b/src/coreclr/unwinder/arm/unwinder_arm.h
@@ -25,28 +25,28 @@ class OOPStackUnwinderArm : public OOPStackUnwinder
//
protected:
- HRESULT UnwindPrologue(__in DWORD64 ImageBase,
- __in DWORD64 ControlPc,
- __in DWORD64 FrameBase,
- __in _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
+ HRESULT UnwindPrologue(_In_ DWORD64 ImageBase,
+ _In_ DWORD64 ControlPc,
+ _In_ DWORD64 FrameBase,
+ _In_ _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
__inout PT_CONTEXT ContextRecord);
- HRESULT VirtualUnwind(__in DWORD64 ImageBase,
- __in DWORD64 ControlPc,
- __in _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
+ HRESULT VirtualUnwind(_In_ DWORD64 ImageBase,
+ _In_ DWORD64 ControlPc,
+ _In_ _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
__inout PT_CONTEXT ContextRecord,
- __out PDWORD64 EstablisherFrame);
+ _Out_ PDWORD64 EstablisherFrame);
DWORD64 LookupPrimaryUnwindInfo
- (__in _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
- __in DWORD64 ImageBase,
- __out _PIMAGE_RUNTIME_FUNCTION_ENTRY PrimaryEntry);
+ (_In_ _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
+ _In_ DWORD64 ImageBase,
+ _Out_ _PIMAGE_RUNTIME_FUNCTION_ENTRY PrimaryEntry);
_PIMAGE_RUNTIME_FUNCTION_ENTRY SameFunction
- (__in _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
- __in DWORD64 ImageBase,
- __in DWORD64 ControlPc,
- __out _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionReturnBuffer);
+ (_In_ _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
+ _In_ DWORD64 ImageBase,
+ _In_ DWORD64 ControlPc,
+ _Out_ _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionReturnBuffer);
};
#endif // __unwinder_arm__
diff --git a/src/coreclr/unwinder/arm64/unwinder_arm64.cpp b/src/coreclr/unwinder/arm64/unwinder_arm64.cpp
index 5740c3cfcab80c..d812e7be3f17bf 100644
--- a/src/coreclr/unwinder/arm64/unwinder_arm64.cpp
+++ b/src/coreclr/unwinder/arm64/unwinder_arm64.cpp
@@ -167,8 +167,8 @@ static const BYTE UnwindCodeSizeTable[256] =
NTSTATUS
RtlpUnwindCustom(
__inout PT_CONTEXT ContextRecord,
- __in BYTE Opcode,
- __in PARM64_UNWIND_PARAMS UnwindParams
+ _In_ BYTE Opcode,
+ _In_ PARM64_UNWIND_PARAMS UnwindParams
)
/*++
@@ -374,10 +374,10 @@ Return Value:
ULONG
RtlpComputeScopeSize(
- __in ULONG_PTR UnwindCodePtr,
- __in ULONG_PTR UnwindCodesEndPtr,
- __in BOOLEAN IsEpilog,
- __in PARM64_UNWIND_PARAMS UnwindParams
+ _In_ ULONG_PTR UnwindCodePtr,
+ _In_ ULONG_PTR UnwindCodesEndPtr,
+ _In_ BOOLEAN IsEpilog,
+ _In_ PARM64_UNWIND_PARAMS UnwindParams
)
/*++
@@ -441,10 +441,10 @@ Return Value:
NTSTATUS
RtlpUnwindRestoreRegisterRange(
__inout PT_CONTEXT ContextRecord,
- __in LONG SpOffset,
- __in ULONG FirstRegister,
- __in ULONG RegisterCount,
- __in PARM64_UNWIND_PARAMS UnwindParams
+ _In_ LONG SpOffset,
+ _In_ ULONG FirstRegister,
+ _In_ ULONG RegisterCount,
+ _In_ PARM64_UNWIND_PARAMS UnwindParams
)
/*++
@@ -517,10 +517,10 @@ Return Value:
NTSTATUS
RtlpUnwindRestoreFpRegisterRange(
__inout PT_CONTEXT ContextRecord,
- __in LONG SpOffset,
- __in ULONG FirstRegister,
- __in ULONG RegisterCount,
- __in PARM64_UNWIND_PARAMS UnwindParams
+ _In_ LONG SpOffset,
+ _In_ ULONG FirstRegister,
+ _In_ ULONG RegisterCount,
+ _In_ PARM64_UNWIND_PARAMS UnwindParams
)
/*++
@@ -588,14 +588,14 @@ Return Value:
NTSTATUS
RtlpUnwindFunctionFull(
- __in DWORD64 ControlPcRva,
- __in ULONG_PTR ImageBase,
- __in PT_RUNTIME_FUNCTION FunctionEntry,
+ _In_ DWORD64 ControlPcRva,
+ _In_ ULONG_PTR ImageBase,
+ _In_ PT_RUNTIME_FUNCTION FunctionEntry,
__inout T_CONTEXT *ContextRecord,
- __out PDWORD64 EstablisherFrame,
- __deref_opt_out_opt PEXCEPTION_ROUTINE *HandlerRoutine,
- __out PVOID *HandlerData,
- __in PARM64_UNWIND_PARAMS UnwindParams
+ _Out_ PDWORD64 EstablisherFrame,
+ _Outptr_opt_result_maybenull_ PEXCEPTION_ROUTINE *HandlerRoutine,
+ _Out_ PVOID *HandlerData,
+ _In_ PARM64_UNWIND_PARAMS UnwindParams
)
/*++
@@ -1223,13 +1223,13 @@ Return Value:
NTSTATUS
RtlpUnwindFunctionCompact(
- __in DWORD64 ControlPcRva,
- __in PT_RUNTIME_FUNCTION FunctionEntry,
+ _In_ DWORD64 ControlPcRva,
+ _In_ PT_RUNTIME_FUNCTION FunctionEntry,
__inout T_CONTEXT *ContextRecord,
- __out PDWORD64 EstablisherFrame,
- __deref_opt_out_opt PEXCEPTION_ROUTINE *HandlerRoutine,
- __out PVOID *HandlerData,
- __in PARM64_UNWIND_PARAMS UnwindParams
+ _Out_ PDWORD64 EstablisherFrame,
+ _Outptr_opt_result_maybenull_ PEXCEPTION_ROUTINE *HandlerRoutine,
+ _Out_ PVOID *HandlerData,
+ _In_ PARM64_UNWIND_PARAMS UnwindParams
)
/*++
diff --git a/src/coreclr/unwinder/arm64/unwinder_arm64.h b/src/coreclr/unwinder/arm64/unwinder_arm64.h
index f0767d2c315b31..701a3e4f1eb18e 100644
--- a/src/coreclr/unwinder/arm64/unwinder_arm64.h
+++ b/src/coreclr/unwinder/arm64/unwinder_arm64.h
@@ -25,28 +25,28 @@ class OOPStackUnwinderArm64 : public OOPStackUnwinder
//
protected:
- HRESULT UnwindPrologue(__in DWORD64 ImageBase,
- __in DWORD64 ControlPc,
- __in DWORD64 FrameBase,
- __in _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
+ HRESULT UnwindPrologue(_In_ DWORD64 ImageBase,
+ _In_ DWORD64 ControlPc,
+ _In_ DWORD64 FrameBase,
+ _In_ _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
__inout PT_CONTEXT ContextRecord);
- HRESULT VirtualUnwind(__in DWORD64 ImageBase,
- __in DWORD64 ControlPc,
- __in _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
+ HRESULT VirtualUnwind(_In_ DWORD64 ImageBase,
+ _In_ DWORD64 ControlPc,
+ _In_ _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
__inout PT_CONTEXT ContextRecord,
- __out PDWORD64 EstablisherFrame);
+ _Out_ PDWORD64 EstablisherFrame);
DWORD64 LookupPrimaryUnwindInfo
- (__in _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
- __in DWORD64 ImageBase,
- __out _PIMAGE_RUNTIME_FUNCTION_ENTRY PrimaryEntry);
+ (_In_ _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
+ _In_ DWORD64 ImageBase,
+ _Out_ _PIMAGE_RUNTIME_FUNCTION_ENTRY PrimaryEntry);
_PIMAGE_RUNTIME_FUNCTION_ENTRY SameFunction
- (__in _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
- __in DWORD64 ImageBase,
- __in DWORD64 ControlPc,
- __out _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionReturnBuffer);
+ (_In_ _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
+ _In_ DWORD64 ImageBase,
+ _In_ DWORD64 ControlPc,
+ _Out_ _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionReturnBuffer);
};
#endif // __unwinder_arm64__
diff --git a/src/coreclr/unwinder/i386/unwinder_i386.cpp b/src/coreclr/unwinder/i386/unwinder_i386.cpp
index 958d0afcf45e20..e1294c8afbd1ea 100644
--- a/src/coreclr/unwinder/i386/unwinder_i386.cpp
+++ b/src/coreclr/unwinder/i386/unwinder_i386.cpp
@@ -98,15 +98,15 @@ Routine Description:
--*/
HRESULT
OOPStackUnwinderX86::VirtualUnwind(
- __in DWORD HandlerType,
- __in DWORD ImageBase,
- __in DWORD ControlPc,
- __in _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
+ _In_ DWORD HandlerType,
+ _In_ DWORD ImageBase,
+ _In_ DWORD ControlPc,
+ _In_ _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
__inout PCONTEXT ContextRecord,
- __out PVOID *HandlerData,
- __out PDWORD EstablisherFrame,
+ _Out_ PVOID *HandlerData,
+ _Out_ PDWORD EstablisherFrame,
__inout_opt PKNONVOLATILE_CONTEXT_POINTERS ContextPointers,
- __deref_opt_out_opt PEXCEPTION_ROUTINE *HandlerRoutine
+ _Outptr_opt_result_maybenull_ PEXCEPTION_ROUTINE *HandlerRoutine
)
{
if (HandlerRoutine != NULL)
@@ -190,13 +190,13 @@ NTSYSAPI
PEXCEPTION_ROUTINE
NTAPI
RtlVirtualUnwind (
- __in DWORD HandlerType,
- __in DWORD ImageBase,
- __in DWORD ControlPc,
- __in PRUNTIME_FUNCTION FunctionEntry,
+ _In_ DWORD HandlerType,
+ _In_ DWORD ImageBase,
+ _In_ DWORD ControlPc,
+ _In_ PRUNTIME_FUNCTION FunctionEntry,
__inout PT_CONTEXT ContextRecord,
- __out PVOID *HandlerData,
- __out PDWORD EstablisherFrame,
+ _Out_ PVOID *HandlerData,
+ _Out_ PDWORD EstablisherFrame,
__inout_opt PT_KNONVOLATILE_CONTEXT_POINTERS ContextPointers
)
{
diff --git a/src/coreclr/unwinder/i386/unwinder_i386.h b/src/coreclr/unwinder/i386/unwinder_i386.h
index 6a6c3896ee6af4..904ec80dea9813 100644
--- a/src/coreclr/unwinder/i386/unwinder_i386.h
+++ b/src/coreclr/unwinder/i386/unwinder_i386.h
@@ -19,15 +19,15 @@ class OOPStackUnwinderX86 : public OOPStackUnwinder
public:
static BOOL Unwind(T_CONTEXT* pContextRecord, T_KNONVOLATILE_CONTEXT_POINTERS* pContextPointers);
- static HRESULT VirtualUnwind(__in DWORD HandlerType,
- __in DWORD ImageBase,
- __in DWORD ControlPc,
- __in _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
+ static HRESULT VirtualUnwind(_In_ DWORD HandlerType,
+ _In_ DWORD ImageBase,
+ _In_ DWORD ControlPc,
+ _In_ _PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry,
__inout PCONTEXT ContextRecord,
- __out PVOID *HandlerData,
- __out PDWORD EstablisherFrame,
+ _Out_ PVOID *HandlerData,
+ _Out_ PDWORD EstablisherFrame,
__inout_opt PKNONVOLATILE_CONTEXT_POINTERS ContextPointers,
- __deref_opt_out_opt PEXCEPTION_ROUTINE *HandlerRoutine);
+ _Outptr_opt_result_maybenull_ PEXCEPTION_ROUTINE *HandlerRoutine);
};
#endif // FEATURE_EH_FUNCLETS
diff --git a/src/coreclr/unwinder/unwinder.cpp b/src/coreclr/unwinder/unwinder.cpp
index 98245fef445c09..08829fa4cd513b 100644
--- a/src/coreclr/unwinder/unwinder.cpp
+++ b/src/coreclr/unwinder/unwinder.cpp
@@ -25,7 +25,7 @@ EXTERN_C void GetRuntimeStackWalkInfo(IN ULONG64 ControlPc,
//
HRESULT OOPStackUnwinder::GetModuleBase( DWORD64 address,
- __out PDWORD64 pdwBase)
+ _Out_ PDWORD64 pdwBase)
{
GetRuntimeStackWalkInfo(address, reinterpret_cast(pdwBase), NULL);
return ((*pdwBase == NULL) ? E_FAIL : S_OK);
@@ -47,7 +47,7 @@ HRESULT OOPStackUnwinder::GetModuleBase( DWORD64 address,
//
HRESULT OOPStackUnwinder::GetFunctionEntry( DWORD64 address,
- __out_ecount(cbBuffer) PVOID pBuffer,
+ _Out_writes_(cbBuffer) PVOID pBuffer,
DWORD cbBuffer)
{
if (cbBuffer < sizeof(T_RUNTIME_FUNCTION))
diff --git a/src/coreclr/unwinder/unwinder.h b/src/coreclr/unwinder/unwinder.h
index 0c4838f1ed5ccb..241dc8a7ddfb30 100644
--- a/src/coreclr/unwinder/unwinder.h
+++ b/src/coreclr/unwinder/unwinder.h
@@ -29,11 +29,11 @@ class OOPStackUnwinder
// Given a control PC, return the base of the module it is in. For jitted managed code, this is the
// start of the code heap.
static HRESULT GetModuleBase( DWORD64 address,
- __out PDWORD64 pdwBase);
+ _Out_ PDWORD64 pdwBase);
// Given a control PC, return the function entry of the functoin it is in.
static HRESULT GetFunctionEntry( DWORD64 address,
- __out_ecount(cbBuffer) PVOID pBuffer,
+ _Out_writes_(cbBuffer) PVOID pBuffer,
DWORD cbBuffer);
};
diff --git a/src/coreclr/utilcode/ccomprc.cpp b/src/coreclr/utilcode/ccomprc.cpp
index 21d13a5e5d791a..761d966763f6ca 100644
--- a/src/coreclr/utilcode/ccomprc.cpp
+++ b/src/coreclr/utilcode/ccomprc.cpp
@@ -461,7 +461,7 @@ HRESULT CCompRC::GetLibrary(LocaleID langId, HRESOURCEDLL* phInst)
// We load the localized libraries and cache the handle for future use.
// Mutliple threads may call this, so the cache structure is thread safe.
//*****************************************************************************
-HRESULT CCompRC::LoadString(ResourceCategory eCategory, UINT iResourceID, __out_ecount(iMax) LPWSTR szBuffer, int iMax, int *pcwchUsed)
+HRESULT CCompRC::LoadString(ResourceCategory eCategory, UINT iResourceID, _Out_writes_(iMax) LPWSTR szBuffer, int iMax, int *pcwchUsed)
{
WRAPPER_NO_CONTRACT;
LocaleIDValue langIdValue;
@@ -487,7 +487,7 @@ HRESULT CCompRC::LoadString(ResourceCategory eCategory, UINT iResourceID, __out_
return LoadString(eCategory, langId, iResourceID, szBuffer, iMax, pcwchUsed);
}
-HRESULT CCompRC::LoadString(ResourceCategory eCategory, LocaleID langId, UINT iResourceID, __out_ecount(iMax) LPWSTR szBuffer, int iMax, int *pcwchUsed)
+HRESULT CCompRC::LoadString(ResourceCategory eCategory, LocaleID langId, UINT iResourceID, _Out_writes_(iMax) LPWSTR szBuffer, int iMax, int *pcwchUsed)
{
#ifdef DBI_COMPONENT_MONO
return E_NOTIMPL;
diff --git a/src/coreclr/utilcode/clrconfig.cpp b/src/coreclr/utilcode/clrconfig.cpp
index d4f6ec2adabafb..caad3b594a6eaf 100644
--- a/src/coreclr/utilcode/clrconfig.cpp
+++ b/src/coreclr/utilcode/clrconfig.cpp
@@ -228,7 +228,7 @@ namespace
HRESULT GetConfigDWORD(
LPCWSTR name,
DWORD defValue,
- __out DWORD *result,
+ _Out_ DWORD *result,
LookupOptions options)
{
CONTRACTL
@@ -312,7 +312,7 @@ namespace
// Return Value:
// HRESULT indicating success or failure.
//
- HRESULT TrimWhiteSpace(LPCWSTR wszOrig, __deref_out_z LPWSTR * pwszTrimmed)
+ HRESULT TrimWhiteSpace(LPCWSTR wszOrig, _Outptr_result_z_ LPWSTR * pwszTrimmed)
{
CONTRACTL
{
@@ -537,7 +537,7 @@ LPWSTR CLRConfig::GetConfigValue(const ConfigStringInfo & info)
// not found.
//
// static
-HRESULT CLRConfig::GetConfigValue(const ConfigStringInfo & info, __deref_out_z LPWSTR * outVal)
+HRESULT CLRConfig::GetConfigValue(const ConfigStringInfo & info, _Outptr_result_z_ LPWSTR * outVal)
{
CONTRACT(HRESULT) {
NOTHROW;
@@ -609,7 +609,7 @@ BOOL CLRConfig::IsConfigOptionSpecified(LPCWSTR name)
// Deallocation function for code:CLRConfig::FreeConfigString
//
// static
-void CLRConfig::FreeConfigString(__in_z LPWSTR str)
+void CLRConfig::FreeConfigString(_In_z_ LPWSTR str)
{
LIMITED_METHOD_CONTRACT;
diff --git a/src/coreclr/utilcode/clrhost_nodependencies.cpp b/src/coreclr/utilcode/clrhost_nodependencies.cpp
index 48747e031101ba..7d2fceb3005e1a 100644
--- a/src/coreclr/utilcode/clrhost_nodependencies.cpp
+++ b/src/coreclr/utilcode/clrhost_nodependencies.cpp
@@ -44,8 +44,8 @@ void DisableThrowCheck()
#define CLRThrowsExceptionWorker() RealCLRThrowsExceptionWorker(__FUNCTION__, __FILE__, __LINE__)
-static void RealCLRThrowsExceptionWorker(__in_z const char *szFunction,
- __in_z const char *szFile,
+static void RealCLRThrowsExceptionWorker(_In_z_ const char *szFunction,
+ _In_z_ const char *szFile,
int lineNum)
{
WRAPPER_NO_CONTRACT;
diff --git a/src/coreclr/utilcode/fstring.cpp b/src/coreclr/utilcode/fstring.cpp
index 0f4360e9ffe0b9..9bcd12d1fffc6c 100644
--- a/src/coreclr/utilcode/fstring.cpp
+++ b/src/coreclr/utilcode/fstring.cpp
@@ -23,7 +23,7 @@ namespace FString
#define MAX_LENGTH 0x1fffff00
-HRESULT Unicode_Utf8_Length(__in_z LPCWSTR pString, __out bool * pAllAscii, __out DWORD * pLength)
+HRESULT Unicode_Utf8_Length(_In_z_ LPCWSTR pString, _Out_ bool * pAllAscii, _Out_ DWORD * pLength)
{
CONTRACTL
{
@@ -86,7 +86,7 @@ HRESULT Unicode_Utf8_Length(__in_z LPCWSTR pString, __out bool * pAllAscii, __ou
// UNICODE to UTF8
-HRESULT Unicode_Utf8(__in_z LPCWSTR pString, bool allAscii, __out_z LPSTR pBuffer, DWORD length)
+HRESULT Unicode_Utf8(_In_z_ LPCWSTR pString, bool allAscii, _Out_writes_bytes_(length) LPSTR pBuffer, DWORD length)
{
CONTRACTL
{
@@ -143,7 +143,7 @@ HRESULT Unicode_Utf8(__in_z LPCWSTR pString, bool allAscii, __out_z LPSTR pBuffe
}
-HRESULT Utf8_Unicode_Length(__in_z LPCSTR pString, __out bool * pAllAscii, __out DWORD * pLength)
+HRESULT Utf8_Unicode_Length(_In_z_ LPCSTR pString, _Out_ bool * pAllAscii, _Out_ DWORD * pLength)
{
CONTRACTL
{
@@ -207,7 +207,7 @@ HRESULT Utf8_Unicode_Length(__in_z LPCSTR pString, __out bool * pAllAscii, __out
// UTF8 to Unicode
-HRESULT Utf8_Unicode(__in_z LPCSTR pString, bool allAscii, __out_z LPWSTR pBuffer, DWORD length)
+HRESULT Utf8_Unicode(_In_z_ LPCSTR pString, bool allAscii, _Out_writes_bytes_(length) LPWSTR pBuffer, DWORD length)
{
CONTRACTL
{
@@ -264,7 +264,7 @@ HRESULT Utf8_Unicode(__in_z LPCSTR pString, bool allAscii, __out_z LPWSTR pBuffe
}
-HRESULT ConvertUnicode_Utf8(__in_z LPCWSTR pString, __out_z LPSTR * pBuffer)
+HRESULT ConvertUnicode_Utf8(_In_z_ LPCWSTR pString, _Outptr_result_z_ LPSTR * pBuffer)
{
bool allAscii;
DWORD length;
@@ -289,7 +289,7 @@ HRESULT ConvertUnicode_Utf8(__in_z LPCWSTR pString, __out_z LPSTR * pBuffer)
}
-HRESULT ConvertUtf8_Unicode(__in_z LPCSTR pString, __out_z LPWSTR * pBuffer)
+HRESULT ConvertUtf8_Unicode(_In_z_ LPCSTR pString, _Outptr_result_z_ LPWSTR * pBuffer)
{
bool allAscii;
DWORD length;
diff --git a/src/coreclr/utilcode/loaderheap.cpp b/src/coreclr/utilcode/loaderheap.cpp
index bc377c683ba52d..51e39de70ecf92 100644
--- a/src/coreclr/utilcode/loaderheap.cpp
+++ b/src/coreclr/utilcode/loaderheap.cpp
@@ -502,9 +502,9 @@ class LoaderHeapSniffer
static VOID RecordEvent(UnlockedLoaderHeap *pHeap,
AllocationType allocationType,
- __in const char *szFile,
+ _In_ const char *szFile,
int lineNum,
- __in const char *szAllocFile,
+ _In_ const char *szAllocFile,
int allocLineNum,
void *pMem,
size_t dwRequestedSize,
@@ -1248,7 +1248,7 @@ BOOL UnlockedLoaderHeap::GetMoreCommittedPages(size_t dwMinSize)
}
void *UnlockedLoaderHeap::UnlockedAllocMem(size_t dwSize
- COMMA_INDEBUG(__in const char *szFile)
+ COMMA_INDEBUG(_In_ const char *szFile)
COMMA_INDEBUG(int lineNum))
{
CONTRACT(void*)
@@ -1300,7 +1300,7 @@ static DWORD ShouldInjectFault()
#endif
void *UnlockedLoaderHeap::UnlockedAllocMem_NoThrow(size_t dwSize
- COMMA_INDEBUG(__in const char *szFile)
+ COMMA_INDEBUG(_In_ const char *szFile)
COMMA_INDEBUG(int lineNum))
{
CONTRACT(void*)
@@ -1404,9 +1404,9 @@ void *UnlockedLoaderHeap::UnlockedAllocMem_NoThrow(size_t dwSize
void UnlockedLoaderHeap::UnlockedBackoutMem(void *pMem,
size_t dwRequestedSize
- COMMA_INDEBUG(__in const char *szFile)
+ COMMA_INDEBUG(_In_ const char *szFile)
COMMA_INDEBUG(int lineNum)
- COMMA_INDEBUG(__in const char *szAllocFile)
+ COMMA_INDEBUG(_In_ const char *szAllocFile)
COMMA_INDEBUG(int allocLineNum))
{
CONTRACTL
@@ -1576,7 +1576,7 @@ void UnlockedLoaderHeap::UnlockedBackoutMem(void *pMem,
void *UnlockedLoaderHeap::UnlockedAllocAlignedMem_NoThrow(size_t dwRequestedSize,
size_t alignment,
size_t *pdwExtra
- COMMA_INDEBUG(__in const char *szFile)
+ COMMA_INDEBUG(_In_ const char *szFile)
COMMA_INDEBUG(int lineNum))
{
CONTRACT(void*)
@@ -1713,7 +1713,7 @@ void *UnlockedLoaderHeap::UnlockedAllocAlignedMem_NoThrow(size_t dwRequestedSiz
void *UnlockedLoaderHeap::UnlockedAllocAlignedMem(size_t dwRequestedSize,
size_t dwAlignment,
size_t *pdwExtra
- COMMA_INDEBUG(__in const char *szFile)
+ COMMA_INDEBUG(_In_ const char *szFile)
COMMA_INDEBUG(int lineNum))
{
CONTRACTL
@@ -1908,9 +1908,9 @@ void UnlockedLoaderHeap::UnlockedPrintEvents()
/*static*/ VOID LoaderHeapSniffer::RecordEvent(UnlockedLoaderHeap *pHeap,
AllocationType allocationType,
- __in const char *szFile,
+ _In_ const char *szFile,
int lineNum,
- __in const char *szAllocFile,
+ _In_ const char *szAllocFile,
int allocLineNum,
void *pMem,
size_t dwRequestedSize,
diff --git a/src/coreclr/utilcode/log.cpp b/src/coreclr/utilcode/log.cpp
index b4a73f2cb6bafc..b889c7d341ce3a 100644
--- a/src/coreclr/utilcode/log.cpp
+++ b/src/coreclr/utilcode/log.cpp
@@ -76,7 +76,7 @@ VOID InitLogging()
if (CLRConfig::GetConfigValue(CLRConfig::INTERNAL_LogWithPid))
{
WCHAR szPid[20];
- swprintf_s(szPid, COUNTOF(szPid), W(".%d"), GetCurrentProcessId());
+ swprintf_s(szPid, ARRAY_SIZE(szPid), W(".%d"), GetCurrentProcessId());
wcscat_s(szLogFileName.Ptr(), szLogFileName.Size(), szPid);
}
@@ -323,7 +323,7 @@ VOID LogSpewAlwaysValist(const char *fmt, va_list args)
static bool needsPrefix = true;
if (needsPrefix)
- buflen = sprintf_s(pBuffer, COUNTOF(rgchBuffer), "TID %04x: ", GetCurrentThreadId());
+ buflen = sprintf_s(pBuffer, ARRAY_SIZE(rgchBuffer), "TID %04x: ", GetCurrentThreadId());
needsPrefix = (fmt[strlen(fmt)-1] == '\n');
diff --git a/src/coreclr/utilcode/makepath.cpp b/src/coreclr/utilcode/makepath.cpp
index 4bf8787242a1b2..161e859455327d 100644
--- a/src/coreclr/utilcode/makepath.cpp
+++ b/src/coreclr/utilcode/makepath.cpp
@@ -39,11 +39,11 @@
*******************************************************************************/
void MakePath (
- __out CQuickWSTR &szPath,
- __in LPCWSTR drive,
- __in LPCWSTR dir,
- __in LPCWSTR fname,
- __in LPCWSTR ext
+ _Out_ CQuickWSTR &szPath,
+ _In_ LPCWSTR drive,
+ _In_ LPCWSTR dir,
+ _In_ LPCWSTR fname,
+ _In_ LPCWSTR ext
)
{
CONTRACTL
diff --git a/src/coreclr/utilcode/namespaceutil.cpp b/src/coreclr/utilcode/namespaceutil.cpp
index 3731d0399fcdf1..5b6d3d9f95bee8 100644
--- a/src/coreclr/utilcode/namespaceutil.cpp
+++ b/src/coreclr/utilcode/namespaceutil.cpp
@@ -196,9 +196,9 @@ void ns::SplitInline(
//*****************************************************************************
int ns::SplitPath( // true ok, false trunction.
const WCHAR *szPath, // Path to split.
- __out_ecount(cchNameSpace) WCHAR *szNameSpace, // Output for namespace value.
+ _Out_writes_(cchNameSpace) WCHAR *szNameSpace, // Output for namespace value.
int cchNameSpace, // Max chars for output.
- __out_ecount(cchName) WCHAR *szName, // Output for name.
+ _Out_writes_(cchName) WCHAR *szName, // Output for name.
int cchName) // Max chars for output.
{
STATIC_CONTRACT_NOTHROW;
@@ -243,9 +243,9 @@ int ns::SplitPath( // true ok, false trunction.
int ns::SplitPath( // true ok, false trunction.
LPCUTF8 szPath, // Path to split.
- __out_ecount_opt (cchNameSpace) LPUTF8 szNameSpace, // Output for namespace value.
+ _Out_writes_opt_ (cchNameSpace) LPUTF8 szNameSpace, // Output for namespace value.
int cchNameSpace, // Max chars for output.
- __out_ecount_opt (cchName) LPUTF8 szName, // Output for name.
+ _Out_writes_opt_ (cchName) LPUTF8 szName, // Output for name.
int cchName) // Max chars for output.
{
STATIC_CONTRACT_NOTHROW;
@@ -293,7 +293,7 @@ int ns::SplitPath( // true ok, false trunction.
// correct separator.
//*****************************************************************************
int ns::MakePath( // true ok, false truncation.
- __out_ecount(cchChars) WCHAR *szOut, // output path for name.
+ _Out_writes_(cchChars) WCHAR *szOut, // output path for name.
int cchChars, // max chars for output path.
const WCHAR *szNameSpace, // Namespace.
const WCHAR *szName) // Name.
@@ -335,7 +335,7 @@ int ns::MakePath( // true ok, false truncation.
} // int ns::MakePath()
int ns::MakePath( // true ok, false truncation.
- __out_ecount(cchChars) LPUTF8 szOut, // output path for name.
+ _Out_writes_(cchChars) LPUTF8 szOut, // output path for name.
int cchChars, // max chars for output path.
LPCUTF8 szNameSpace, // Namespace.
LPCUTF8 szName) // Name.
@@ -378,7 +378,7 @@ int ns::MakePath( // true ok, false truncation.
} // int ns::MakePath()
int ns::MakePath( // true ok, false truncation.
- __out_ecount(cchChars) WCHAR *szOut, // output path for name.
+ _Out_writes_(cchChars) WCHAR *szOut, // output path for name.
int cchChars, // max chars for output path.
LPCUTF8 szNamespace, // Namespace.
LPCUTF8 szName) // Name.
@@ -513,7 +513,7 @@ void ns::MakePath( // throws on out of memory
}
bool ns::MakeAssemblyQualifiedName( // true ok, false truncation
- __out_ecount(dwBuffer) WCHAR* pBuffer, // Buffer to receive the results
+ _Out_writes_(dwBuffer) WCHAR* pBuffer, // Buffer to receive the results
int dwBuffer, // Number of characters total in buffer
const WCHAR *szTypeName, // Namespace for name.
int dwTypeName, // Number of characters (not including null)
@@ -621,7 +621,7 @@ int ns::MakeNestedTypeName( // true ok, false out of memory
} // int ns::MakeNestedTypeName()
int ns::MakeNestedTypeName( // true ok, false truncation.
- __out_ecount (cchChars) LPUTF8 szOut, // output path for name.
+ _Out_writes_ (cchChars) LPUTF8 szOut, // output path for name.
int cchChars, // max chars for output path.
LPCUTF8 szEnclosingName, // Full name for enclosing type
LPCUTF8 szNestedName) // Full name for nested type
diff --git a/src/coreclr/utilcode/posterror.cpp b/src/coreclr/utilcode/posterror.cpp
index 13cc9960990334..a39367477e0523 100644
--- a/src/coreclr/utilcode/posterror.cpp
+++ b/src/coreclr/utilcode/posterror.cpp
@@ -54,7 +54,7 @@ void SetResourceCultureCallbacks(
//*****************************************************************************
STDAPI UtilLoadStringRC(
UINT iResourceID,
- __out_ecount(iMax) LPWSTR szBuffer,
+ _Out_writes_(iMax) LPWSTR szBuffer,
int iMax,
int bQuiet
)
@@ -63,7 +63,7 @@ STDAPI UtilLoadStringRC(
return UtilLoadResourceString(bQuiet? CCompRC::Optional : CCompRC::Required,iResourceID, szBuffer, iMax);
}
-HRESULT UtilLoadResourceString(CCompRC::ResourceCategory eCategory, UINT iResourceID, __out_ecount (iMax) LPWSTR szBuffer, int iMax)
+HRESULT UtilLoadResourceString(CCompRC::ResourceCategory eCategory, UINT iResourceID, _Out_writes_ (iMax) LPWSTR szBuffer, int iMax)
{
CONTRACTL
{
@@ -98,7 +98,7 @@ HRESULT UtilLoadResourceString(CCompRC::ResourceCategory eCategory, UINT iResour
// Format a Runtime Error message.
//*****************************************************************************
HRESULT __cdecl FormatRuntimeErrorVa(
- __inout_ecount(cchMsg) WCHAR *rcMsg, // Buffer into which to format.
+ _Inout_updates_(cchMsg) WCHAR *rcMsg, // Buffer into which to format.
ULONG cchMsg, // Size of buffer, characters.
HRESULT hrRpt, // The HR to report.
va_list marker) // Optional args.
@@ -158,7 +158,7 @@ HRESULT __cdecl FormatRuntimeErrorVa(
// Format a Runtime Error message, varargs.
//*****************************************************************************
HRESULT __cdecl FormatRuntimeError(
- __out_ecount(cchMsg) WCHAR *rcMsg, // Buffer into which to format.
+ _Out_writes_(cchMsg) WCHAR *rcMsg, // Buffer into which to format.
ULONG cchMsg, // Size of buffer, characters.
HRESULT hrRpt, // The HR to report.
...) // Optional args.
diff --git a/src/coreclr/utilcode/splitpath.cpp b/src/coreclr/utilcode/splitpath.cpp
index b087e6cd3d1259..f5100ef72d3271 100644
--- a/src/coreclr/utilcode/splitpath.cpp
+++ b/src/coreclr/utilcode/splitpath.cpp
@@ -75,11 +75,11 @@ void SplitPath(
// A much more sensible version that just points to each section of the string.
//*******************************************************************************
void SplitPathInterior(
- __in LPCWSTR wszPath,
- __out_opt LPCWSTR *pwszDrive, __out_opt size_t *pcchDrive,
- __out_opt LPCWSTR *pwszDir, __out_opt size_t *pcchDir,
- __out_opt LPCWSTR *pwszFileName, __out_opt size_t *pcchFileName,
- __out_opt LPCWSTR *pwszExt, __out_opt size_t *pcchExt)
+ _In_ LPCWSTR wszPath,
+ _Out_opt_ LPCWSTR *pwszDrive, _Out_opt_ size_t *pcchDrive,
+ _Out_opt_ LPCWSTR *pwszDir, _Out_opt_ size_t *pcchDir,
+ _Out_opt_ LPCWSTR *pwszFileName, _Out_opt_ size_t *pcchFileName,
+ _Out_opt_ LPCWSTR *pwszExt, _Out_opt_ size_t *pcchExt)
{
LIMITED_METHOD_CONTRACT;
@@ -228,7 +228,7 @@ void SplitPathInterior(
*
*******************************************************************************/
-void SplitPath(__in SString const &path,
+void SplitPath(_In_ SString const &path,
__inout_opt SString *drive,
__inout_opt SString *dir,
__inout_opt SString *fname,
diff --git a/src/coreclr/utilcode/sstring.cpp b/src/coreclr/utilcode/sstring.cpp
index a0017a5a003fb4..6b5f7af901ac11 100644
--- a/src/coreclr/utilcode/sstring.cpp
+++ b/src/coreclr/utilcode/sstring.cpp
@@ -2708,7 +2708,7 @@ const WCHAR * SString::DacGetRawUnicode() const
// false if unsuccessful.
//
bool SString::DacGetUnicode(COUNT_T cBufChars,
- __out_z __inout_ecount(cBufChars) WCHAR * pBuffer,
+ _Inout_updates_z_(cBufChars) WCHAR * pBuffer,
COUNT_T * pcNeedChars) const
{
SUPPORTS_DAC;
diff --git a/src/coreclr/utilcode/stacktrace.cpp b/src/coreclr/utilcode/stacktrace.cpp
index dfa07a6d36b479..67126bcdc57d95 100644
--- a/src/coreclr/utilcode/stacktrace.cpp
+++ b/src/coreclr/utilcode/stacktrace.cpp
@@ -905,7 +905,7 @@ CONTEXT * pContext // @parm Context to start the stack trace at; null for curre
void GetStringFromAddr
(
DWORD_PTR dwAddr,
-__out_ecount(cchMaxAssertStackLevelStringLen) LPSTR szString // Place to put string.
+_Out_writes_(cchMaxAssertStackLevelStringLen) LPSTR szString // Place to put string.
// Buffer must hold at least cchMaxAssertStackLevelStringLen.
)
{
@@ -956,7 +956,7 @@ void MagicDeinit(void)
* support this, so we need it for CoreCLR 4, if we require Win2K support
****************************************************************************/
extern "C" __declspec(naked) void __stdcall
-ClrCaptureContext(__out PCONTEXT ctx)
+ClrCaptureContext(_Out_ PCONTEXT ctx)
{
__asm {
push ebx;
diff --git a/src/coreclr/utilcode/stgpoolreadonly.cpp b/src/coreclr/utilcode/stgpoolreadonly.cpp
index 439e9ca42d266a..3c9008bcf470a1 100644
--- a/src/coreclr/utilcode/stgpoolreadonly.cpp
+++ b/src/coreclr/utilcode/stgpoolreadonly.cpp
@@ -89,7 +89,7 @@ void StgPoolReadOnly::Uninit()
//*****************************************************************************
HRESULT StgPoolReadOnly::GetStringW( // Return code.
ULONG iOffset, // Offset of string in pool.
- __out_ecount(cchBuffer) LPWSTR szOut, // Output buffer for string.
+ _Out_writes_(cchBuffer) LPWSTR szOut, // Output buffer for string.
int cchBuffer) // Size of output buffer.
{
STATIC_CONTRACT_NOTHROW;
diff --git a/src/coreclr/utilcode/util.cpp b/src/coreclr/utilcode/util.cpp
index 5d1cdbca61fca6..afc0c057d3ee51 100644
--- a/src/coreclr/utilcode/util.cpp
+++ b/src/coreclr/utilcode/util.cpp
@@ -1338,7 +1338,7 @@ void ConfigString::init(const CLRConfig::ConfigStringInfo & info)
// MyAssembly;mscorlib;System
// MyAssembly;mscorlib System
-AssemblyNamesList::AssemblyNamesList(__in LPWSTR list)
+AssemblyNamesList::AssemblyNamesList(_In_ LPWSTR list)
{
CONTRACTL {
THROWS;
@@ -1430,7 +1430,7 @@ bool AssemblyNamesList::IsInList(LPCUTF8 assemblyName)
// "MyClass:foo2 MyClass:*" will match under _DEBUG
//
-void MethodNamesListBase::Insert(__in_z LPWSTR str)
+void MethodNamesListBase::Insert(_In_z_ LPWSTR str)
{
CONTRACTL {
THROWS;
@@ -3083,7 +3083,7 @@ namespace Reg
}
}
- HRESULT ReadStringValue(HKEY hKey, LPCWSTR wszSubKey, LPCWSTR wszName, __deref_out __deref_out_z LPWSTR* pwszValue)
+ HRESULT ReadStringValue(HKEY hKey, LPCWSTR wszSubKey, LPCWSTR wszName, _Outptr_ _Outptr_result_z_ LPWSTR* pwszValue)
{
CONTRACTL {
NOTHROW;
diff --git a/src/coreclr/utilcode/util_nodependencies.cpp b/src/coreclr/utilcode/util_nodependencies.cpp
index 9dae13a57d3118..650751af0d7e4f 100644
--- a/src/coreclr/utilcode/util_nodependencies.cpp
+++ b/src/coreclr/utilcode/util_nodependencies.cpp
@@ -341,7 +341,7 @@ void GetDebuggerSettingInfo(SString &ssDebuggerString, BOOL *pfAuto)
// * wszDebuggerString can be NULL. When wszDebuggerString is NULL, pcchDebuggerString should
// * point to a DWORD of zero. pcchDebuggerString cannot be NULL, and the DWORD pointed by
// * pcchDebuggerString will store the used or required string buffer size in characters.
-HRESULT GetDebuggerSettingInfoWorker(__out_ecount_part_opt(*pcchDebuggerString, *pcchDebuggerString) LPWSTR wszDebuggerString, DWORD * pcchDebuggerString, BOOL * pfAuto)
+HRESULT GetDebuggerSettingInfoWorker(_Out_writes_to_opt_(*pcchDebuggerString, *pcchDebuggerString) LPWSTR wszDebuggerString, DWORD * pcchDebuggerString, BOOL * pfAuto)
{
CONTRACTL
{
@@ -478,7 +478,7 @@ HRESULT GetDebuggerSettingInfoWorker(__out_ecount_part_opt(*pcchDebuggerString,
//*****************************************************************************
HRESULT GetStr(
DWORD hHexNum,
- __out_ecount((cbHexNum * 2)) LPWSTR szHexNum,
+ _Out_writes_((cbHexNum * 2)) LPWSTR szHexNum,
DWORD cbHexNum)
{
CONTRACTL
@@ -512,7 +512,7 @@ HRESULT GetStr(
int
GuidToLPWSTR(
GUID Guid, // The GUID to convert.
- __out_ecount(cchGuid) LPWSTR szGuid, // String into which the GUID is stored
+ _Out_writes_(cchGuid) LPWSTR szGuid, // String into which the GUID is stored
DWORD cchGuid) // Count in wchars
{
CONTRACTL
@@ -579,7 +579,7 @@ GuidToLPWSTR(
//*****************************************************************************
HRESULT GetHex(
DWORD * phHexNum,
- __in_ecount((cbHexNum * 2)) LPCWSTR szHexNum,
+ _In_reads_((cbHexNum * 2)) LPCWSTR szHexNum,
DWORD cbHexNum)
{
CONTRACTL
@@ -624,7 +624,7 @@ HRESULT GetHex(
BOOL
LPWSTRToGuid(
GUID * Guid, // [OUT] The GUID to fill in
- __in_ecount(cchGuid) LPCWSTR szGuid, // [IN] String to parse
+ _In_reads_(cchGuid) LPCWSTR szGuid, // [IN] String to parse
DWORD cchGuid) // [IN] Count in wchars in string
{
CONTRACTL
@@ -742,7 +742,7 @@ void ConfigDWORD::init(const CLRConfig::ConfigDWORDInfo & info)
// terminator); [out] Points to length in chars of trimmed substring (not
// counting null terminator)
//
-void TrimWhiteSpace(__deref_inout_ecount(*pcch) LPCWSTR *pwsz, __inout LPDWORD pcch)
+void TrimWhiteSpace(_Outptr_result_buffer_(*pcch) LPCWSTR *pwsz, __inout LPDWORD pcch)
{
LIMITED_METHOD_DAC_CONTRACT;
diff --git a/src/coreclr/vm/array.cpp b/src/coreclr/vm/array.cpp
index a8494c45d8ed6b..1088bacb6275b4 100644
--- a/src/coreclr/vm/array.cpp
+++ b/src/coreclr/vm/array.cpp
@@ -981,7 +981,7 @@ Stub *GenerateArrayOpStub(ArrayMethodDesc* pMD)
static const ILStubTypes stubTypes[3] = { ILSTUB_ARRAYOP_GET, ILSTUB_ARRAYOP_SET, ILSTUB_ARRAYOP_ADDRESS };
- _ASSERTE(pMD->GetArrayFuncIndex() <= COUNTOF(stubTypes));
+ _ASSERTE(pMD->GetArrayFuncIndex() <= ARRAY_SIZE(stubTypes));
NDirectStubFlags arrayOpStubFlag = (NDirectStubFlags)stubTypes[pMD->GetArrayFuncIndex()];
MethodDesc * pStubMD = ILStubCache::CreateAndLinkNewILStubMethodDesc(pMD->GetLoaderAllocator(),
diff --git a/src/coreclr/vm/callingconvention.h b/src/coreclr/vm/callingconvention.h
index 00cc47e9661d0c..1fe96fde98922f 100644
--- a/src/coreclr/vm/callingconvention.h
+++ b/src/coreclr/vm/callingconvention.h
@@ -694,9 +694,8 @@ class ArgIteratorTemplate : public ARGITERATOR_BASE
unsigned byteArgSize = GetArgSize();
- // Question: why do not arm and x86 have similar checks?
- // Composites greater than 16 bytes are passed by reference
- if ((GetArgType() == ELEMENT_TYPE_VALUETYPE) && (byteArgSize > ENREGISTERED_PARAMTYPE_MAXSIZE))
+ // On ARM64 some composites are implicitly passed by reference.
+ if (IsArgPassedByRef())
{
byteArgSize = TARGET_POINTER_SIZE;
}
diff --git a/src/coreclr/vm/ceeload.cpp b/src/coreclr/vm/ceeload.cpp
index e41efa704c72fd..72a2e1152210b8 100644
--- a/src/coreclr/vm/ceeload.cpp
+++ b/src/coreclr/vm/ceeload.cpp
@@ -3857,7 +3857,7 @@ MethodDesc *Module::FindMethod(mdToken pMethod)
#ifdef _DEBUG
CONTRACT_VIOLATION(ThrowsViolation);
char szMethodName [MAX_CLASSNAME_LENGTH];
- CEEInfo::findNameOfToken(this, pMethod, szMethodName, COUNTOF (szMethodName));
+ CEEInfo::findNameOfToken(this, pMethod, szMethodName, ARRAY_SIZE(szMethodName));
// This used to be IJW, but changed to LW_INTEROP to reclaim a bit in our log facilities
LOG((LF_INTEROP, LL_INFO10, "Failed to find Method: %s for Vtable Fixup\n", szMethodName));
#endif // _DEBUG
@@ -5765,7 +5765,7 @@ ExternalMethodBlobEntry::ExternalMethodBlobEntry(mdToken _nestedClass,
return static_cast(pEntry);
}
-static bool GetBasename(LPCWSTR _src, __out_ecount(dstlen) __out_z LPWSTR _dst, int dstlen)
+static bool GetBasename(LPCWSTR _src, _Out_writes_z_(dstlen) LPWSTR _dst, int dstlen)
{
LIMITED_METHOD_CONTRACT;
LPCWSTR src = _src;
diff --git a/src/coreclr/vm/ceemain.cpp b/src/coreclr/vm/ceemain.cpp
index 593b8ff3a83d60..a162022b901d3d 100644
--- a/src/coreclr/vm/ceemain.cpp
+++ b/src/coreclr/vm/ceemain.cpp
@@ -221,7 +221,7 @@
#include "genanalysis.h"
-static int GetThreadUICultureId(__out LocaleIDValue* pLocale); // TODO: This shouldn't use the LCID. We should rely on name instead
+static int GetThreadUICultureId(_Out_ LocaleIDValue* pLocale); // TODO: This shouldn't use the LCID. We should rely on name instead
static HRESULT GetThreadUICultureNames(__inout StringArrayList* pCultureNames);
@@ -2136,7 +2136,7 @@ INT32 GetLatchedExitCode (void)
// Impl for UtilLoadStringRC Callback: In VM, we let the thread decide culture
// Return an int uniquely describing which language this thread is using for ui.
// ---------------------------------------------------------------------------
-static int GetThreadUICultureId(__out LocaleIDValue* pLocale)
+static int GetThreadUICultureId(_Out_ LocaleIDValue* pLocale)
{
CONTRACTL{
NOTHROW;
diff --git a/src/coreclr/vm/classhash.cpp b/src/coreclr/vm/classhash.cpp
index 1974e7c3a26db1..28c636f7c9aadd 100644
--- a/src/coreclr/vm/classhash.cpp
+++ b/src/coreclr/vm/classhash.cpp
@@ -348,7 +348,7 @@ EEClassHashEntry_t *EEClassHashTable::InsertValue(LPCUTF8 pszNamespace, LPCUTF8
class ConstructKeyCallbackValidate : public EEClassHashTable::ConstructKeyCallback
{
public:
- virtual void UseKeys(__in_ecount(2) LPUTF8 *Key)
+ virtual void UseKeys(_In_reads_(2) LPUTF8 *Key)
{
LIMITED_METHOD_CONTRACT;
STATIC_CONTRACT_DEBUG_ONLY;
@@ -693,7 +693,7 @@ EEClassHashEntry_t * EEClassHashTable::GetValue(const NameHandle* pName, PTR_VOI
class ConstructKeyCallbackCompare : public EEClassHashTable::ConstructKeyCallback
{
public:
- virtual void UseKeys(__in_ecount(2) LPUTF8 *pKey1)
+ virtual void UseKeys(_In_reads_(2) LPUTF8 *pKey1)
{
LIMITED_METHOD_CONTRACT;
SUPPORTS_DAC;
@@ -757,7 +757,7 @@ BOOL EEClassHashTable::CompareKeys(PTR_EEClassHashEntry pEntry, LPCUTF8 * pKey2)
class ConstructKeyCallbackCaseInsensitive : public EEClassHashTable::ConstructKeyCallback
{
public:
- virtual void UseKeys(__in_ecount(2) LPUTF8 *key)
+ virtual void UseKeys(_In_reads_(2) LPUTF8 *key)
{
WRAPPER_NO_CONTRACT;
diff --git a/src/coreclr/vm/classhash.h b/src/coreclr/vm/classhash.h
index 4d8da2e7c22c61..4fd943165b4787 100644
--- a/src/coreclr/vm/classhash.h
+++ b/src/coreclr/vm/classhash.h
@@ -86,7 +86,7 @@ class EEClassHashTable : public DacEnumerableHashTable::GrowTable()
template
DWORD DacEnumerableHashTable::NextLargestPrime(DWORD dwNumber)
{
- for (DWORD i = 0; i < COUNTOF(g_rgPrimes); i++)
+ for (DWORD i = 0; i < ARRAY_SIZE(g_rgPrimes); i++)
if (g_rgPrimes[i] >= dwNumber)
{
dwNumber = g_rgPrimes[i];
diff --git a/src/coreclr/vm/dbginterface.h b/src/coreclr/vm/dbginterface.h
index 0a3e7d0520ce00..51b2c3bf36358f 100644
--- a/src/coreclr/vm/dbginterface.h
+++ b/src/coreclr/vm/dbginterface.h
@@ -263,8 +263,8 @@ class DebugInterface
virtual void SendLogSwitchSetting (int iLevel,
int iReason,
- __in_z LPCWSTR pLogSwitchName,
- __in_z LPCWSTR pParentSwitchName) = 0;
+ _In_z_ LPCWSTR pLogSwitchName,
+ _In_z_ LPCWSTR pParentSwitchName) = 0;
virtual bool IsLoggingEnabled (void) = 0;
@@ -374,7 +374,7 @@ class DebugInterface
virtual DWORD* GetJMCFlagAddr(Module * pModule) = 0;
// notification for SQL fiber debugging support
- virtual void CreateConnection(CONNID dwConnectionId, __in_z WCHAR *wzName) = 0;
+ virtual void CreateConnection(CONNID dwConnectionId, _In_z_ WCHAR *wzName) = 0;
virtual void DestroyConnection(CONNID dwConnectionId) = 0;
virtual void ChangeConnection(CONNID dwConnectionId) = 0;
diff --git a/src/coreclr/vm/debughelp.cpp b/src/coreclr/vm/debughelp.cpp
index 17e62fcdf7208b..822ee4a233fb40 100644
--- a/src/coreclr/vm/debughelp.cpp
+++ b/src/coreclr/vm/debughelp.cpp
@@ -337,7 +337,7 @@ MethodDesc* AsMethodDesc(size_t addr)
/*******************************************************************/
WCHAR* formatMethodTable(MethodTable* pMT,
- __out_z __inout_ecount(bufSize) WCHAR* buff,
+ _Inout_updates_z_(bufSize) WCHAR* buff,
DWORD bufSize)
{
CONTRACTL
@@ -377,7 +377,7 @@ WCHAR* formatMethodTable(MethodTable* pMT,
/*******************************************************************/
WCHAR* formatMethodDesc(MethodDesc* pMD,
- __out_z __inout_ecount(bufSize) WCHAR* buff,
+ _Inout_updates_z_(bufSize) WCHAR* buff,
DWORD bufSize)
{
CONTRACTL
@@ -1015,7 +1015,7 @@ void printfToDbgOut(const char* fmt, ...)
va_start(args, fmt);
char buffer[4096];
- _vsnprintf_s(buffer, COUNTOF(buffer), _TRUNCATE, fmt, args);
+ _vsnprintf_s(buffer, ARRAY_SIZE(buffer), _TRUNCATE, fmt, args);
va_end(args);
OutputDebugStringA( buffer );
diff --git a/src/coreclr/vm/dispatchinfo.cpp b/src/coreclr/vm/dispatchinfo.cpp
index 3b231c3882baa2..b026040ce0b201 100644
--- a/src/coreclr/vm/dispatchinfo.cpp
+++ b/src/coreclr/vm/dispatchinfo.cpp
@@ -197,7 +197,7 @@ void DispatchMemberInfo::Init()
EX_END_CATCH(RethrowTerminalExceptions);
}
-HRESULT DispatchMemberInfo::GetIDsOfParameters(__in_ecount(NumNames) WCHAR **astrNames, int NumNames, DISPID *aDispIds, BOOL bCaseSensitive)
+HRESULT DispatchMemberInfo::GetIDsOfParameters(_In_reads_(NumNames) WCHAR **astrNames, int NumNames, DISPID *aDispIds, BOOL bCaseSensitive)
{
CONTRACTL
{
diff --git a/src/coreclr/vm/dispatchinfo.h b/src/coreclr/vm/dispatchinfo.h
index c109741eea6dda..623a56c7ab0c5e 100644
--- a/src/coreclr/vm/dispatchinfo.h
+++ b/src/coreclr/vm/dispatchinfo.h
@@ -68,7 +68,7 @@ struct DispatchMemberInfo
}
// This method retrieves the ID's of the specified names.
- HRESULT GetIDsOfParameters(__in_ecount(NumNames) WCHAR **astrNames, int NumNames, DISPID *aDispIds, BOOL bCaseSensitive);
+ HRESULT GetIDsOfParameters(_In_reads_(NumNames) WCHAR **astrNames, int NumNames, DISPID *aDispIds, BOOL bCaseSensitive);
// Accessors.
PTRARRAYREF GetParameters();
diff --git a/src/coreclr/vm/dwbucketmanager.hpp b/src/coreclr/vm/dwbucketmanager.hpp
index 9731b2081c92d6..2524f706c7ef3f 100644
--- a/src/coreclr/vm/dwbucketmanager.hpp
+++ b/src/coreclr/vm/dwbucketmanager.hpp
@@ -156,7 +156,7 @@ class BytesToBase32
WCHAR GetNextChar();
BOOL MoreChars() { LIMITED_METHOD_CONTRACT; return pData < pEnd; }
- int Convert(__inout_ecount(nOut) LPWSTR pOut, int nOut);
+ int Convert(_Inout_updates_(nOut) LPWSTR pOut, int nOut);
};
// This table tells how to pick out 5-bits at a time (8 times) from 5-bytes of data.
@@ -265,7 +265,7 @@ WCHAR BytesToBase32::GetNextChar()
//
//------------------------------------------------------------------------------
int BytesToBase32::Convert(
- __inout_ecount(nOut) LPWSTR pOut,
+ _Inout_updates_(nOut) LPWSTR pOut,
int nOut)
{
WRAPPER_NO_CONTRACT;
@@ -304,32 +304,32 @@ class BaseBucketParamsManager
bool IsCodeContractsFrame(MethodDesc* pMD);
OBJECTREF GetRealExceptionObject();
WCHAR* GetParamBufferForIndex(BucketParameterIndex paramIndex);
- void LogParam(__in_z LPCWSTR paramValue, BucketParameterIndex paramIndex);
+ void LogParam(_In_z_ LPCWSTR paramValue, BucketParameterIndex paramIndex);
protected:
~BaseBucketParamsManager();
- typedef void (BaseBucketParamsManager::*DataPopulatorFunction)(__out_ecount(maxLength) WCHAR* targetParam, int maxLength);
+ typedef void (BaseBucketParamsManager::*DataPopulatorFunction)(_Out_writes_(maxLength) WCHAR* targetParam, int maxLength);
void PopulateBucketParameter(BucketParameterIndex paramIndex, DataPopulatorFunction pFnDataPopulator, int maxLength);
void PopulateEventName(LPCWSTR eventTypeName);
// functions for retrieving data to go into various bucket parameters
- void GetAppName(__out_ecount(maxLength) WCHAR* targetParam, int maxLength);
- void GetAppVersion(__out_ecount(maxLength) WCHAR* targetParam, int maxLength);
- void GetAppTimeStamp(__out_ecount(maxLength) WCHAR* targetParam, int maxLength);
- void GetModuleName(__out_ecount(maxLength) WCHAR* targetParam, int maxLength);
- void GetModuleVersion(__out_ecount(maxLength) WCHAR* targetParam, int maxLength);
- void GetModuleTimeStamp(__out_ecount(maxLength) WCHAR* targetParam, int maxLength);
- void GetMethodDef(__out_ecount(maxLength) WCHAR* targetParam, int maxLength);
- void GetIlOffset(__out_ecount(maxLength) WCHAR* targetParam, int maxLength);
- void GetExceptionName(__out_ecount(maxLength) WCHAR* targetParam, int maxLength);
- void GetPackageMoniker(__out_ecount(maxLength) WCHAR* targetParam, int maxLength);
- void GetPRAID(__out_ecount(maxLength) WCHAR* targetParam, int maxLength);
- void GetIlRva(__out_ecount(maxLength) WCHAR* targetParam, int maxLength);
+ void GetAppName(_Out_writes_(maxLength) WCHAR* targetParam, int maxLength);
+ void GetAppVersion(_Out_writes_(maxLength) WCHAR* targetParam, int maxLength);
+ void GetAppTimeStamp(_Out_writes_(maxLength) WCHAR* targetParam, int maxLength);
+ void GetModuleName(_Out_writes_(maxLength) WCHAR* targetParam, int maxLength);
+ void GetModuleVersion(_Out_writes_(maxLength) WCHAR* targetParam, int maxLength);
+ void GetModuleTimeStamp(_Out_writes_(maxLength) WCHAR* targetParam, int maxLength);
+ void GetMethodDef(_Out_writes_(maxLength) WCHAR* targetParam, int maxLength);
+ void GetIlOffset(_Out_writes_(maxLength) WCHAR* targetParam, int maxLength);
+ void GetExceptionName(_Out_writes_(maxLength) WCHAR* targetParam, int maxLength);
+ void GetPackageMoniker(_Out_writes_(maxLength) WCHAR* targetParam, int maxLength);
+ void GetPRAID(_Out_writes_(maxLength) WCHAR* targetParam, int maxLength);
+ void GetIlRva(_Out_writes_(maxLength) WCHAR* targetParam, int maxLength);
public:
BaseBucketParamsManager(GenericModeBlock* pGenericModeBlock, TypeOfReportedError typeOfError, PCODE initialFaultingPc, Thread* pFaultingThread, OBJECTREF* pThrownException);
- static int CopyStringToBucket(__out_ecount(targetMaxLength) LPWSTR pTargetParam, int targetMaxLength, __in_z LPCWSTR pSource, bool cannonicalize = false);
+ static int CopyStringToBucket(_Out_writes_(targetMaxLength) LPWSTR pTargetParam, int targetMaxLength, _In_z_ LPCWSTR pSource, bool cannonicalize = false);
// function that consumers should call to populate the GMB
virtual void PopulateBucketParameters() = 0;
};
@@ -441,7 +441,7 @@ void BaseBucketParamsManager::PopulateBucketParameter(BucketParameterIndex param
LogParam(targetParam, paramIndex);
}
-void BaseBucketParamsManager::GetAppName(__out_ecount(maxLength) WCHAR* targetParam, int maxLength)
+void BaseBucketParamsManager::GetAppName(_Out_writes_(maxLength) WCHAR* targetParam, int maxLength)
{
CONTRACTL
{
@@ -465,7 +465,7 @@ void BaseBucketParamsManager::GetAppName(__out_ecount(maxLength) WCHAR* targetPa
}
}
-void BaseBucketParamsManager::GetAppVersion(__out_ecount(maxLength) WCHAR* targetParam, int maxLength)
+void BaseBucketParamsManager::GetAppVersion(_Out_writes_(maxLength) WCHAR* targetParam, int maxLength)
{
CONTRACTL
{
@@ -500,7 +500,7 @@ void BaseBucketParamsManager::GetAppVersion(__out_ecount(maxLength) WCHAR* targe
}
}
-void BaseBucketParamsManager::GetAppTimeStamp(__out_ecount(maxLength) WCHAR* targetParam, int maxLength)
+void BaseBucketParamsManager::GetAppTimeStamp(_Out_writes_(maxLength) WCHAR* targetParam, int maxLength)
{
CONTRACTL
{
@@ -532,7 +532,7 @@ void BaseBucketParamsManager::GetAppTimeStamp(__out_ecount(maxLength) WCHAR* tar
EX_END_CATCH(SwallowAllExceptions)
}
-void BaseBucketParamsManager::GetModuleName(__out_ecount(maxLength) WCHAR* targetParam, int maxLength)
+void BaseBucketParamsManager::GetModuleName(_Out_writes_(maxLength) WCHAR* targetParam, int maxLength)
{
CONTRACTL
{
@@ -622,7 +622,7 @@ void BaseBucketParamsManager::GetModuleName(__out_ecount(maxLength) WCHAR* targe
}
}
-void BaseBucketParamsManager::GetModuleVersion(__out_ecount(maxLength) WCHAR* targetParam, int maxLength)
+void BaseBucketParamsManager::GetModuleVersion(_Out_writes_(maxLength) WCHAR* targetParam, int maxLength)
{
CONTRACTL
{
@@ -678,7 +678,7 @@ void BaseBucketParamsManager::GetModuleVersion(__out_ecount(maxLength) WCHAR* ta
}
}
-void BaseBucketParamsManager::GetModuleTimeStamp(__out_ecount(maxLength) WCHAR* targetParam, int maxLength)
+void BaseBucketParamsManager::GetModuleTimeStamp(_Out_writes_(maxLength) WCHAR* targetParam, int maxLength)
{
CONTRACTL
{
@@ -731,7 +731,7 @@ void BaseBucketParamsManager::GetModuleTimeStamp(__out_ecount(maxLength) WCHAR*
}
}
-void BaseBucketParamsManager::GetMethodDef(__out_ecount(maxLength) WCHAR* targetParam, int maxLength)
+void BaseBucketParamsManager::GetMethodDef(_Out_writes_(maxLength) WCHAR* targetParam, int maxLength)
{
CONTRACTL
{
@@ -756,7 +756,7 @@ void BaseBucketParamsManager::GetMethodDef(__out_ecount(maxLength) WCHAR* target
}
}
-void BaseBucketParamsManager::GetIlOffset(__out_ecount(maxLength) WCHAR* targetParam, int maxLength)
+void BaseBucketParamsManager::GetIlOffset(_Out_writes_(maxLength) WCHAR* targetParam, int maxLength)
{
CONTRACTL
{
@@ -775,7 +775,7 @@ void BaseBucketParamsManager::GetIlOffset(__out_ecount(maxLength) WCHAR* targetP
ilOffset);
}
-void BaseBucketParamsManager::GetExceptionName(__out_ecount(maxLength) WCHAR* targetParam, int maxLength)
+void BaseBucketParamsManager::GetExceptionName(_Out_writes_(maxLength) WCHAR* targetParam, int maxLength)
{
CONTRACTL
{
@@ -845,7 +845,7 @@ void BaseBucketParamsManager::GetExceptionName(__out_ecount(maxLength) WCHAR* ta
}
}
-void BaseBucketParamsManager::GetPackageMoniker(__out_ecount(maxLength) WCHAR* targetParam, int maxLength)
+void BaseBucketParamsManager::GetPackageMoniker(_Out_writes_(maxLength) WCHAR* targetParam, int maxLength)
{
CONTRACTL
{
@@ -858,7 +858,7 @@ void BaseBucketParamsManager::GetPackageMoniker(__out_ecount(maxLength) WCHAR* t
_ASSERTE(!"AppX support NYI for CoreCLR");
}
-void BaseBucketParamsManager::GetPRAID(__out_ecount(maxLength) WCHAR* targetParam, int maxLength)
+void BaseBucketParamsManager::GetPRAID(_Out_writes_(maxLength) WCHAR* targetParam, int maxLength)
{
CONTRACTL
{
@@ -871,7 +871,7 @@ void BaseBucketParamsManager::GetPRAID(__out_ecount(maxLength) WCHAR* targetPara
_ASSERTE(!"PRAID support NYI for CoreCLR");
}
-void BaseBucketParamsManager::GetIlRva(__out_ecount(maxLength) WCHAR* targetParam, int maxLength)
+void BaseBucketParamsManager::GetIlRva(_Out_writes_(maxLength) WCHAR* targetParam, int maxLength)
{
CONTRACTL
{
@@ -1070,7 +1070,7 @@ OBJECTREF BaseBucketParamsManager::GetRealExceptionObject()
// because that is what a SHA1 hash coded in base32 will require.
// - the maxlen does not include the terminating nul.
//------------------------------------------------------------------------------
-int BaseBucketParamsManager::CopyStringToBucket(__out_ecount(targetMaxLength) LPWSTR pTargetParam, int targetMaxLength, __in_z LPCWSTR pSource, bool cannonicalize)
+int BaseBucketParamsManager::CopyStringToBucket(_Out_writes_(targetMaxLength) LPWSTR pTargetParam, int targetMaxLength, _In_z_ LPCWSTR pSource, bool cannonicalize)
{
CONTRACTL
{
@@ -1142,7 +1142,7 @@ int BaseBucketParamsManager::CopyStringToBucket(__out_ecount(targetMaxLength) LP
return targLen;
}
-void BaseBucketParamsManager::LogParam(__in_z LPCWSTR paramValue, BucketParameterIndex paramIndex)
+void BaseBucketParamsManager::LogParam(_In_z_ LPCWSTR paramValue, BucketParameterIndex paramIndex)
{
#ifdef _DEBUG
LIMITED_METHOD_CONTRACT;
diff --git a/src/coreclr/vm/dwreport.cpp b/src/coreclr/vm/dwreport.cpp
index 228e1d029cd5ea..1032725eb854b3 100644
--- a/src/coreclr/vm/dwreport.cpp
+++ b/src/coreclr/vm/dwreport.cpp
@@ -179,7 +179,7 @@ BOOL RegisterOutOfProcessWatsonCallbacks()
//------------------------------------------------------------------------------
// Description
HRESULT DwGetFileVersionInfo(
- __in_z LPCWSTR wszFilePath,
+ _In_z_ LPCWSTR wszFilePath,
USHORT& major,
USHORT& minor,
USHORT& build,
@@ -222,7 +222,7 @@ HRESULT DwGetFileVersionInfo(
// None
//------------------------------------------------------------------------------
int DwGetAppDescription( // Number of characters written.
- __in_z LPCWSTR wszFilePath, // Path to the executable.
+ _In_z_ LPCWSTR wszFilePath, // Path to the executable.
SString& pBuf // Put description here.
) // Size of buf, wide chars.
{
@@ -354,8 +354,8 @@ int DwGetAppDescription( // Number of characters written.
// None
//------------------------------------------------------------------------------
int DwGetAssemblyVersion( // Number of characters written.
- __in_z LPCWSTR wszFilePath, // Path to the executable.
- __inout_ecount(cchBuf) WCHAR *pBuf, // Put description here.
+ _In_z_ LPCWSTR wszFilePath, // Path to the executable.
+ _Inout_updates_(cchBuf) WCHAR *pBuf, // Put description here.
int cchBuf) // Size of buf, wide chars.
{
CONTRACTL
@@ -551,7 +551,7 @@ UINT_PTR GetIPOfThrowSite(
// false -- otherwise.
//
//------------------------------------------------------------------------------
-BOOL ContainsUnicodeChars(__in_z LPCWSTR wsz)
+BOOL ContainsUnicodeChars(_In_z_ LPCWSTR wsz)
{
LIMITED_METHOD_CONTRACT;
@@ -888,19 +888,19 @@ HRESULT GetBucketParametersForCurrentException(
if (hr == S_OK)
{
// Event type name.
- wcsncpy_s(pParams->pszEventTypeName, COUNTOF(pParams->pszEventTypeName), gmb.wzEventTypeName, _TRUNCATE);
+ wcsncpy_s(pParams->pszEventTypeName, ARRAY_SIZE(pParams->pszEventTypeName), gmb.wzEventTypeName, _TRUNCATE);
// Buckets. Mind the 1-based vs 0-based.
- wcsncpy_s(pParams->pszParams[0], COUNTOF(pParams->pszParams[0]), gmb.wzP1, _TRUNCATE);
- wcsncpy_s(pParams->pszParams[1], COUNTOF(pParams->pszParams[1]), gmb.wzP2, _TRUNCATE);
- wcsncpy_s(pParams->pszParams[2], COUNTOF(pParams->pszParams[2]), gmb.wzP3, _TRUNCATE);
- wcsncpy_s(pParams->pszParams[3], COUNTOF(pParams->pszParams[3]), gmb.wzP4, _TRUNCATE);
- wcsncpy_s(pParams->pszParams[4], COUNTOF(pParams->pszParams[4]), gmb.wzP5, _TRUNCATE);
- wcsncpy_s(pParams->pszParams[5], COUNTOF(pParams->pszParams[5]), gmb.wzP6, _TRUNCATE);
- wcsncpy_s(pParams->pszParams[6], COUNTOF(pParams->pszParams[6]), gmb.wzP7, _TRUNCATE);
- wcsncpy_s(pParams->pszParams[7], COUNTOF(pParams->pszParams[7]), gmb.wzP8, _TRUNCATE);
- wcsncpy_s(pParams->pszParams[8], COUNTOF(pParams->pszParams[8]), gmb.wzP9, _TRUNCATE);
- wcsncpy_s(pParams->pszParams[9], COUNTOF(pParams->pszParams[9]), gmb.wzP10, _TRUNCATE);
+ wcsncpy_s(pParams->pszParams[0], ARRAY_SIZE(pParams->pszParams[0]), gmb.wzP1, _TRUNCATE);
+ wcsncpy_s(pParams->pszParams[1], ARRAY_SIZE(pParams->pszParams[1]), gmb.wzP2, _TRUNCATE);
+ wcsncpy_s(pParams->pszParams[2], ARRAY_SIZE(pParams->pszParams[2]), gmb.wzP3, _TRUNCATE);
+ wcsncpy_s(pParams->pszParams[3], ARRAY_SIZE(pParams->pszParams[3]), gmb.wzP4, _TRUNCATE);
+ wcsncpy_s(pParams->pszParams[4], ARRAY_SIZE(pParams->pszParams[4]), gmb.wzP5, _TRUNCATE);
+ wcsncpy_s(pParams->pszParams[5], ARRAY_SIZE(pParams->pszParams[5]), gmb.wzP6, _TRUNCATE);
+ wcsncpy_s(pParams->pszParams[6], ARRAY_SIZE(pParams->pszParams[6]), gmb.wzP7, _TRUNCATE);
+ wcsncpy_s(pParams->pszParams[7], ARRAY_SIZE(pParams->pszParams[7]), gmb.wzP8, _TRUNCATE);
+ wcsncpy_s(pParams->pszParams[8], ARRAY_SIZE(pParams->pszParams[8]), gmb.wzP9, _TRUNCATE);
+ wcsncpy_s(pParams->pszParams[9], ARRAY_SIZE(pParams->pszParams[9]), gmb.wzP10, _TRUNCATE);
// All good.
pParams->fInited = TRUE;
diff --git a/src/coreclr/vm/dwreport.h b/src/coreclr/vm/dwreport.h
index 485eb7cfdf9152..821213ec9df565 100644
--- a/src/coreclr/vm/dwreport.h
+++ b/src/coreclr/vm/dwreport.h
@@ -55,18 +55,18 @@ BOOL IsWatsonEnabled();
BOOL RegisterOutOfProcessWatsonCallbacks();
int DwGetAssemblyVersion( // Number of characters written.
- __in_z LPCWSTR wszFilePath, // Path to the executable.
- __inout_ecount(cchBuf) WCHAR *pBuf, // Put description here.
+ _In_z_ LPCWSTR wszFilePath, // Path to the executable.
+ _Inout_updates_(cchBuf) WCHAR *pBuf, // Put description here.
int cchBuf);
HRESULT DwGetFileVersionInfo( // S_OK or error
- __in_z LPCWSTR wszFilePath, // Path to the executable.
+ _In_z_ LPCWSTR wszFilePath, // Path to the executable.
USHORT& major,
USHORT& minor,
USHORT& build,
USHORT& revision);
-BOOL ContainsUnicodeChars(__in_z LPCWSTR wsz);
+BOOL ContainsUnicodeChars(_In_z_ LPCWSTR wsz);
// Proxy parameters for Resetting Watson buckets
struct ResetWatsonBucketsParams
diff --git a/src/coreclr/vm/eeconfig.cpp b/src/coreclr/vm/eeconfig.cpp
index 17ecf961879bf3..43378f1700d4e5 100644
--- a/src/coreclr/vm/eeconfig.cpp
+++ b/src/coreclr/vm/eeconfig.cpp
@@ -818,7 +818,7 @@ bool EEConfig::ExcludeReadyToRun(LPCUTF8 assemblyName) const
// Ownership of the string buffer passes to ParseMethList
/* static */
-HRESULT EEConfig::ParseMethList(__in_z LPWSTR str, MethodNamesList** out) {
+HRESULT EEConfig::ParseMethList(_In_z_ LPWSTR str, MethodNamesList** out) {
CONTRACTL {
NOTHROW;
GC_NOTRIGGER;
@@ -899,7 +899,7 @@ bool EEConfig::IsInMethList(MethodNamesList* list, MethodDesc* pMD)
// Ownership of the string buffer passes to ParseTypeList
/* static */
-HRESULT EEConfig::ParseTypeList(__in_z LPWSTR str, TypeNamesList** out)
+HRESULT EEConfig::ParseTypeList(_In_z_ LPWSTR str, TypeNamesList** out)
{
CONTRACTL {
NOTHROW;
@@ -980,7 +980,7 @@ bool EEConfig::RegexOrExactMatch(LPCUTF8 regex, LPCUTF8 input)
return strcmp(regex, input) == 0;
}
-HRESULT TypeNamesList::Init(__in_z LPCWSTR str)
+HRESULT TypeNamesList::Init(_In_z_ LPCWSTR str)
{
CONTRACTL {
NOTHROW;
diff --git a/src/coreclr/vm/eeconfig.h b/src/coreclr/vm/eeconfig.h
index 05eb839c241738..d06e592eaff858 100644
--- a/src/coreclr/vm/eeconfig.h
+++ b/src/coreclr/vm/eeconfig.h
@@ -35,7 +35,7 @@ class TypeNamesList
TypeNamesList();
~TypeNamesList();
- HRESULT Init(__in_z LPCWSTR str);
+ HRESULT Init(_In_z_ LPCWSTR str);
bool IsInList(LPCUTF8 typeName);
};
#endif
@@ -244,7 +244,7 @@ class EEConfig
} CONTRACTL_END
return RegexOrExactMatch(pszBreakOnStructMarshalSetup, className);
}
- static HRESULT ParseTypeList(__in_z LPWSTR str, TypeNamesList** out);
+ static HRESULT ParseTypeList(_In_z_ LPWSTR str, TypeNamesList** out);
static void DestroyTypeList(TypeNamesList* list);
inline bool ShouldGcCoverageOnMethod(LPCUTF8 methodName) const
@@ -491,7 +491,7 @@ class EEConfig
bool m_fInteropLogArguments; // Log all pinned arguments passed to an interop call
#ifdef _DEBUG
- static HRESULT ParseMethList(__in_z LPWSTR str, MethodNamesList* * out);
+ static HRESULT ParseMethList(_In_z_ LPWSTR str, MethodNamesList* * out);
static void DestroyMethList(MethodNamesList* list);
static bool IsInMethList(MethodNamesList* list, MethodDesc* pMD);
diff --git a/src/coreclr/vm/eecontract.cpp b/src/coreclr/vm/eecontract.cpp
index c0b6830b2ba21f..a6e9972fb4e523 100644
--- a/src/coreclr/vm/eecontract.cpp
+++ b/src/coreclr/vm/eecontract.cpp
@@ -22,7 +22,7 @@ void EEContract::Disable()
BaseContract::Disable();
}
-void EEContract::DoChecks(UINT testmask, __in_z const char *szFunction, __in_z const char *szFile, int lineNum)
+void EEContract::DoChecks(UINT testmask, _In_z_ const char *szFunction, _In_z_ const char *szFile, int lineNum)
{
SCAN_IGNORE_THROW; // Tell the static contract analyzer to ignore contract violations
SCAN_IGNORE_FAULT; // due to the contract checking logic itself.
diff --git a/src/coreclr/vm/eecontract.h b/src/coreclr/vm/eecontract.h
index 61adea1dc80ba3..4df0c6f8fcaf5b 100644
--- a/src/coreclr/vm/eecontract.h
+++ b/src/coreclr/vm/eecontract.h
@@ -40,7 +40,7 @@ class EEContract : public BaseContract
}
void Disable();
- void DoChecks(UINT testmask, __in_z const char *szFunction, __in_z const char *szFile, int lineNum);
+ void DoChecks(UINT testmask, _In_z_ const char *szFunction, _In_z_ const char *szFile, int lineNum);
};
diff --git a/src/coreclr/vm/eepolicy.cpp b/src/coreclr/vm/eepolicy.cpp
index b9084568144076..c085315499253b 100644
--- a/src/coreclr/vm/eepolicy.cpp
+++ b/src/coreclr/vm/eepolicy.cpp
@@ -185,8 +185,8 @@ void EEPolicy::HandleExitProcess(ShutdownCompleteAction sca)
//---------------------------------------------------------------------------------------
// This class is responsible for displaying a stack trace. It uses a condensed way for
// stack overflow stack traces where there are possibly many repeated frames.
-// It displays a count and a repeated sequence of frames at the top of the stack in
-// such a case, instead of displaying possibly thousands of lines with the same
+// It displays a count and a repeated sequence of frames at the top of the stack in
+// such a case, instead of displaying possibly thousands of lines with the same
// method.
//---------------------------------------------------------------------------------------
class CallStackLogger
@@ -291,7 +291,7 @@ class CallStackLogger
for (int i = m_largestCommonStartLength * m_largestCommonStartRepeat; i < m_frames.Count(); i++)
{
PrintFrame(i, pWordAt);
- }
+ }
}
};
@@ -412,7 +412,7 @@ void LogInfoForFatalError(UINT exitCode, LPCWSTR pszMessage, LPCWSTR errorSource
{
}
EX_END_CATCH(SwallowAllExceptions)
-
+
InterlockedCompareExchangeT(&s_pCrashingThread, FatalErrorLoggingFinished, pThread);
}
@@ -484,7 +484,7 @@ void EEPolicy::LogFatalError(UINT exitCode, UINT_PTR address, LPCWSTR pszMessage
InlineSString<80> ssMessage;
InlineSString<80> ssErrorFormat;
if(!ssErrorFormat.LoadResource(CCompRC::Optional, IDS_ER_UNMANAGEDFAILFASTMSG ))
- ssErrorFormat.Set(W("at IP %1 (%2) with exit code %3."));
+ ssErrorFormat.Set(W("at IP 0x%x (0x%x) with exit code 0x%x."));
SmallStackSString addressString;
addressString.Printf(W("%p"), pExceptionInfo? (UINT_PTR)pExceptionInfo->ExceptionRecord->ExceptionAddress : address);
diff --git a/src/coreclr/vm/eetoprofinterfaceimpl.cpp b/src/coreclr/vm/eetoprofinterfaceimpl.cpp
index cfe62645dcbd26..0944ce115d21b9 100644
--- a/src/coreclr/vm/eetoprofinterfaceimpl.cpp
+++ b/src/coreclr/vm/eetoprofinterfaceimpl.cpp
@@ -254,8 +254,8 @@ inline void SetProfilerCallbacksAllowedForThread(Thread * pThread, BOOL fValue)
static HRESULT CoCreateProfiler(
const CLSID * pClsid,
- __in_z LPCWSTR wszClsid,
- __in_z LPCWSTR wszProfileDLL,
+ _In_z_ LPCWSTR wszClsid,
+ _In_z_ LPCWSTR wszProfileDLL,
ICorProfilerCallback2 ** ppCallback,
HMODULE * phmodProfilerDLL)
{
@@ -500,8 +500,8 @@ EEToProfInterfaceImpl::EEToProfInterfaceImpl() :
HRESULT EEToProfInterfaceImpl::Init(
ProfToEEInterfaceImpl * pProfToEE,
const CLSID * pClsid,
- __in_z LPCWSTR wszClsid,
- __in_z LPCWSTR wszProfileDLL,
+ _In_z_ LPCWSTR wszClsid,
+ _In_z_ LPCWSTR wszProfileDLL,
BOOL fLoadedViaAttach,
DWORD dwConcurrentGCWaitTimeoutInMs)
{
@@ -644,8 +644,8 @@ void EEToProfInterfaceImpl::SetProfilerInfo(ProfilerInfo *pProfilerInfo)
HRESULT EEToProfInterfaceImpl::CreateProfiler(
const CLSID * pClsid,
- __in_z LPCWSTR wszClsid,
- __in_z LPCWSTR wszProfileDLL)
+ _In_z_ LPCWSTR wszClsid,
+ _In_z_ LPCWSTR wszProfileDLL)
{
CONTRACTL
{
@@ -3034,7 +3034,7 @@ HRESULT EEToProfInterfaceImpl::ThreadAssignedToOSThread(ThreadID managedThreadId
HRESULT EEToProfInterfaceImpl::ThreadNameChanged(ThreadID managedThreadId,
ULONG cchName,
- __in_ecount_opt(cchName) WCHAR name[])
+ _In_reads_bytes_opt_(cchName) WCHAR name[])
{
CONTRACTL
{
diff --git a/src/coreclr/vm/eetoprofinterfaceimpl.h b/src/coreclr/vm/eetoprofinterfaceimpl.h
index e1259c6c7d7e1a..dd11a48abedb0c 100644
--- a/src/coreclr/vm/eetoprofinterfaceimpl.h
+++ b/src/coreclr/vm/eetoprofinterfaceimpl.h
@@ -49,7 +49,7 @@ class EEToProfInterfaceImpl
ProfToEEInterfaceImpl * pProfToEE,
const CLSID * pClsid,
__inout_z LPCWSTR wszClsid,
- __in_z LPCWSTR wszProfileDLL,
+ _In_z_ LPCWSTR wszProfileDLL,
BOOL fLoadedViaAttach,
DWORD dwConcurrentGCWaitTimeoutInMs);
@@ -144,7 +144,7 @@ class EEToProfInterfaceImpl
HRESULT ThreadNameChanged(ThreadID managedThreadId,
ULONG cchName,
- __in_ecount_opt(cchName) WCHAR name[]);
+ _In_reads_bytes_opt_(cchName) WCHAR name[]);
//
// Startup/Shutdown Events
@@ -611,8 +611,8 @@ class EEToProfInterfaceImpl
HRESULT CreateProfiler(
const CLSID * pClsid,
- __in_z LPCWSTR wszClsid,
- __in_z LPCWSTR wszProfileDLL);
+ _In_z_ LPCWSTR wszClsid,
+ _In_z_ LPCWSTR wszProfileDLL);
HRESULT DetermineAndSetEnterLeaveFunctionHooksForJit();
diff --git a/src/coreclr/vm/eventpipeinternal.cpp b/src/coreclr/vm/eventpipeinternal.cpp
index d759a1e0f1accc..e3debbf276649a 100644
--- a/src/coreclr/vm/eventpipeinternal.cpp
+++ b/src/coreclr/vm/eventpipeinternal.cpp
@@ -12,7 +12,7 @@
#ifdef FEATURE_PERFTRACING
extern "C" UINT64 QCALLTYPE EventPipeInternal_Enable(
- __in_z LPCWSTR outputFile,
+ _In_z_ LPCWSTR outputFile,
EventPipeSerializationFormat format,
UINT32 circularBufferSizeInMB,
/* COR_PRF_EVENTPIPE_PROVIDER_CONFIG */ LPCVOID pProviders,
@@ -84,7 +84,7 @@ extern "C" bool QCALLTYPE EventPipeInternal_GetSessionInfo(UINT64 sessionID, Eve
}
extern "C" INT_PTR QCALLTYPE EventPipeInternal_CreateProvider(
- __in_z LPCWSTR providerName,
+ _In_z_ LPCWSTR providerName,
EventPipeCallback pCallbackFunc)
{
QCALL_CONTRACT;
@@ -125,7 +125,7 @@ extern "C" INT_PTR QCALLTYPE EventPipeInternal_DefineEvent(
return reinterpret_cast(pEvent);
}
-extern "C" INT_PTR QCALLTYPE EventPipeInternal_GetProvider(__in_z LPCWSTR providerName)
+extern "C" INT_PTR QCALLTYPE EventPipeInternal_GetProvider(_In_z_ LPCWSTR providerName)
{
QCALL_CONTRACT;
diff --git a/src/coreclr/vm/eventpipeinternal.h b/src/coreclr/vm/eventpipeinternal.h
index 33fdc0e64cd238..bf57fed8b5acf3 100644
--- a/src/coreclr/vm/eventpipeinternal.h
+++ b/src/coreclr/vm/eventpipeinternal.h
@@ -40,7 +40,7 @@ struct EventPipeSessionInfo
//! Sets the sampling rate and enables the event pipe for the specified configuration.
//!
extern "C" UINT64 QCALLTYPE EventPipeInternal_Enable(
- __in_z LPCWSTR outputFile,
+ _In_z_ LPCWSTR outputFile,
EventPipeSerializationFormat format,
UINT32 circularBufferSizeInMB,
/* COR_PRF_EVENTPIPE_PROVIDER_CONFIG */ LPCVOID pProviders,
@@ -54,7 +54,7 @@ extern "C" void QCALLTYPE EventPipeInternal_Disable(UINT64 sessionID);
extern "C" bool QCALLTYPE EventPipeInternal_GetSessionInfo(UINT64 sessionID, EventPipeSessionInfo *pSessionInfo);
extern "C" INT_PTR QCALLTYPE EventPipeInternal_CreateProvider(
- __in_z LPCWSTR providerName,
+ _In_z_ LPCWSTR providerName,
EventPipeCallback pCallbackFunc);
extern "C" INT_PTR QCALLTYPE EventPipeInternal_DefineEvent(
@@ -67,7 +67,7 @@ extern "C" INT_PTR QCALLTYPE EventPipeInternal_DefineEvent(
UINT32 metadataLength);
extern "C" INT_PTR QCALLTYPE EventPipeInternal_GetProvider(
- __in_z LPCWSTR providerName);
+ _In_z_ LPCWSTR providerName);
extern "C" void QCALLTYPE EventPipeInternal_DeleteProvider(
INT_PTR provHandle);
diff --git a/src/coreclr/vm/eventreporter.cpp b/src/coreclr/vm/eventreporter.cpp
index 318cc21320f622..e865549052464a 100644
--- a/src/coreclr/vm/eventreporter.cpp
+++ b/src/coreclr/vm/eventreporter.cpp
@@ -110,7 +110,7 @@ EventReporter::EventReporter(EventReporterType type)
case ERT_ManagedFailFast:
if(!ssMessage.LoadResource(CCompRC::Optional, IDS_ER_MANAGEDFAILFAST))
- m_Description.Append(W("Description: The application requested process termination through Environment.FailFast."));
+ m_Description.Append(W("Description: The application requested process termination through System.Environment.FailFast."));
else
{
m_Description.Append(ssMessage);
@@ -120,7 +120,7 @@ EventReporter::EventReporter(EventReporterType type)
case ERT_UnmanagedFailFast:
if(!ssMessage.LoadResource(CCompRC::Optional, IDS_ER_UNMANAGEDFAILFAST))
- m_Description.Append(W("Description: The process was terminated due to an internal error in the .NET Runtime."));
+ m_Description.Append(W("Description: The process was terminated due to an internal error in the .NET Runtime "));
else
{
m_Description.Append(ssMessage);
@@ -165,7 +165,7 @@ EventReporter::EventReporter(EventReporterType type)
// Return Value:
// None.
//
-void EventReporter::AddDescription(__in WCHAR *pString)
+void EventReporter::AddDescription(_In_ WCHAR *pString)
{
CONTRACTL
{
diff --git a/src/coreclr/vm/eventreporter.h b/src/coreclr/vm/eventreporter.h
index ac74acb76a1019..9b600e76cd4aea 100644
--- a/src/coreclr/vm/eventreporter.h
+++ b/src/coreclr/vm/eventreporter.h
@@ -52,7 +52,7 @@ class EventReporter
// Construct
EventReporter(EventReporterType type);
// Add extra info into description part of the log
- void AddDescription(__in WCHAR *pString);
+ void AddDescription(_In_ WCHAR *pString);
void AddDescription(SString& s);
// Start callstack record
void BeginStackTrace();
diff --git a/src/coreclr/vm/eventtrace.cpp b/src/coreclr/vm/eventtrace.cpp
index a9a33e50efc145..e5473b11041775 100644
--- a/src/coreclr/vm/eventtrace.cpp
+++ b/src/coreclr/vm/eventtrace.cpp
@@ -4961,7 +4961,7 @@ VOID ETW::ExceptionLog::ExceptionFilterEnd()
/****************************************************************************/
/* This is called by the runtime when a domain is loaded */
/****************************************************************************/
-VOID ETW::LoaderLog::DomainLoadReal(BaseDomain *pDomain, __in_opt LPWSTR wszFriendlyName)
+VOID ETW::LoaderLog::DomainLoadReal(BaseDomain *pDomain, _In_opt_ LPWSTR wszFriendlyName)
{
CONTRACTL {
NOTHROW;
@@ -5671,7 +5671,7 @@ VOID ETW::MethodLog::MethodTableRestored(MethodTable *pMethodTable)
/****************************************************************************/
/* This is called by the runtime when a Strong Name Verification Starts */
/****************************************************************************/
-VOID ETW::SecurityLog::StrongNameVerificationStart(DWORD dwInFlags, __in LPWSTR strFullyQualifiedAssemblyName)
+VOID ETW::SecurityLog::StrongNameVerificationStart(DWORD dwInFlags, _In_ LPWSTR strFullyQualifiedAssemblyName)
{
WRAPPER_NO_CONTRACT;
}
@@ -5680,7 +5680,7 @@ VOID ETW::SecurityLog::StrongNameVerificationStart(DWORD dwInFlags, __in LPWSTR
/****************************************************************************/
/* This is called by the runtime when a Strong Name Verification Ends */
/****************************************************************************/
-VOID ETW::SecurityLog::StrongNameVerificationStop(DWORD dwInFlags,ULONG result, __in LPWSTR strFullyQualifiedAssemblyName)
+VOID ETW::SecurityLog::StrongNameVerificationStop(DWORD dwInFlags,ULONG result, _In_ LPWSTR strFullyQualifiedAssemblyName)
{
WRAPPER_NO_CONTRACT;
}
@@ -6091,8 +6091,8 @@ VOID ETW::LoaderLog::SendAssemblyEvent(Assembly *pAssembly, DWORD dwEventOptions
ETW_INLINE
ULONG
ETW::LoaderLog::SendModuleRange(
- __in Module *pModule,
- __in DWORD dwEventOptions)
+ _In_ Module *pModule,
+ _In_ DWORD dwEventOptions)
{
ULONG Result = ERROR_SUCCESS;
diff --git a/src/coreclr/vm/excep.cpp b/src/coreclr/vm/excep.cpp
index df71d0e0e06c8e..fa2b8ffc7dfe38 100644
--- a/src/coreclr/vm/excep.cpp
+++ b/src/coreclr/vm/excep.cpp
@@ -190,7 +190,7 @@ BOOL ExceptionIsOfRightType(TypeHandle clauseType, TypeHandle thrownType)
// Gets the message text from an exception
//===========================================================================
ULONG GetExceptionMessage(OBJECTREF throwable,
- __inout_ecount(bufferLength) LPWSTR buffer,
+ _Inout_updates_(bufferLength) LPWSTR buffer,
ULONG bufferLength)
{
CONTRACTL
@@ -5162,7 +5162,7 @@ static SString GetExceptionMessageWrapper(Thread* pThread, OBJECTREF throwable)
void STDMETHODCALLTYPE
DefaultCatchHandlerExceptionMessageWorker(Thread* pThread,
OBJECTREF throwable,
- __inout_ecount(buf_size) WCHAR *buf,
+ _Inout_updates_(buf_size) WCHAR *buf,
const int buf_size,
BOOL sendWindowsEventLog)
{
@@ -11476,7 +11476,7 @@ void ResetThreadAbortState(PTR_Thread pThread, CrawlFrame *pCf, StackFrame sfCur
// Note: The "cond" argument is there to tide us over during the transition from
// BAD_FORMAT_ASSERT to THROW_BAD_FORMAT. It will go away soon.
//---------------------------------------------------------------------------------
-VOID ThrowBadFormatWorker(UINT resID, LPCWSTR imageName DEBUGARG(__in_z const char *cond))
+VOID ThrowBadFormatWorker(UINT resID, LPCWSTR imageName DEBUGARG(_In_z_ const char *cond))
{
CONTRACTL
{
@@ -11906,8 +11906,8 @@ VOID DECLSPEC_NORETURN ThrowFieldLayoutError(mdTypeDef cl, // cl
}
CHAR offsetBuf[16];
- sprintf_s(offsetBuf, COUNTOF(offsetBuf), "%d", dwOffset);
- offsetBuf[COUNTOF(offsetBuf) - 1] = '\0';
+ sprintf_s(offsetBuf, ARRAY_SIZE(offsetBuf), "%d", dwOffset);
+ offsetBuf[ARRAY_SIZE(offsetBuf) - 1] = '\0';
pModule->GetAssembly()->ThrowTypeLoadException(pszNamespace,
pszName,
diff --git a/src/coreclr/vm/excep.h b/src/coreclr/vm/excep.h
index f95a8b6784ea97..b76839bdcffdd7 100644
--- a/src/coreclr/vm/excep.h
+++ b/src/coreclr/vm/excep.h
@@ -347,7 +347,7 @@ void CreateTypeInitializationExceptionObject(LPCWSTR pTypeThatFailed,
//==========================================================================
ULONG GetExceptionMessage(OBJECTREF throwable,
- __inout_ecount(bufferLength) LPWSTR buffer,
+ _Inout_updates_(bufferLength) LPWSTR buffer,
ULONG bufferLength);
void GetExceptionMessage(OBJECTREF throwable, SString &result);
STRINGREF GetExceptionMessage(OBJECTREF throwable);
diff --git a/src/coreclr/vm/exceptionhandling.cpp b/src/coreclr/vm/exceptionhandling.cpp
index 4af702fab14996..dcd6681a1b08c1 100644
--- a/src/coreclr/vm/exceptionhandling.cpp
+++ b/src/coreclr/vm/exceptionhandling.cpp
@@ -117,7 +117,7 @@ inline void RestoreNonvolatileRegisterPointers(PT_KNONVOLATILE_CONTEXT_POINTERS
//
#ifdef _DEBUG
void DumpClauses(IJitManager* pJitMan, const METHODTOKEN& MethToken, UINT_PTR uMethodStartPC, UINT_PTR dwControlPc);
-static void DoEHLog(DWORD lvl, __in_z const char *fmt, ...);
+static void DoEHLog(DWORD lvl, _In_z_ const char *fmt, ...);
#define EH_LOG(expr) { DoEHLog expr ; }
#else
#define EH_LOG(expr)
@@ -2035,7 +2035,7 @@ CLRUnwindStatus ExceptionTracker::ProcessOSExceptionNotification(
}
// static
-void ExceptionTracker::DebugLogTrackerRanges(__in_z const char *pszTag)
+void ExceptionTracker::DebugLogTrackerRanges(_In_z_ const char *pszTag)
{
#ifdef _DEBUG
CONTRACTL
@@ -4277,7 +4277,7 @@ void DumpClauses(IJitManager* pJitMan, const METHODTOKEN& MethToken, UINT_PTR uM
static void DoEHLog(
DWORD lvl,
- __in_z const char *fmt,
+ _In_z_ const char *fmt,
...
)
{
diff --git a/src/coreclr/vm/exceptionhandling.h b/src/coreclr/vm/exceptionhandling.h
index 50dd756fa7e89c..c3237de6b67b0b 100644
--- a/src/coreclr/vm/exceptionhandling.h
+++ b/src/coreclr/vm/exceptionhandling.h
@@ -360,7 +360,7 @@ class ExceptionTracker
void EnumMemoryRegions(CLRDataEnumMemoryFlags flags);
#endif // DACCESS_COMPILE
- static void DebugLogTrackerRanges(__in_z const char *pszTag);
+ static void DebugLogTrackerRanges(_In_z_ const char *pszTag);
bool IsStackOverflowException();
diff --git a/src/coreclr/vm/exceptmacros.h b/src/coreclr/vm/exceptmacros.h
index 70e1fe0871e0d7..4967da497b5097 100644
--- a/src/coreclr/vm/exceptmacros.h
+++ b/src/coreclr/vm/exceptmacros.h
@@ -502,11 +502,11 @@ LPCWSTR GetPathForErrorMessagesT(T *pImgObj)
}
}
-VOID ThrowBadFormatWorker(UINT resID, LPCWSTR imageName DEBUGARG(__in_z const char *cond));
+VOID ThrowBadFormatWorker(UINT resID, LPCWSTR imageName DEBUGARG(_In_z_ const char *cond));
template
NOINLINE
-VOID ThrowBadFormatWorkerT(UINT resID, T * pImgObj DEBUGARG(__in_z const char *cond))
+VOID ThrowBadFormatWorkerT(UINT resID, T * pImgObj DEBUGARG(_In_z_ const char *cond))
{
#ifdef DACCESS_COMPILE
ThrowBadFormatWorker(resID, nullptr DEBUGARG(cond));
diff --git a/src/coreclr/vm/frames.cpp b/src/coreclr/vm/frames.cpp
index 77bcb178bb49c2..2f7a4d91c9ec4b 100644
--- a/src/coreclr/vm/frames.cpp
+++ b/src/coreclr/vm/frames.cpp
@@ -80,7 +80,7 @@ void Frame::Log() {
#endif
else if (GetVTablePtr() == PInvokeCalliFrame::GetMethodFrameVPtr())
{
- sprintf_s(buff, COUNTOF(buff), "PInvoke CALLI target" FMT_ADDR,
+ sprintf_s(buff, ARRAY_SIZE(buff), "PInvoke CALLI target" FMT_ADDR,
DBG_ADDR(((PInvokeCalliFrame*)this)->GetPInvokeCalliTarget()));
frameType = buff;
}
@@ -257,7 +257,7 @@ void Frame::LogFrame(
{
_ASSERTE(!"New Frame type needs to be added to FrameTypeName()");
// Pointer is up to 17chars + vtbl@ = 22 chars
- sprintf_s(buf, COUNTOF(buf), "vtbl@%p", (VOID *)GetVTablePtr());
+ sprintf_s(buf, ARRAY_SIZE(buf), "vtbl@%p", (VOID *)GetVTablePtr());
pFrameType = buf;
}
diff --git a/src/coreclr/vm/ilmarshalers.cpp b/src/coreclr/vm/ilmarshalers.cpp
index 4782df6281b128..b6cb70ccf56c7a 100644
--- a/src/coreclr/vm/ilmarshalers.cpp
+++ b/src/coreclr/vm/ilmarshalers.cpp
@@ -4922,8 +4922,8 @@ FCIMPL3(void, MngdSafeArrayMarshaler::ConvertSpaceToManaged, MngdSafeArrayMarsha
{
WCHAR strExpectedRank[64];
WCHAR strActualRank[64];
- _ltow_s(pThis->m_iRank, strExpectedRank, COUNTOF(strExpectedRank), 10);
- _ltow_s(iSafeArrayRank, strActualRank, COUNTOF(strActualRank), 10);
+ _ltow_s(pThis->m_iRank, strExpectedRank, ARRAY_SIZE(strExpectedRank), 10);
+ _ltow_s(iSafeArrayRank, strActualRank, ARRAY_SIZE(strActualRank), 10);
COMPlusThrow(kSafeArrayRankMismatchException, IDS_EE_SAFEARRAYRANKMISMATCH, strActualRank, strExpectedRank);
}
}
diff --git a/src/coreclr/vm/interoputil.cpp b/src/coreclr/vm/interoputil.cpp
index 610c3418ae530f..9e8613137b5d20 100644
--- a/src/coreclr/vm/interoputil.cpp
+++ b/src/coreclr/vm/interoputil.cpp
@@ -920,7 +920,7 @@ ReadBestFitCustomAttribute(Module* pModule, mdTypeDef cl, BOOL* BestFit, BOOL* T
}
-int InternalWideToAnsi(__in_ecount(iNumWideChars) LPCWSTR szWideString, int iNumWideChars, __out_ecount_opt(cbAnsiBufferSize) LPSTR szAnsiString, int cbAnsiBufferSize, BOOL fBestFit, BOOL fThrowOnUnmappableChar)
+int InternalWideToAnsi(_In_reads_(iNumWideChars) LPCWSTR szWideString, int iNumWideChars, _Out_writes_bytes_opt_(cbAnsiBufferSize) LPSTR szAnsiString, int cbAnsiBufferSize, BOOL fBestFit, BOOL fThrowOnUnmappableChar)
{
CONTRACTL
{
@@ -2784,7 +2784,7 @@ BOOL IsComTargetValidForType(REFLECTCLASSBASEREF* pRefClassObj, OBJECTREF* pTarg
return FALSE;
}
-DISPID ExtractStandardDispId(__in_z LPWSTR strStdDispIdMemberName)
+DISPID ExtractStandardDispId(_In_z_ LPWSTR strStdDispIdMemberName)
{
CONTRACTL
{
@@ -3316,7 +3316,7 @@ void IUInvokeDispMethod(
vDispIDElement.pMT = pInvokedMT;
vDispIDElement.strNameLength = strNameLength;
vDispIDElement.lcid = lcid;
- wcscpy_s(vDispIDElement.strName, COUNTOF(vDispIDElement.strName), aNamesToConvert[0]);
+ wcscpy_s(vDispIDElement.strName, ARRAY_SIZE(vDispIDElement.strName), aNamesToConvert[0]);
// Only look up if the cache has already been created.
DispIDCache* pDispIDCache = GetAppDomain()->GetRefDispIDCache();
@@ -3782,13 +3782,13 @@ VOID IntializeInteropLogging()
g_TraceCount = g_pConfig->GetTraceWrapper();
}
-VOID LogInterop(__in_z LPCSTR szMsg)
+VOID LogInterop(_In_z_ LPCSTR szMsg)
{
LIMITED_METHOD_CONTRACT;
LOG( (LF_INTEROP, LL_INFO10, "%s\n",szMsg) );
}
-VOID LogInterop(__in_z LPCWSTR wszMsg)
+VOID LogInterop(_In_z_ LPCWSTR wszMsg)
{
LIMITED_METHOD_CONTRACT;
LOG( (LF_INTEROP, LL_INFO10, "%S\n", wszMsg) );
@@ -3964,7 +3964,7 @@ VOID LogInteropLeak(IUnknown* pItf)
//-------------------------------------------------------------------
// VOID LogInteropQI(IUnknown* pItf, REFIID iid, HRESULT hr, LPCSTR szMsg)
//-------------------------------------------------------------------
-VOID LogInteropQI(IUnknown* pItf, REFIID iid, HRESULT hrArg, __in_z LPCSTR szMsg)
+VOID LogInteropQI(IUnknown* pItf, REFIID iid, HRESULT hrArg, _In_z_ LPCSTR szMsg)
{
if (!LoggingOn(LF_INTEROP, LL_ALWAYS))
return;
@@ -4013,7 +4013,7 @@ VOID LogInteropQI(IUnknown* pItf, REFIID iid, HRESULT hrArg, __in_z LPCSTR szMsg
//-------------------------------------------------------------------
// VOID LogInteropAddRef(IUnknown* pItf, ULONG cbRef, LPCSTR szMsg)
//-------------------------------------------------------------------
-VOID LogInteropAddRef(IUnknown* pItf, ULONG cbRef, __in_z LPCSTR szMsg)
+VOID LogInteropAddRef(IUnknown* pItf, ULONG cbRef, _In_z_ LPCSTR szMsg)
{
if (!LoggingOn(LF_INTEROP, LL_ALWAYS))
return;
@@ -4046,7 +4046,7 @@ VOID LogInteropAddRef(IUnknown* pItf, ULONG cbRef, __in_z LPCSTR szMsg)
//-------------------------------------------------------------------
// VOID LogInteropRelease(IUnknown* pItf, ULONG cbRef, LPCSTR szMsg)
//-------------------------------------------------------------------
-VOID LogInteropRelease(IUnknown* pItf, ULONG cbRef, __in_z LPCSTR szMsg)
+VOID LogInteropRelease(IUnknown* pItf, ULONG cbRef, _In_z_ LPCSTR szMsg)
{
if (!LoggingOn(LF_INTEROP, LL_ALWAYS))
return;
diff --git a/src/coreclr/vm/interoputil.h b/src/coreclr/vm/interoputil.h
index f9706d88079983..eec7e378a561c4 100644
--- a/src/coreclr/vm/interoputil.h
+++ b/src/coreclr/vm/interoputil.h
@@ -92,7 +92,7 @@ BOOL IsComObjectClass(TypeHandle type);
//---------------------------------------------------------
VOID ReadBestFitCustomAttribute(MethodDesc* pMD, BOOL* BestFit, BOOL* ThrowOnUnmappableChar);
VOID ReadBestFitCustomAttribute(Module* pModule, mdTypeDef cl, BOOL* BestFit, BOOL* ThrowOnUnmappableChar);
-int InternalWideToAnsi(__in_ecount(iNumWideChars) LPCWSTR szWideString, int iNumWideChars, __out_ecount_opt(cbAnsiBufferSize) LPSTR szAnsiString, int cbAnsiBufferSize, BOOL fBestFit, BOOL fThrowOnUnmappableChar);
+int InternalWideToAnsi(_In_reads_(iNumWideChars) LPCWSTR szWideString, int iNumWideChars, _Out_writes_bytes_opt_(cbAnsiBufferSize) LPSTR szAnsiString, int cbAnsiBufferSize, BOOL fBestFit, BOOL fThrowOnUnmappableChar);
//---------------------------------------------------------
// Read the ClassInterfaceType custom attribute info from
@@ -358,14 +358,14 @@ ClassFactoryBase *GetComClassFactory(MethodTable* pClassMT);
#ifdef _DEBUG
-VOID LogInterop(__in_z LPCSTR szMsg);
-VOID LogInterop(__in_z LPCWSTR szMsg);
+VOID LogInterop(_In_z_ LPCSTR szMsg);
+VOID LogInterop(_In_z_ LPCWSTR szMsg);
VOID LogInteropLeak(IUnkEntry * pEntry);
VOID LogInteropLeak(IUnknown* pItf);
-VOID LogInteropQI(IUnknown* pItf, REFIID riid, HRESULT hr, __in_z LPCSTR szMsg);
-VOID LogInteropAddRef(IUnknown* pItf, ULONG cbRef, __in_z LPCSTR szMsg);
-VOID LogInteropRelease(IUnknown* pItf, ULONG cbRef, __in_z LPCSTR szMsg);
+VOID LogInteropQI(IUnknown* pItf, REFIID riid, HRESULT hr, _In_z_ LPCSTR szMsg);
+VOID LogInteropAddRef(IUnknown* pItf, ULONG cbRef, _In_z_ LPCSTR szMsg);
+VOID LogInteropRelease(IUnknown* pItf, ULONG cbRef, _In_z_ LPCSTR szMsg);
VOID LogRCWCreate(RCW* pWrap, IUnknown* pUnk);
VOID LogRCWMinorCleanup(RCW* pWrap);
diff --git a/src/coreclr/vm/interpreter.cpp b/src/coreclr/vm/interpreter.cpp
index 6ca5bb6935a622..ac8037cb5a835d 100644
--- a/src/coreclr/vm/interpreter.cpp
+++ b/src/coreclr/vm/interpreter.cpp
@@ -1628,7 +1628,7 @@ size_t Interpreter::GetFrameSize(InterpreterMethodInfo* interpMethInfo)
}
// static
-ARG_SLOT Interpreter::ExecuteMethodWrapper(struct InterpreterMethodInfo* interpMethInfo, bool directCall, BYTE* ilArgs, void* stubContext, __out bool* pDoJmpCall, CORINFO_RESOLVED_TOKEN* pResolvedToken)
+ARG_SLOT Interpreter::ExecuteMethodWrapper(struct InterpreterMethodInfo* interpMethInfo, bool directCall, BYTE* ilArgs, void* stubContext, _Out_ bool* pDoJmpCall, CORINFO_RESOLVED_TOKEN* pResolvedToken)
{
#define INTERP_DYNAMIC_CONTRACTS 1
#if INTERP_DYNAMIC_CONTRACTS
@@ -1995,7 +1995,7 @@ void Interpreter::DoMonitorExitWork()
}
-void Interpreter::ExecuteMethod(ARG_SLOT* retVal, __out bool* pDoJmpCall, __out unsigned* pJmpCallToken)
+void Interpreter::ExecuteMethod(ARG_SLOT* retVal, _Out_ bool* pDoJmpCall, _Out_ unsigned* pJmpCallToken)
{
#if INTERP_DYNAMIC_CONTRACTS
CONTRACTL {
diff --git a/src/coreclr/vm/interpreter.h b/src/coreclr/vm/interpreter.h
index a6346cebc4ccfa..041484855c4dc8 100644
--- a/src/coreclr/vm/interpreter.h
+++ b/src/coreclr/vm/interpreter.h
@@ -722,7 +722,7 @@ class InterpreterCEEInfo: public CEEInfo
{
CEEJitInfo m_jitInfo;
public:
- InterpreterCEEInfo(CORINFO_METHOD_HANDLE meth): CEEInfo((MethodDesc*)meth), m_jitInfo((MethodDesc*)meth, NULL, NULL, CORJIT_FLAGS::CORJIT_FLAG_SPEED_OPT) { m_pOverride = this; }
+ InterpreterCEEInfo(CORINFO_METHOD_HANDLE meth): CEEInfo((MethodDesc*)meth), m_jitInfo((MethodDesc*)meth, NULL, NULL, CORJIT_FLAGS::CORJIT_FLAG_SPEED_OPT) { }
// Certain methods are unimplemented by CEEInfo (they hit an assert). They are implemented by CEEJitInfo, yet
// don't seem to require any of the CEEJitInfo state we can't provide. For those case, delegate to the "partial"
diff --git a/src/coreclr/vm/jithelpers.cpp b/src/coreclr/vm/jithelpers.cpp
index 3e92144dca122b..109f98ceecfe13 100644
--- a/src/coreclr/vm/jithelpers.cpp
+++ b/src/coreclr/vm/jithelpers.cpp
@@ -5950,7 +5950,7 @@ void InitJitHelperLogging()
else
{
_ASSERTE(((size_t)hlpFunc->pfnHelper - 1) >= 0 &&
- ((size_t)hlpFunc->pfnHelper - 1) < COUNTOF(hlpDynamicFuncTable));
+ ((size_t)hlpFunc->pfnHelper - 1) < ARRAY_SIZE(hlpDynamicFuncTable));
VMHELPDEF* dynamicHlpFunc = &hlpDynamicFuncTable[((size_t)hlpFunc->pfnHelper - 1)];
// While we're here initialize the table of VMHELPCOUNTDEF
diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp
index df4e985fda1e6a..e28434acabe56e 100644
--- a/src/coreclr/vm/jitinterface.cpp
+++ b/src/coreclr/vm/jitinterface.cpp
@@ -190,16 +190,6 @@ BOOL ModifyCheckForDynamicMethod(DynamicResolver *pResolver,
/*****************************************************************************/
-void CEEInfo::setOverride(ICorDynamicInfo *pOverride, CORINFO_METHOD_HANDLE currentMethod)
-{
- LIMITED_METHOD_CONTRACT;
- m_pOverride = pOverride;
- m_pMethodBeingCompiled = (MethodDesc *)currentMethod; // method being compiled
-
- m_hMethodForSecurity_Key = NULL;
- m_pMethodForSecurity_Value = NULL;
-}
-
// Initialize from data we passed across to the JIT
void CEEInfo::GetTypeContext(const CORINFO_SIG_INST *info, SigTypeContext *pTypeContext)
{
@@ -573,7 +563,7 @@ CORINFO_CLASS_HANDLE CEEInfo::getTokenTypeAsHandle (CORINFO_RESOLVED_TOKEN * pRe
size_t CEEInfo::findNameOfToken (
CORINFO_MODULE_HANDLE scopeHnd,
mdToken metaTOK,
- __out_ecount (FQNameCapacity) char * szFQName,
+ _Out_writes_ (FQNameCapacity) char * szFQName,
size_t FQNameCapacity)
{
CONTRACTL {
@@ -716,7 +706,7 @@ const char16_t* CEEInfo::getStringLiteral (
/* static */
size_t CEEInfo::findNameOfToken (Module* module,
mdToken metaTOK,
- __out_ecount (FQNameCapacity) char * szFQName,
+ _Out_writes_ (FQNameCapacity) char * szFQName,
size_t FQNameCapacity)
{
CONTRACTL {
@@ -1470,8 +1460,7 @@ void CEEInfo::getFieldInfo (CORINFO_RESOLVED_TOKEN * pResolvedToken,
fieldAccessor = intrinsicAccessor;
}
else
- if (IsCompilingForNGen() ||
- // Static fields are not pinned in collectible types. We will always access
+ if (// Static fields are not pinned in collectible types. We will always access
// them using a helper since the address cannot be embeded into the code.
pFieldMT->Collectible() ||
// We always treat accessing thread statics as if we are in domain neutral code.
@@ -1633,13 +1622,6 @@ void CEEInfo::getFieldInfo (CORINFO_RESOLVED_TOKEN * pResolvedToken,
pResult->accessCalloutHelper.args[0].Set(CORINFO_METHOD_HANDLE(pCallerForSecurity));
pResult->accessCalloutHelper.args[1].Set(CORINFO_FIELD_HANDLE(pField));
-
- if (IsCompilingForNGen())
- {
- //see code:CEEInfo::getCallInfo for more information.
- if (pCallerForSecurity->ContainsGenericVariables())
- COMPlusThrowNonLocalized(kNotSupportedException, W("Cannot embed generic MethodDesc"));
- }
}
}
}
@@ -2603,7 +2585,7 @@ void CEEInfo::ScanForModuleDependencies(Module* pModule, SigPointer psig)
if (!pTypeDefModule->IsSystem() && (pModule != pTypeDefModule))
{
- m_pOverride->addActiveDependency((CORINFO_MODULE_HANDLE)pModule, (CORINFO_MODULE_HANDLE)pTypeDefModule);
+ addActiveDependency((CORINFO_MODULE_HANDLE)pModule, (CORINFO_MODULE_HANDLE)pTypeDefModule);
}
}
break;
@@ -2683,7 +2665,7 @@ void CEEInfo::ScanInstantiation(Module * pModule, Instantiation inst)
if (!pDefModule->IsSystem() && (pModule != pDefModule))
{
- m_pOverride->addActiveDependency((CORINFO_MODULE_HANDLE)pModule, (CORINFO_MODULE_HANDLE)pDefModule);
+ addActiveDependency((CORINFO_MODULE_HANDLE)pModule, (CORINFO_MODULE_HANDLE)pDefModule);
}
if (pMT->HasInstantiation())
@@ -2765,7 +2747,7 @@ void CEEInfo::ScanToken(Module * pModule, CORINFO_RESOLVED_TOKEN * pResolvedToke
if (pModule != pDefModule)
{
- m_pOverride->addActiveDependency((CORINFO_MODULE_HANDLE)pModule, (CORINFO_MODULE_HANDLE)pDefModule);
+ addActiveDependency((CORINFO_MODULE_HANDLE)pModule, (CORINFO_MODULE_HANDLE)pDefModule);
}
MethodTable * pParentMT = pMT->GetParentMethodTable();
@@ -3374,7 +3356,7 @@ const char* CEEInfo::getHelperName (CorInfoHelpFunc ftnNum)
/*********************************************************************/
-int CEEInfo::appendClassName(__deref_inout_ecount(*pnBufLen) char16_t** ppBuf,
+int CEEInfo::appendClassName(_Outptr_result_buffer_(*pnBufLen) char16_t** ppBuf,
int* pnBufLen,
CORINFO_CLASS_HANDLE clsHnd,
bool fNamespace,
@@ -3725,27 +3707,13 @@ CorInfoInitClassResult CEEInfo::initClass(
MethodDesc *methodBeingCompiled = m_pMethodBeingCompiled;
- BOOL fMethodZappedOrNGen = IsCompilingForNGen();
-
MethodTable *pTypeToInitMT = typeToInitTH.AsMethodTable();
- // This should be the most common early-out case.
- if (fMethodZappedOrNGen)
- {
- if (pTypeToInitMT->IsClassPreInited())
- {
- result = CORINFO_INITCLASS_NOT_REQUIRED;
- goto exit;
- }
- }
- else
+ if (pTypeToInitMT->IsClassInited())
{
- if (pTypeToInitMT->IsClassInited())
- {
- // If the type is initialized there really is nothing to do.
- result = CORINFO_INITCLASS_INITIALIZED;
- goto exit;
- }
+ // If the type is initialized there really is nothing to do.
+ result = CORINFO_INITCLASS_INITIALIZED;
+ goto exit;
}
if (pTypeToInitMT->IsGlobalClass())
@@ -3848,14 +3816,6 @@ CorInfoInitClassResult CEEInfo::initClass(
}
}
- if (fMethodZappedOrNGen)
- {
- // Well, because of code sharing we can't do anything at coge generation time.
- // We have to do it at runtime.
- result = CORINFO_INITCLASS_USE_HELPER;
- goto exit;
- }
-
//
// Optimizations for domain specific code
//
@@ -4830,13 +4790,6 @@ CorInfoIsAccessAllowedResult CEEInfo::canAccessClass(
pAccessHelper->args[0].Set(CORINFO_METHOD_HANDLE(pCallerForSecurity));
pAccessHelper->args[1].Set(CORINFO_CLASS_HANDLE(pCalleeForSecurity.AsPtr()));
-
- if (IsCompilingForNGen())
- {
- //see code:CEEInfo::getCallInfo for more information.
- if (pCallerForSecurity->ContainsGenericVariables() || pCalleeForSecurity.ContainsGenericVariables())
- COMPlusThrowNonLocalized(kNotSupportedException, W("Cannot embed generic TypeHandle"));
- }
}
EE_TO_JIT_TRANSITION();
@@ -5413,19 +5366,6 @@ void CEEInfo::getCallInfo(
pResult->callsiteCalloutHelper.args[0].Set(CORINFO_METHOD_HANDLE(pCallerForSecurity));
pResult->callsiteCalloutHelper.args[1].Set(CORINFO_METHOD_HANDLE(pCalleeForSecurity));
-
- //We now embed open instantiations in a few places for security callouts (since you can only
- //do the security check on the open instantiation). We throw these methods out in
- //TriageMethodForZap. In addition, NGen has problems referencing them properly. Just throw out the whole
- //method and rejit at runtime.
- if (IsCompilingForNGen())
- {
- if (pCallerForSecurity->ContainsGenericVariables()
- || pCalleeForSecurity->ContainsGenericVariables())
- {
- COMPlusThrowNonLocalized(kNotSupportedException, W("Cannot embed generic MethodDesc"));
- }
- }
}
}
}
@@ -5895,8 +5835,8 @@ CorInfoHelpFunc CEEInfo::getCastingHelper(CORINFO_RESOLVED_TOKEN * pResolvedToke
bool fClassMustBeRestored;
result = getCastingHelperStatic(TypeHandle(pResolvedToken->hClass), fThrowing, &fClassMustBeRestored);
- if (fClassMustBeRestored && m_pOverride != NULL)
- m_pOverride->classMustBeLoadedBeforeCodeIsRun(pResolvedToken->hClass);
+ if (fClassMustBeRestored)
+ classMustBeLoadedBeforeCodeIsRun(pResolvedToken->hClass);
EE_TO_JIT_TRANSITION();
@@ -6019,8 +5959,7 @@ CorInfoHelpFunc CEEInfo::getUnBoxHelper(CORINFO_CLASS_HANDLE clsHnd)
{
LIMITED_METHOD_CONTRACT;
- if (m_pOverride != NULL)
- m_pOverride->classMustBeLoadedBeforeCodeIsRun(clsHnd);
+ classMustBeLoadedBeforeCodeIsRun(clsHnd);
TypeHandle VMClsHnd(clsHnd);
if (Nullable::IsNullableType(VMClsHnd))
@@ -9359,7 +9298,7 @@ CorInfoTypeWithMod CEEInfo::getArgType (
TypeHandle thPtr = ptr.GetTypeHandleNT(pModule, &typeContext);
if(!thPtr.IsNull())
{
- m_pOverride->classMustBeLoadedBeforeCodeIsRun(CORINFO_CLASS_HANDLE(thPtr.AsPtr()));
+ classMustBeLoadedBeforeCodeIsRun(CORINFO_CLASS_HANDLE(thPtr.AsPtr()));
}
}
break;
@@ -10033,7 +9972,7 @@ HRESULT CEEInfo::GetErrorHRESULT(struct _EXCEPTION_POINTERS *pExceptionPointers)
}
-uint32_t CEEInfo::GetErrorMessage(__inout_ecount(bufferLength) char16_t* buffer, uint32_t bufferLength)
+uint32_t CEEInfo::GetErrorMessage(_Inout_updates_(bufferLength) char16_t* buffer, uint32_t bufferLength)
{
CONTRACTL {
THROWS;
@@ -10416,7 +10355,7 @@ bool CEEInfo::runWithErrorTrap(void (*function)(void*), void* param)
#if !defined(TARGET_UNIX)
RunWithErrorTrapFilterParam trapParam;
- trapParam.m_corInfo = m_pOverride == nullptr ? this : m_pOverride;
+ trapParam.m_corInfo = this;
trapParam.m_function = function;
trapParam.m_param = param;
diff --git a/src/coreclr/vm/jitinterface.h b/src/coreclr/vm/jitinterface.h
index 43b9040b7c3363..1afac1ba80201a 100644
--- a/src/coreclr/vm/jitinterface.h
+++ b/src/coreclr/vm/jitinterface.h
@@ -425,7 +425,7 @@ class CEEInfo : public ICorJitInfo
static CorInfoHelpFunc getSharedStaticsHelper(FieldDesc * pField, MethodTable * pFieldMT);
static size_t findNameOfToken (Module* module, mdToken metaTOK,
- __out_ecount (FQNameCapacity) char * szFQName, size_t FQNameCapacity);
+ _Out_writes_ (FQNameCapacity) char * szFQName, size_t FQNameCapacity);
DWORD getMethodAttribsInternal (CORINFO_METHOD_HANDLE ftnHnd);
@@ -475,14 +475,6 @@ class CEEInfo : public ICorJitInfo
CORINFO_GET_TAILCALL_HELPERS_FLAGS flags,
CORINFO_TAILCALL_HELPERS* pResult);
- // Returns whether we are generating code for NGen image.
- bool IsCompilingForNGen()
- {
- LIMITED_METHOD_CONTRACT;
- // NGen is the only place where we set the override
- return this != m_pOverride;
- }
-
// This normalizes EE type information into the form expected by the JIT.
//
// If typeHnd contains exact type information, then *clsRet will contain
@@ -492,7 +484,6 @@ class CEEInfo : public ICorJitInfo
CORINFO_CLASS_HANDLE *clsRet = NULL /* optional out */ );
CEEInfo(MethodDesc * fd = NULL, bool fVerifyOnly = false, bool fAllowInlining = true) :
- m_pOverride(NULL),
m_pMethodBeingCompiled(fd),
m_fVerifyOnly(fVerifyOnly),
m_pThread(GetThreadNULLOk()),
@@ -569,13 +560,6 @@ class CEEInfo : public ICorJitInfo
#endif
protected:
- // NGen provides its own modifications to EE-JIT interface. From technical reason it cannot simply inherit
- // from code:CEEInfo class (because it has dependencies on VM that NGen does not want).
- // Therefore the "normal" EE-JIT interface has code:m_pOverride hook that is set either to
- // * 'this' (code:CEEInfo) at runtime, or to
- // * code:ZapInfo - the NGen specific implementation of the interface.
- ICorDynamicInfo * m_pOverride;
-
MethodDesc* m_pMethodBeingCompiled; // Top-level method being compiled
bool m_fVerifyOnly;
Thread * m_pThread; // Cached current thread for faster JIT-EE transitions
@@ -847,8 +831,6 @@ class CEEJitInfo : public CEEInfo
GC_NOTRIGGER;
MODE_ANY;
} CONTRACTL_END;
-
- m_pOverride = this;
}
~CEEJitInfo()
diff --git a/src/coreclr/vm/method.cpp b/src/coreclr/vm/method.cpp
index 6e20c4d28f51c0..4309978b132346 100644
--- a/src/coreclr/vm/method.cpp
+++ b/src/coreclr/vm/method.cpp
@@ -1656,6 +1656,13 @@ UINT MethodDesc::CbStackPop()
SUPPORTS_DAC;
MetaSig msig(this);
ArgIterator argit(&msig);
+
+ bool fCtorOfVariableSizedObject = msig.HasThis() && (GetMethodTable() == g_pStringClass) && IsCtor();
+ if (fCtorOfVariableSizedObject)
+ {
+ msig.ClearHasThis();
+ }
+
return argit.CbStackPop();
}
#endif // TARGET_X86
diff --git a/src/coreclr/vm/mlinfo.cpp b/src/coreclr/vm/mlinfo.cpp
index 1dcc726213640f..c5731840122845 100644
--- a/src/coreclr/vm/mlinfo.cpp
+++ b/src/coreclr/vm/mlinfo.cpp
@@ -1130,27 +1130,27 @@ MarshalInfo::MarshalInfo(Module* pModule,
CHAR achDbgContext[DEBUG_CONTEXT_STR_LEN] = "";
if (!pDebugName)
{
- strncpy_s(achDbgContext, COUNTOF(achDbgContext), "", _TRUNCATE);
+ strncpy_s(achDbgContext, ARRAY_SIZE(achDbgContext), "", _TRUNCATE);
}
else
{
- strncat_s(achDbgContext, COUNTOF(achDbgContext), pDebugClassName, _TRUNCATE);
- strncat_s(achDbgContext, COUNTOF(achDbgContext), NAMESPACE_SEPARATOR_STR, _TRUNCATE);
- strncat_s(achDbgContext, COUNTOF(achDbgContext), pDebugName, _TRUNCATE);
- strncat_s(achDbgContext, COUNTOF(achDbgContext), " ", _TRUNCATE);
+ strncat_s(achDbgContext, ARRAY_SIZE(achDbgContext), pDebugClassName, _TRUNCATE);
+ strncat_s(achDbgContext, ARRAY_SIZE(achDbgContext), NAMESPACE_SEPARATOR_STR, _TRUNCATE);
+ strncat_s(achDbgContext, ARRAY_SIZE(achDbgContext), pDebugName, _TRUNCATE);
+ strncat_s(achDbgContext, ARRAY_SIZE(achDbgContext), " ", _TRUNCATE);
switch (argidx)
{
case (UINT)-1:
- strncat_s(achDbgContext, COUNTOF(achDbgContext), "field", _TRUNCATE);
+ strncat_s(achDbgContext, ARRAY_SIZE(achDbgContext), "field", _TRUNCATE);
break;
case 0:
- strncat_s(achDbgContext, COUNTOF(achDbgContext), "return value", _TRUNCATE);
+ strncat_s(achDbgContext, ARRAY_SIZE(achDbgContext), "return value", _TRUNCATE);
break;
default:
{
char buf[30];
- sprintf_s(buf, COUNTOF(buf), "param #%lu", (ULONG)argidx);
- strncat_s(achDbgContext, COUNTOF(achDbgContext), buf, _TRUNCATE);
+ sprintf_s(buf, ARRAY_SIZE(buf), "param #%lu", (ULONG)argidx);
+ strncat_s(achDbgContext, ARRAY_SIZE(achDbgContext), buf, _TRUNCATE);
}
}
}
@@ -2896,7 +2896,7 @@ UINT16 MarshalInfo::GetNativeSize(MarshalType mtype)
#include "mtypes.h"
};
- _ASSERTE((SIZE_T)mtype < COUNTOF(nativeSizes));
+ _ASSERTE((SIZE_T)mtype < ARRAY_SIZE(nativeSizes));
BYTE nativeSize = nativeSizes[mtype];
if (nativeSize == VARIABLESIZE)
@@ -2959,7 +2959,7 @@ OVERRIDEPROC MarshalInfo::GetArgumentOverrideProc(MarshalType mtype)
#include "mtypes.h"
};
- _ASSERTE((SIZE_T)mtype < COUNTOF(ILArgumentOverrideProcs));
+ _ASSERTE((SIZE_T)mtype < ARRAY_SIZE(ILArgumentOverrideProcs));
return ILArgumentOverrideProcs[mtype];
}
@@ -2979,7 +2979,7 @@ RETURNOVERRIDEPROC MarshalInfo::GetReturnOverrideProc(MarshalType mtype)
#include "mtypes.h"
};
- _ASSERTE((SIZE_T)mtype < COUNTOF(ILReturnOverrideProcs));
+ _ASSERTE((SIZE_T)mtype < ARRAY_SIZE(ILReturnOverrideProcs));
return ILReturnOverrideProcs[mtype];
}
@@ -3172,7 +3172,7 @@ VOID MarshalInfo::DumpMarshalInfo(Module* pModule, SigPointer sig, const SigType
while (cbNativeType--)
{
char num[100];
- sprintf_s(num, COUNTOF(num), "0x%lx ", (ULONG)*pvNativeType);
+ sprintf_s(num, ARRAY_SIZE(num), "0x%lx ", (ULONG)*pvNativeType);
logbuf.AppendASCII(num);
switch (*(pvNativeType++))
{
@@ -3314,7 +3314,7 @@ VOID MarshalInfo::DumpMarshalInfo(Module* pModule, SigPointer sig, const SigType
logbuf.AppendASCII("MarshalType : ");
{
char num[100];
- sprintf_s(num, COUNTOF(num), "0x%lx ", (ULONG)m_type);
+ sprintf_s(num, ARRAY_SIZE(num), "0x%lx ", (ULONG)m_type);
logbuf.AppendASCII(num);
}
switch (m_type)
diff --git a/src/coreclr/vm/multicorejit.cpp b/src/coreclr/vm/multicorejit.cpp
index 2ad518bf9f7361..b747608a184783 100644
--- a/src/coreclr/vm/multicorejit.cpp
+++ b/src/coreclr/vm/multicorejit.cpp
@@ -1551,7 +1551,7 @@ DWORD MulticoreJitManager::EncodeModuleHelper(void * pModuleContext, Module * pR
// wszProfile - profile name
// ptrNativeAssemblyBinder - the binding context
//
-extern "C" void QCALLTYPE MultiCoreJIT_InternalStartProfile(__in_z LPCWSTR wszProfile, INT_PTR ptrNativeAssemblyBinder)
+extern "C" void QCALLTYPE MultiCoreJIT_InternalStartProfile(_In_z_ LPCWSTR wszProfile, INT_PTR ptrNativeAssemblyBinder)
{
QCALL_CONTRACT;
@@ -1570,7 +1570,7 @@ extern "C" void QCALLTYPE MultiCoreJIT_InternalStartProfile(__in_z LPCWSTR wszPr
}
-extern "C" void QCALLTYPE MultiCoreJIT_InternalSetProfileRoot(__in_z LPCWSTR wszProfilePath)
+extern "C" void QCALLTYPE MultiCoreJIT_InternalSetProfileRoot(_In_z_ LPCWSTR wszProfilePath)
{
QCALL_CONTRACT;
diff --git a/src/coreclr/vm/multicorejit.h b/src/coreclr/vm/multicorejit.h
index 7faff54d9485c7..f4e38c6dc0953b 100644
--- a/src/coreclr/vm/multicorejit.h
+++ b/src/coreclr/vm/multicorejit.h
@@ -313,7 +313,7 @@ class MulticoreJitManager
// For qcallentrypoints.cpp
-extern "C" void QCALLTYPE MultiCoreJIT_InternalSetProfileRoot(__in_z LPCWSTR directoryPath);
-extern "C" void QCALLTYPE MultiCoreJIT_InternalStartProfile(__in_z LPCWSTR wszProfile, INT_PTR ptrNativeAssemblyBinder);
+extern "C" void QCALLTYPE MultiCoreJIT_InternalSetProfileRoot(_In_z_ LPCWSTR directoryPath);
+extern "C" void QCALLTYPE MultiCoreJIT_InternalStartProfile(_In_z_ LPCWSTR wszProfile, INT_PTR ptrNativeAssemblyBinder);
#endif // __MULTICORE_JIT_H__
diff --git a/src/coreclr/vm/nativeeventsource.cpp b/src/coreclr/vm/nativeeventsource.cpp
index 45550259079ee0..751e8e625aad78 100644
--- a/src/coreclr/vm/nativeeventsource.cpp
+++ b/src/coreclr/vm/nativeeventsource.cpp
@@ -13,7 +13,7 @@
#if defined(FEATURE_EVENTSOURCE_XPLAT)
-extern "C" void QCALLTYPE LogEventSource(__in_z int eventID, __in_z LPCWSTR eventName, __in_z LPCWSTR eventSourceName, __in_z LPCWSTR payload)
+extern "C" void QCALLTYPE LogEventSource(_In_z_ int eventID, _In_z_ LPCWSTR eventName, _In_z_ LPCWSTR eventSourceName, _In_z_ LPCWSTR payload)
{
QCALL_CONTRACT;
BEGIN_QCALL;
@@ -44,7 +44,7 @@ extern "C" BOOL QCALLTYPE IsEventSourceLoggingEnabled()
// change genRuntimeEventSources.py script to not emit the body that throws NotImplementedException for the event that
// want to be fired from managed code.
// See https://github.com/dotnet/runtime/pull/47829 for an example of how to do this.
-extern "C" void QCALLTYPE LogThreadPoolWorkerThreadStart(__in_z uint activeWorkerThreadCount, __in_z uint retiredWorkerThreadCount, __in_z short clrInstanceID)
+extern "C" void QCALLTYPE LogThreadPoolWorkerThreadStart(_In_z_ uint activeWorkerThreadCount, _In_z_ uint retiredWorkerThreadCount, _In_z_ short clrInstanceID)
{
QCALL_CONTRACT;
BEGIN_QCALL;
@@ -54,7 +54,7 @@ extern "C" void QCALLTYPE LogThreadPoolWorkerThreadStart(__in_z uint activeWorke
END_QCALL;
}
-extern "C" void QCALLTYPE LogThreadPoolWorkerThreadStop(__in_z uint activeWorkerThreadCount, __in_z uint retiredWorkerThreadCount, __in_z short clrInstanceID)
+extern "C" void QCALLTYPE LogThreadPoolWorkerThreadStop(_In_z_ uint activeWorkerThreadCount, _In_z_ uint retiredWorkerThreadCount, _In_z_ short clrInstanceID)
{
QCALL_CONTRACT;
BEGIN_QCALL;
@@ -64,7 +64,7 @@ extern "C" void QCALLTYPE LogThreadPoolWorkerThreadStop(__in_z uint activeWorker
END_QCALL;
}
-extern "C" void QCALLTYPE LogThreadPoolWorkerThreadWait(__in_z uint activeWorkerThreadCount, __in_z uint retiredWorkerThreadCount, __in_z short clrInstanceID)
+extern "C" void QCALLTYPE LogThreadPoolWorkerThreadWait(_In_z_ uint activeWorkerThreadCount, _In_z_ uint retiredWorkerThreadCount, _In_z_ short clrInstanceID)
{
QCALL_CONTRACT;
BEGIN_QCALL;
@@ -74,7 +74,7 @@ extern "C" void QCALLTYPE LogThreadPoolWorkerThreadWait(__in_z uint activeWorker
END_QCALL;
}
-extern "C" void QCALLTYPE LogThreadPoolWorkerThreadAdjustmentSample(__in_z double throughput, __in_z short clrInstanceID)
+extern "C" void QCALLTYPE LogThreadPoolWorkerThreadAdjustmentSample(_In_z_ double throughput, _In_z_ short clrInstanceID)
{
QCALL_CONTRACT;
BEGIN_QCALL;
@@ -84,7 +84,7 @@ extern "C" void QCALLTYPE LogThreadPoolWorkerThreadAdjustmentSample(__in_z doubl
END_QCALL;
}
-extern "C" void QCALLTYPE LogThreadPoolWorkerThreadAdjustmentAdjustment(__in_z double averageThroughput, __in_z uint newWorkerThreadCount, __in_z uint reason, __in_z short clrInstanceID)
+extern "C" void QCALLTYPE LogThreadPoolWorkerThreadAdjustmentAdjustment(_In_z_ double averageThroughput, _In_z_ uint newWorkerThreadCount, _In_z_ uint reason, _In_z_ short clrInstanceID)
{
QCALL_CONTRACT;
BEGIN_QCALL;
@@ -94,7 +94,7 @@ extern "C" void QCALLTYPE LogThreadPoolWorkerThreadAdjustmentAdjustment(__in_z d
END_QCALL;
}
-extern "C" void QCALLTYPE LogThreadPoolWorkerThreadAdjustmentStats(__in_z double duration, __in_z double throughput, __in_z double threadWave, __in_z double throughputWave, __in_z double throughputErrorEstimate, __in_z double AverageThroughputErrorEstimate, __in_z double ThroughputRatio, __in_z double confidence, __in_z double newControlSetting, __in_z short newThreadWaveMagnitude, __in_z short ClrInstanceID)
+extern "C" void QCALLTYPE LogThreadPoolWorkerThreadAdjustmentStats(_In_z_ double duration, _In_z_ double throughput, _In_z_ double threadWave, _In_z_ double throughputWave, _In_z_ double throughputErrorEstimate, _In_z_ double AverageThroughputErrorEstimate, _In_z_ double ThroughputRatio, _In_z_ double confidence, _In_z_ double newControlSetting, _In_z_ short newThreadWaveMagnitude, _In_z_ short ClrInstanceID)
{
QCALL_CONTRACT;
BEGIN_QCALL;
@@ -104,7 +104,7 @@ extern "C" void QCALLTYPE LogThreadPoolWorkerThreadAdjustmentStats(__in_z double
END_QCALL;
}
-extern "C" void QCALLTYPE LogThreadPoolIOEnqueue(__in_z void* nativeOverlapped, __in_z void* overlapped, __in_z bool multiDequeues, __in_z short ClrInstanceID)
+extern "C" void QCALLTYPE LogThreadPoolIOEnqueue(_In_z_ void* nativeOverlapped, _In_z_ void* overlapped, _In_z_ bool multiDequeues, _In_z_ short ClrInstanceID)
{
QCALL_CONTRACT;
BEGIN_QCALL;
@@ -114,7 +114,7 @@ extern "C" void QCALLTYPE LogThreadPoolIOEnqueue(__in_z void* nativeOverlapped,
END_QCALL;
}
-extern "C" void QCALLTYPE LogThreadPoolIODequeue(__in_z void* nativeOverlapped, __in_z void* overlapped, __in_z short ClrInstanceID)
+extern "C" void QCALLTYPE LogThreadPoolIODequeue(_In_z_ void* nativeOverlapped, _In_z_ void* overlapped, _In_z_ short ClrInstanceID)
{
QCALL_CONTRACT;
BEGIN_QCALL;
@@ -124,7 +124,7 @@ extern "C" void QCALLTYPE LogThreadPoolIODequeue(__in_z void* nativeOverlapped,
END_QCALL;
}
-extern "C" void QCALLTYPE LogThreadPoolWorkingThreadCount(__in_z uint count, __in_z short ClrInstanceID)
+extern "C" void QCALLTYPE LogThreadPoolWorkingThreadCount(_In_z_ uint count, _In_z_ short ClrInstanceID)
{
QCALL_CONTRACT;
BEGIN_QCALL;
diff --git a/src/coreclr/vm/nativeeventsource.h b/src/coreclr/vm/nativeeventsource.h
index 34313b04bcc6e1..9dbb751261de68 100644
--- a/src/coreclr/vm/nativeeventsource.h
+++ b/src/coreclr/vm/nativeeventsource.h
@@ -15,17 +15,17 @@
#include "qcall.h"
#if defined(FEATURE_PERFTRACING)
-extern "C" void QCALLTYPE LogEventSource(__in_z int eventID, __in_z LPCWSTR eventName, __in_z LPCWSTR eventSourceName, __in_z LPCWSTR payload);
+extern "C" void QCALLTYPE LogEventSource(_In_z_ int eventID, _In_z_ LPCWSTR eventName, _In_z_ LPCWSTR eventSourceName, _In_z_ LPCWSTR payload);
extern "C" BOOL QCALLTYPE IsEventSourceLoggingEnabled();
-extern "C" void QCALLTYPE LogThreadPoolWorkerThreadStart(__in_z uint activeWorkerThreadCount, __in_z uint retiredWorkerThreadCount, __in_z short clrInstanceID);
-extern "C" void QCALLTYPE LogThreadPoolWorkerThreadStop(__in_z uint activeWorkerThreadCount, __in_z uint retiredWorkerThreadCount, __in_z short clrInstanceID);
-extern "C" void QCALLTYPE LogThreadPoolWorkerThreadWait(__in_z uint activeWorkerThreadCount, __in_z uint retiredWorkerThreadCount, __in_z short clrInstanceID);
-extern "C" void QCALLTYPE LogThreadPoolWorkerThreadAdjustmentSample(__in_z double throughput, __in_z short clrInstanceID);
-extern "C" void QCALLTYPE LogThreadPoolWorkerThreadAdjustmentAdjustment(__in_z double averageThroughput, __in_z uint newWorkerThreadCount, __in_z uint reason, __in_z short clrInstanceID);
-extern "C" void QCALLTYPE LogThreadPoolWorkerThreadAdjustmentStats(__in_z double duration, __in_z double throughput, __in_z double threadWave, __in_z double throughputWave, __in_z double throughputErrorEstimate, __in_z double AverageThroughputErrorEstimate, __in_z double ThroughputRatio, __in_z double confidence, __in_z double newControlSetting, __in_z short newThreadWaveMagnitude, __in_z short ClrInstanceID);
-extern "C" void QCALLTYPE LogThreadPoolIOEnqueue(__in_z void* nativeOverlapped, __in_z void* overlapped, __in_z bool multiDequeues, __in_z short ClrInstanceID);
-extern "C" void QCALLTYPE LogThreadPoolIODequeue(__in_z void* nativeOverlapped, __in_z void* overlapped, __in_z short ClrInstanceID);
-extern "C" void QCALLTYPE LogThreadPoolWorkingThreadCount(__in_z uint count, __in_z short ClrInstanceID);
+extern "C" void QCALLTYPE LogThreadPoolWorkerThreadStart(_In_z_ uint activeWorkerThreadCount, _In_z_ uint retiredWorkerThreadCount, _In_z_ short clrInstanceID);
+extern "C" void QCALLTYPE LogThreadPoolWorkerThreadStop(_In_z_ uint activeWorkerThreadCount, _In_z_ uint retiredWorkerThreadCount, _In_z_ short clrInstanceID);
+extern "C" void QCALLTYPE LogThreadPoolWorkerThreadWait(_In_z_ uint activeWorkerThreadCount, _In_z_ uint retiredWorkerThreadCount, _In_z_ short clrInstanceID);
+extern "C" void QCALLTYPE LogThreadPoolWorkerThreadAdjustmentSample(_In_z_ double throughput, _In_z_ short clrInstanceID);
+extern "C" void QCALLTYPE LogThreadPoolWorkerThreadAdjustmentAdjustment(_In_z_ double averageThroughput, _In_z_ uint newWorkerThreadCount, _In_z_ uint reason, _In_z_ short clrInstanceID);
+extern "C" void QCALLTYPE LogThreadPoolWorkerThreadAdjustmentStats(_In_z_ double duration, _In_z_ double throughput, _In_z_ double threadWave, _In_z_ double throughputWave, _In_z_ double throughputErrorEstimate, _In_z_ double AverageThroughputErrorEstimate, _In_z_ double ThroughputRatio, _In_z_ double confidence, _In_z_ double newControlSetting, _In_z_ short newThreadWaveMagnitude, _In_z_ short ClrInstanceID);
+extern "C" void QCALLTYPE LogThreadPoolIOEnqueue(_In_z_ void* nativeOverlapped, _In_z_ void* overlapped, _In_z_ bool multiDequeues, _In_z_ short ClrInstanceID);
+extern "C" void QCALLTYPE LogThreadPoolIODequeue(_In_z_ void* nativeOverlapped, _In_z_ void* overlapped, _In_z_ short ClrInstanceID);
+extern "C" void QCALLTYPE LogThreadPoolWorkingThreadCount(_In_z_ uint count, _In_z_ short ClrInstanceID);
#endif // defined(FEATURE_PERFTRACING)
#endif //_NATIVEEVENTSOURCE_H_
diff --git a/src/coreclr/vm/nativelibrary.cpp b/src/coreclr/vm/nativelibrary.cpp
index 9ec47c423311fd..d5a91b4863c2fc 100644
--- a/src/coreclr/vm/nativelibrary.cpp
+++ b/src/coreclr/vm/nativelibrary.cpp
@@ -526,7 +526,7 @@ namespace
SString::CIterator it = libName.Begin();
if (libName.Find(it, PLATFORM_SHARED_LIB_SUFFIX_W))
{
- it += COUNTOF(PLATFORM_SHARED_LIB_SUFFIX_W);
+ it += ARRAY_SIZE(PLATFORM_SHARED_LIB_SUFFIX_W);
containsSuffix = it == libName.End() || *it == (WCHAR)'.';
}
@@ -648,7 +648,7 @@ namespace
// (both of these are typically done to smooth over cross-platform differences).
// We try to dlopen with such variations on the original.
const WCHAR* prefixSuffixCombinations[MaxVariationCount] = {};
- int numberOfVariations = COUNTOF(prefixSuffixCombinations);
+ int numberOfVariations = ARRAY_SIZE(prefixSuffixCombinations);
DetermineLibNameVariations(prefixSuffixCombinations, &numberOfVariations, wszLibName, libNameIsRelativePath);
for (int i = 0; i < numberOfVariations; i++)
{
diff --git a/src/coreclr/vm/object.cpp b/src/coreclr/vm/object.cpp
index 6b64f72e5e2805..4a0ac960e9ace9 100644
--- a/src/coreclr/vm/object.cpp
+++ b/src/coreclr/vm/object.cpp
@@ -852,7 +852,7 @@ STRINGREF* StringObject::InitEmptyStringRefPtr() {
// strAChars must be null-terminated, with an appropriate aLength
// strBChars must be null-terminated, with an appropriate bLength OR bLength == -1
// If bLength == -1, we stop on the first null character in strBChars
-BOOL StringObject::CaseInsensitiveCompHelper(__in_ecount(aLength) WCHAR *strAChars, __in_z INT8 *strBChars, INT32 aLength, INT32 bLength, INT32 *result) {
+BOOL StringObject::CaseInsensitiveCompHelper(_In_reads_(aLength) WCHAR *strAChars, _In_z_ INT8 *strBChars, INT32 aLength, INT32 bLength, INT32 *result) {
CONTRACTL {
NOTHROW;
GC_NOTRIGGER;
diff --git a/src/coreclr/vm/object.h b/src/coreclr/vm/object.h
index a47adb8c7985c8..0f4033f45b507b 100644
--- a/src/coreclr/vm/object.h
+++ b/src/coreclr/vm/object.h
@@ -444,7 +444,7 @@ class Object
// we must zero out the lowest 2 bits on 32-bit and 3 bits on 64-bit.
#ifdef TARGET_64BIT
return dac_cast((dac_cast(m_pMethTab)) & ~((UINT_PTR)7));
-#else
+#else
return dac_cast((dac_cast(m_pMethTab)) & ~((UINT_PTR)3));
#endif //TARGET_64BIT
}
@@ -935,7 +935,7 @@ class StringObject : public Object
BOOL HasTrailByte();
BOOL GetTrailByte(BYTE *bTrailByte);
BOOL SetTrailByte(BYTE bTrailByte);
- static BOOL CaseInsensitiveCompHelper(__in_ecount(aLength) WCHAR * strA, __in_z INT8 * strB, int aLength, int bLength, int *result);
+ static BOOL CaseInsensitiveCompHelper(_In_reads_(aLength) WCHAR * strA, _In_z_ INT8 * strB, int aLength, int bLength, int *result);
/*=================RefInterpretGetStringValuesDangerousForGC======================
**N.B.: This perfoms no range checking and relies on the caller to have done this.
@@ -948,7 +948,7 @@ class StringObject : public Object
// !!!! If you use this function, you have to be careful because chars is a pointer
// !!!! to the data buffer of ref. If GC happens after this call, you need to make
// !!!! sure that you have a pin handle on ref, or use GCPROTECT_BEGINPINNING on ref.
- void RefInterpretGetStringValuesDangerousForGC(__deref_out_ecount(*length + 1) WCHAR **chars, int *length) {
+ void RefInterpretGetStringValuesDangerousForGC(_Outptr_result_buffer_(*length + 1) WCHAR **chars, int *length) {
WRAPPER_NO_CONTRACT;
_ASSERTE(GetGCSafeMethodTable() == g_pStringClass);
diff --git a/src/coreclr/vm/peimage.cpp b/src/coreclr/vm/peimage.cpp
index 4c517a1bd3e5f4..1b72b89106df65 100644
--- a/src/coreclr/vm/peimage.cpp
+++ b/src/coreclr/vm/peimage.cpp
@@ -18,7 +18,6 @@
#ifndef DACCESS_COMPILE
-
CrstStatic PEImage::s_hashLock;
PtrHashMap *PEImage::s_Images = NULL;
CrstStatic PEImage::s_ijwHashLock;
@@ -95,7 +94,7 @@ PEImage::~PEImage()
if(m_hFile!=INVALID_HANDLE_VALUE)
CloseHandle(m_hFile);
- for (unsigned int i=0;iRelease();
@@ -754,7 +753,7 @@ PEImage::PEImage():
MODE_ANY;
}
CONTRACTL_END;
- for (DWORD i=0;i= COUNTOF(gElementTypeInfo))
+ if ((UINT)etype >= ARRAY_SIZE(gElementTypeInfo))
ThrowHR(COR_E_BADIMAGEFORMAT, BFA_BAD_COMPLUS_SIG);
int cbsize = gElementTypeInfo[(UINT)etype].m_cbSize;
diff --git a/src/coreclr/vm/sourceline.cpp b/src/coreclr/vm/sourceline.cpp
index d9adddf230c200..305358484aee0e 100644
--- a/src/coreclr/vm/sourceline.cpp
+++ b/src/coreclr/vm/sourceline.cpp
@@ -127,7 +127,7 @@ class CCallback : public IDiaLoadCallback
//////////////////////////////////////////////////////////////////
-bool SourceLine::LoadDataFromPdb( __in_z LPWSTR wszFilename )
+bool SourceLine::LoadDataFromPdb( _In_z_ LPWSTR wszFilename )
{
CONTRACTL {
THROWS;
@@ -172,7 +172,7 @@ bool SourceLine::LoadDataFromPdb( __in_z LPWSTR wszFilename )
//////////////////////////////////////////////////////////////////
-SourceLine::SourceLine( __in_z LPWSTR pszFileName )
+SourceLine::SourceLine( _In_z_ LPWSTR pszFileName )
{
WRAPPER_NO_CONTRACT;
if (LoadDataFromPdb(pszFileName)) {
@@ -185,7 +185,7 @@ SourceLine::SourceLine( __in_z LPWSTR pszFileName )
//////////////////////////////////////////////////////////////////
-HRESULT SourceLine::GetSourceLine( DWORD dwFunctionToken, DWORD dwOffset, __out_ecount(dwFileNameMaxLen) __out_z LPWSTR pszFileName, DWORD dwFileNameMaxLen, PDWORD pdwLineNumber )
+HRESULT SourceLine::GetSourceLine( DWORD dwFunctionToken, DWORD dwOffset, _Out_writes_z_(dwFileNameMaxLen) LPWSTR pszFileName, DWORD dwFileNameMaxLen, PDWORD pdwLineNumber )
{
CONTRACTL {
THROWS;
@@ -242,7 +242,7 @@ HRESULT SourceLine::GetSourceLine( DWORD dwFunctionToken, DWORD dwOffset, __out_
//////////////////////////////////////////////////////////////////
-HRESULT SourceLine::GetLocalName( DWORD dwFunctionToken, DWORD dwSlot, __out_ecount(dwNameMaxLen) __out_z LPWSTR pszName, DWORD dwNameMaxLen )
+HRESULT SourceLine::GetLocalName( DWORD dwFunctionToken, DWORD dwSlot, _Out_writes_z_(dwNameMaxLen) LPWSTR pszName, DWORD dwNameMaxLen )
{
CONTRACTL {
THROWS;
@@ -307,19 +307,19 @@ HRESULT SourceLine::GetLocalName( DWORD dwFunctionToken, DWORD dwSlot, __out_eco
}
#else // !ENABLE_DIAGNOSTIC_SYMBOL_READING
-SourceLine::SourceLine( __in_z LPWSTR pszFileName )
+SourceLine::SourceLine( _In_z_ LPWSTR pszFileName )
{
LIMITED_METHOD_CONTRACT;
initialized_ = false;
}
-HRESULT SourceLine::GetSourceLine( DWORD dwFunctionToken, DWORD dwOffset, __out_ecount(dwFileNameMaxLen) __out_z LPWSTR pszFileName, DWORD dwFileNameMaxLen, PDWORD pdwLineNumber )
+HRESULT SourceLine::GetSourceLine( DWORD dwFunctionToken, DWORD dwOffset, _Out_writes_z_(dwFileNameMaxLen) LPWSTR pszFileName, DWORD dwFileNameMaxLen, PDWORD pdwLineNumber )
{
LIMITED_METHOD_CONTRACT;
return E_NOTIMPL;
}
-HRESULT SourceLine::GetLocalName( DWORD dwFunctionToken, DWORD dwSlot, __out_ecount(dwNameMaxLen) __out_z LPWSTR pszName, DWORD dwNameMaxLen )
+HRESULT SourceLine::GetLocalName( DWORD dwFunctionToken, DWORD dwSlot, _Out_writes_z_(dwNameMaxLen) LPWSTR pszName, DWORD dwNameMaxLen )
{
LIMITED_METHOD_CONTRACT;
return E_NOTIMPL;
diff --git a/src/coreclr/vm/sourceline.h b/src/coreclr/vm/sourceline.h
index 2ab99344b9f31e..3c241d4328a00b 100644
--- a/src/coreclr/vm/sourceline.h
+++ b/src/coreclr/vm/sourceline.h
@@ -21,23 +21,23 @@ class SourceLine
CComPtr(IDiaSymbol) pGlobal_;
CComPtr(IDiaSession) pSession_;
- bool LoadDataFromPdb( __in_z LPWSTR wszFilename );
+ bool LoadDataFromPdb( _In_z_ LPWSTR wszFilename );
#endif // ENABLE_DIAGNOSTIC_SYMBOL_READING
public:
- SourceLine( __in_z LPWSTR pszFileName );
+ SourceLine( _In_z_ LPWSTR pszFileName );
bool IsInitialized() { return initialized_; }
//
// Given function token (methoddef) and offset, return filename and line number
//
- HRESULT GetSourceLine( DWORD dwFunctionToken, DWORD dwOffset, __out_ecount(dwFileNameMaxLen) __out_z LPWSTR wszFileName, DWORD dwFileNameMaxLen, PDWORD pdwLineNumber );
+ HRESULT GetSourceLine( DWORD dwFunctionToken, DWORD dwOffset, _Out_writes_z_(dwFileNameMaxLen) LPWSTR wszFileName, DWORD dwFileNameMaxLen, PDWORD pdwLineNumber );
//
// Given function token (methoddef) and slot, return name of the local variable
//
- HRESULT GetLocalName( DWORD dwFunctionToken, DWORD dwSlot, __out_ecount(dwNameMaxLen) __out_z LPWSTR wszName, DWORD dwNameMaxLen );
+ HRESULT GetLocalName( DWORD dwFunctionToken, DWORD dwSlot, _Out_writes_z_(dwNameMaxLen) LPWSTR wszName, DWORD dwNameMaxLen );
};
#endif // __SOURCELINE_H__
diff --git a/src/coreclr/vm/stackwalk.cpp b/src/coreclr/vm/stackwalk.cpp
index 45bdf3088db074..18345aec77ac24 100644
--- a/src/coreclr/vm/stackwalk.cpp
+++ b/src/coreclr/vm/stackwalk.cpp
@@ -755,7 +755,7 @@ UINT_PTR Thread::VirtualUnwindToFirstManagedCallFrame(T_CONTEXT* pContext)
#endif // FEATURE_EH_FUNCLETS
#ifdef _DEBUG
-void Thread::DebugLogStackWalkInfo(CrawlFrame* pCF, __in_z LPCSTR pszTag, UINT32 uFramesProcessed)
+void Thread::DebugLogStackWalkInfo(CrawlFrame* pCF, _In_z_ LPCSTR pszTag, UINT32 uFramesProcessed)
{
LIMITED_METHOD_CONTRACT;
SUPPORTS_DAC;
diff --git a/src/coreclr/vm/stdinterfaces.cpp b/src/coreclr/vm/stdinterfaces.cpp
index 094b5ab407b187..4ccee10d1a634e 100644
--- a/src/coreclr/vm/stdinterfaces.cpp
+++ b/src/coreclr/vm/stdinterfaces.cpp
@@ -1152,7 +1152,7 @@ Dispatch_GetTypeInfo(IDispatch* pDisp, unsigned int itinfo, LCID lcid, ITypeInfo
}
HRESULT __stdcall
-Dispatch_GetIDsOfNames(IDispatch* pDisp, REFIID riid, __in_ecount(cNames) OLECHAR **rgszNames, unsigned int cNames, LCID lcid, DISPID *rgdispid)
+Dispatch_GetIDsOfNames(IDispatch* pDisp, REFIID riid, _In_reads_(cNames) OLECHAR **rgszNames, unsigned int cNames, LCID lcid, DISPID *rgdispid)
{
CONTRACTL
{
@@ -1231,7 +1231,7 @@ OleAutDispatchImpl_GetIDsOfNames
(
IDispatch* pDisp,
REFIID riid,
- __in_ecount(cNames) OLECHAR **rgszNames,
+ _In_reads_(cNames) OLECHAR **rgszNames,
unsigned int cNames,
LCID lcid,
DISPID *rgdispid
@@ -1334,7 +1334,7 @@ HRESULT __stdcall
InternalDispatchImpl_GetIDsOfNames (
IDispatch* pDisp,
REFIID riid,
- __in_ecount(cNames) OLECHAR **rgszNames,
+ _In_reads_(cNames) OLECHAR **rgszNames,
unsigned int cNames,
LCID lcid,
DISPID *rgdispid)
@@ -1560,7 +1560,7 @@ HRESULT __stdcall DispatchEx_GetTypeInfo (
HRESULT __stdcall DispatchEx_GetIDsOfNames (
IDispatchEx* pDisp,
REFIID riid,
- __in_ecount(cNames) OLECHAR **rgszNames,
+ _In_reads_(cNames) OLECHAR **rgszNames,
unsigned int cNames,
LCID lcid,
DISPID *rgdispid
diff --git a/src/coreclr/vm/stdinterfaces.h b/src/coreclr/vm/stdinterfaces.h
index db04fd93b08afd..fb3871f4434f76 100644
--- a/src/coreclr/vm/stdinterfaces.h
+++ b/src/coreclr/vm/stdinterfaces.h
@@ -168,7 +168,7 @@ HRESULT __stdcall Dispatch_GetTypeInfo_Wrapper (
HRESULT __stdcall Dispatch_GetIDsOfNames_Wrapper (
IDispatch* pDisp,
REFIID riid,
- __in_ecount(cNames) OLECHAR **rgszNames,
+ _In_reads_(cNames) OLECHAR **rgszNames,
unsigned int cNames,
LCID lcid,
DISPID *rgdispid);
@@ -190,7 +190,7 @@ HRESULT __stdcall Dispatch_Invoke_Wrapper (
HRESULT __stdcall InternalDispatchImpl_GetIDsOfNames_Wrapper (
IDispatch* pDisp,
REFIID riid,
- __in_ecount(cNames) OLECHAR **rgszNames,
+ _In_reads_(cNames) OLECHAR **rgszNames,
unsigned int cNames,
LCID lcid,
DISPID *rgdispid);
@@ -229,7 +229,7 @@ HRESULT __stdcall DispatchEx_GetTypeInfo_Wrapper (
HRESULT __stdcall DispatchEx_GetIDsOfNames_Wrapper (
IDispatchEx* pDisp,
REFIID riid,
- __in_ecount(cNames) OLECHAR **rgszNames,
+ _In_reads_(cNames) OLECHAR **rgszNames,
unsigned int cNames,
LCID lcid,
DISPID *rgdispid);
@@ -384,7 +384,7 @@ HRESULT __stdcall
InternalDispatchImpl_GetIDsOfNames (
IDispatch* pDisp,
REFIID riid,
- __in_ecount(cNames) OLECHAR **rgszNames,
+ _In_reads_(cNames) OLECHAR **rgszNames,
unsigned int cNames,
LCID lcid,
DISPID *rgdispid);
diff --git a/src/coreclr/vm/stdinterfaces_internal.h b/src/coreclr/vm/stdinterfaces_internal.h
index acabf15be1d842..bd1b7b336a2a0b 100644
--- a/src/coreclr/vm/stdinterfaces_internal.h
+++ b/src/coreclr/vm/stdinterfaces_internal.h
@@ -76,7 +76,7 @@ HRESULT __stdcall Dispatch_GetTypeInfo (
HRESULT __stdcall Dispatch_GetIDsOfNames (
IDispatch* pDisp,
REFIID riid,
- __in_ecount(cNames) OLECHAR **rgszNames,
+ _In_reads_(cNames) OLECHAR **rgszNames,
unsigned int cNames,
LCID lcid,
DISPID *rgdispid);
@@ -102,7 +102,7 @@ HRESULT __stdcall Dispatch_Invoke (
HRESULT __stdcall OleAutDispatchImpl_GetIDsOfNames (
IDispatch* pDisp,
REFIID riid,
- __in_ecount(cNames) OLECHAR **rgszNames,
+ _In_reads_(cNames) OLECHAR **rgszNames,
unsigned int cNames,
LCID lcid,
DISPID *rgdispid);
@@ -129,7 +129,7 @@ HRESULT __stdcall OleAutDispatchImpl_Invoke (
HRESULT __stdcall InternalDispatchImpl_GetIDsOfNames (
IDispatch* pDisp,
REFIID riid,
- __in_ecount(cNames) OLECHAR **rgszNames,
+ _In_reads_(cNames) OLECHAR **rgszNames,
unsigned int cNames,
LCID lcid,
DISPID *rgdispid);
@@ -168,7 +168,7 @@ HRESULT __stdcall DispatchEx_GetTypeInfo (
HRESULT __stdcall DispatchEx_GetIDsOfNames (
IDispatchEx* pDisp,
REFIID riid,
- __in_ecount(cNames) OLECHAR **rgszNames,
+ _In_reads_(cNames) OLECHAR **rgszNames,
unsigned int cNames,
LCID lcid,
DISPID *rgdispid);
diff --git a/src/coreclr/vm/stdinterfaces_wrapper.cpp b/src/coreclr/vm/stdinterfaces_wrapper.cpp
index 91fc46651952b9..400d90405e7e52 100644
--- a/src/coreclr/vm/stdinterfaces_wrapper.cpp
+++ b/src/coreclr/vm/stdinterfaces_wrapper.cpp
@@ -1016,7 +1016,7 @@ VOID __stdcall Dispatch_GetIDsOfNames_CallBack(LPVOID ptr)
}
}
-HRESULT __stdcall Dispatch_GetIDsOfNames_Wrapper(IDispatch* pDisp, REFIID riid, __in_ecount(cNames) OLECHAR **rgszNames,
+HRESULT __stdcall Dispatch_GetIDsOfNames_Wrapper(IDispatch* pDisp, REFIID riid, _In_reads_(cNames) OLECHAR **rgszNames,
unsigned int cNames, LCID lcid, DISPID *rgdispid)
{
SetupForComCallHR();
@@ -1062,7 +1062,7 @@ VOID __stdcall InternalDispatchImpl_GetIDsOfNames_CallBack(LPVOID ptr)
}
}
-HRESULT __stdcall InternalDispatchImpl_GetIDsOfNames_Wrapper(IDispatch* pDisp, REFIID riid, __in_ecount(cNames) OLECHAR **rgszNames,
+HRESULT __stdcall InternalDispatchImpl_GetIDsOfNames_Wrapper(IDispatch* pDisp, REFIID riid, _In_reads_(cNames) OLECHAR **rgszNames,
unsigned int cNames, LCID lcid, DISPID *rgdispid)
{
SetupForComCallHR();
@@ -1341,7 +1341,7 @@ VOID __stdcall DispatchEx_GetIDsOfNames_CallBack(LPVOID ptr)
}
}
-HRESULT __stdcall DispatchEx_GetIDsOfNames_Wrapper(IDispatchEx* pDisp, REFIID riid, __in_ecount(cNames) OLECHAR **rgszNames,
+HRESULT __stdcall DispatchEx_GetIDsOfNames_Wrapper(IDispatchEx* pDisp, REFIID riid, _In_reads_(cNames) OLECHAR **rgszNames,
unsigned int cNames, LCID lcid, DISPID *rgdispid)
{
SetupForComCallHR();
diff --git a/src/coreclr/vm/stringliteralmap.cpp b/src/coreclr/vm/stringliteralmap.cpp
index ca1d80f6867924..17e0d5fa3e031a 100644
--- a/src/coreclr/vm/stringliteralmap.cpp
+++ b/src/coreclr/vm/stringliteralmap.cpp
@@ -428,7 +428,7 @@ StringLiteralEntry *GlobalStringLiteralMap::GetInternedString(STRINGREF *pString
}
#ifdef LOGGING
-static void LogStringLiteral(__in_z const char* action, EEStringData *pStringData)
+static void LogStringLiteral(_In_z_ const char* action, EEStringData *pStringData)
{
STATIC_CONTRACT_NOTHROW;
STATIC_CONTRACT_GC_NOTRIGGER;
diff --git a/src/coreclr/vm/syncblk.cpp b/src/coreclr/vm/syncblk.cpp
index 96aa9c701b916f..9dfdfafc050f5d 100644
--- a/src/coreclr/vm/syncblk.cpp
+++ b/src/coreclr/vm/syncblk.cpp
@@ -1491,7 +1491,7 @@ void DumpSyncBlockCache()
param.descrip = descrip;
param.oref = oref;
param.buffer2 = buffer2;
- param.cch2 = COUNTOF(buffer2);
+ param.cch2 = ARRAY_SIZE(buffer2);
param.isString = isString;
PAL_TRY(Param *, pParam, ¶m)
@@ -1514,7 +1514,7 @@ void DumpSyncBlockCache()
descrip = param.descrip;
isString = param.isString;
}
- sprintf_s(buffer, COUNTOF(buffer), "%s", descrip);
+ sprintf_s(buffer, ARRAY_SIZE(buffer), "%s", descrip);
descrip = buffer;
}
if (dumpSBStyle < 2)
diff --git a/src/coreclr/vm/threads.h b/src/coreclr/vm/threads.h
index f7b7479f586d73..1bfccb85e10d6f 100644
--- a/src/coreclr/vm/threads.h
+++ b/src/coreclr/vm/threads.h
@@ -2819,7 +2819,7 @@ class Thread
StackWalkAction MakeStackwalkerCallback(CrawlFrame* pCF, PSTACKWALKFRAMESCALLBACK pCallback, VOID* pData DEBUG_ARG(UINT32 uLoopIteration));
#ifdef _DEBUG
- void DebugLogStackWalkInfo(CrawlFrame* pCF, __in_z LPCSTR pszTag, UINT32 uLoopIteration);
+ void DebugLogStackWalkInfo(CrawlFrame* pCF, _In_z_ LPCSTR pszTag, UINT32 uLoopIteration);
#endif // _DEBUG
public:
diff --git a/src/coreclr/vm/threadsuspend.cpp b/src/coreclr/vm/threadsuspend.cpp
index c4fc869e893ec8..b65cd74270b23e 100644
--- a/src/coreclr/vm/threadsuspend.cpp
+++ b/src/coreclr/vm/threadsuspend.cpp
@@ -3591,12 +3591,12 @@ void ThreadSuspend::SuspendRuntime(ThreadSuspend::SUSPEND_REASON reason)
DWORD id = (DWORD) thread->m_OSThreadId;
if (id == 0xbaadf00d)
{
- sprintf_s (message, COUNTOF(message), "Thread CLR ID=%x cannot be suspended",
+ sprintf_s (message, ARRAY_SIZE(message), "Thread CLR ID=%x cannot be suspended",
thread->GetThreadId());
}
else
{
- sprintf_s (message, COUNTOF(message), "Thread OS ID=%x cannot be suspended",
+ sprintf_s (message, ARRAY_SIZE(message), "Thread OS ID=%x cannot be suspended",
id);
}
DbgAssertDialog(__FILE__, __LINE__, message);
@@ -6255,7 +6255,7 @@ void SuspendStatistics::DisplayAndUpdate()
const char* const str_timeUnit[] = { "usec", "msec", "sec" };
const int timeUnitFactor[] = { 1, 1000, 1000000 };
-void MinMaxTot::DisplayAndUpdate(FILE* logFile, __in_z const char *pName, MinMaxTot *pLastOne, int fullCount, int priorCount, timeUnit unit /* = usec */)
+void MinMaxTot::DisplayAndUpdate(FILE* logFile, _In_z_ const char *pName, MinMaxTot *pLastOne, int fullCount, int priorCount, timeUnit unit /* = usec */)
{
LIMITED_METHOD_CONTRACT;
diff --git a/src/coreclr/vm/threadsuspend.h b/src/coreclr/vm/threadsuspend.h
index 9274327682a6b9..a600d090eef82b 100644
--- a/src/coreclr/vm/threadsuspend.h
+++ b/src/coreclr/vm/threadsuspend.h
@@ -36,7 +36,7 @@ struct MinMaxTot
minVal = maxVal = 0;
}
- void DisplayAndUpdate(FILE* logFile, __in_z const char *pName, MinMaxTot *pLastOne, int fullCount, int priorCount, timeUnit=usec);
+ void DisplayAndUpdate(FILE* logFile, _In_z_ const char *pName, MinMaxTot *pLastOne, int fullCount, int priorCount, timeUnit=usec);
};
// A note about timings. We use QueryPerformanceCounter to measure all timings in units. During
diff --git a/src/coreclr/vm/typeparse.cpp b/src/coreclr/vm/typeparse.cpp
index 6abed5799f3009..524a9e595bc245 100644
--- a/src/coreclr/vm/typeparse.cpp
+++ b/src/coreclr/vm/typeparse.cpp
@@ -981,58 +981,6 @@ TypeHandle TypeName::GetTypeUsingCASearchRules(LPCWSTR szTypeName, Assembly *pRe
-//-------------------------------------------------------------------------------------------
-// Retrieves a type from an assembly. It requires the caller to know which assembly
-// the type is in.
-//-------------------------------------------------------------------------------------------
-/* public static */ TypeHandle TypeName::GetTypeFromAssembly(LPCWSTR szTypeName, Assembly *pAssembly, BOOL bThrowIfNotFound /*= TRUE*/)
-{
- STATIC_CONTRACT_THROWS;
- STATIC_CONTRACT_GC_TRIGGERS;
- STATIC_CONTRACT_FAULT;
-
- _ASSERTE(szTypeName != NULL);
- _ASSERTE(pAssembly != NULL);
-
- if (!*szTypeName)
- COMPlusThrow(kArgumentException, W("Format_StringZeroLength"));
-
- DWORD error = (DWORD)-1;
-
-#ifdef __GNUC__
- // When compiling under GCC we have to use the -fstack-check option to ensure we always spot stack
- // overflow. But this option is intolerant of locals growing too large, so we have to cut back a bit
- // on what we can allocate inline here. Leave the Windows versions alone to retain the perf benefits
- // since we don't have the same constraints.
- NewHolder pTypeName = new TypeName(szTypeName, &error);
-#else // __GNUC__
- TypeName typeName(szTypeName, &error);
- TypeName *pTypeName = &typeName;
-#endif // __GNUC__
-
- if (error != (DWORD)-1)
- {
- StackSString buf;
- StackSString msg(W("typeName@"));
- COUNT_T size = buf.GetUnicodeAllocation();
- _itow_s(error,buf.OpenUnicodeBuffer(size),size,10);
- buf.CloseBuffer();
- msg.Append(buf);
- COMPlusThrowArgumentException(msg.GetUnicode(), NULL);
- }
-
- // Because the typename can come from untrusted input, we will throw an exception rather than assert.
- // (This also assures that the shipping build does the right thing.)
- if (!(pTypeName->GetAssembly()->IsEmpty()))
- {
- COMPlusThrow(kArgumentException, IDS_EE_CANNOT_HAVE_ASSEMBLY_SPEC);
- }
-
- return pTypeName->GetTypeWorker(bThrowIfNotFound, /*bIgnoreCase = */FALSE, pAssembly, /*fEnableCASearchRules = */FALSE, FALSE, NULL,
- nullptr, // pPrivHostBinder
- NULL /* cannot find a collectible type unless it is in assembly */);
-}
-
//-------------------------------------------------------------------------------------------
// Retrieves a type. Will assert if the name is not fully qualified.
//-------------------------------------------------------------------------------------------
diff --git a/src/coreclr/vm/typeparse.h b/src/coreclr/vm/typeparse.h
index 5a19c980ad5e1b..2f1854da236dcf 100644
--- a/src/coreclr/vm/typeparse.h
+++ b/src/coreclr/vm/typeparse.h
@@ -269,12 +269,6 @@ class TypeName
virtual ~TypeName();
public:
- //-------------------------------------------------------------------------------------------
- // Retrieves a type from an assembly. It requires the caller to know which assembly
- // the type is in.
- //-------------------------------------------------------------------------------------------
- static TypeHandle GetTypeFromAssembly(LPCWSTR szTypeName, Assembly *pAssembly, BOOL bThrowIfNotFound = TRUE);
-
TypeHandle GetTypeFromAsm();
//-------------------------------------------------------------------------------------------
diff --git a/src/coreclr/vm/virtualcallstub.cpp b/src/coreclr/vm/virtualcallstub.cpp
index 05df034829ba9a..fd85071676e94c 100644
--- a/src/coreclr/vm/virtualcallstub.cpp
+++ b/src/coreclr/vm/virtualcallstub.cpp
@@ -187,142 +187,142 @@ void VirtualCallStubManager::LoggingDump()
if(g_hStubLogFile)
{
#ifdef STUB_LOGGING
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\r\nstub tuning parameters\r\n");
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\r\nstub tuning parameters\r\n");
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\t%-30s %3d (0x%02x)\r\n", "STUB_MISS_COUNT_VALUE",
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\t%-30s %3d (0x%02x)\r\n", "STUB_MISS_COUNT_VALUE",
STUB_MISS_COUNT_VALUE, STUB_MISS_COUNT_VALUE);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\t%-30s %3d%% (0x%02x)\r\n", "STUB_COLLIDE_WRITE_PCT",
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\t%-30s %3d%% (0x%02x)\r\n", "STUB_COLLIDE_WRITE_PCT",
STUB_COLLIDE_WRITE_PCT, STUB_COLLIDE_WRITE_PCT);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\t%-30s %3d%% (0x%02x)\r\n", "STUB_COLLIDE_MONO_PCT",
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\t%-30s %3d%% (0x%02x)\r\n", "STUB_COLLIDE_MONO_PCT",
STUB_COLLIDE_MONO_PCT, STUB_COLLIDE_MONO_PCT);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\t%-30s %3d%% (0x%02x)\r\n", "DumpLogCounter",
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\t%-30s %3d%% (0x%02x)\r\n", "DumpLogCounter",
g_dumpLogCounter, g_dumpLogCounter);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\t%-30s %3d%% (0x%02x)\r\n", "DumpLogIncr",
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\t%-30s %3d%% (0x%02x)\r\n", "DumpLogIncr",
g_dumpLogCounter, g_dumpLogIncr);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\t%-30s %3d%% (0x%02x)\r\n", "ResetCacheCounter",
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\t%-30s %3d%% (0x%02x)\r\n", "ResetCacheCounter",
g_resetCacheCounter, g_resetCacheCounter);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\t%-30s %3d%% (0x%02x)\r\n", "ResetCacheIncr",
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\t%-30s %3d%% (0x%02x)\r\n", "ResetCacheIncr",
g_resetCacheCounter, g_resetCacheIncr);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
#endif // STUB_LOGGING
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\r\nsite data\r\n");
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\r\nsite data\r\n");
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
//output counters
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "site_counter", g_site_counter);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "site_counter", g_site_counter);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "site_write", g_site_write);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "site_write", g_site_write);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "site_write_mono", g_site_write_mono);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "site_write_mono", g_site_write_mono);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "site_write_poly", g_site_write_poly);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "site_write_poly", g_site_write_poly);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\r\n%-30s %d\r\n", "reclaim_counter", g_reclaim_counter);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\r\n%-30s %d\r\n", "reclaim_counter", g_reclaim_counter);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\r\nstub data\r\n");
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\r\nstub data\r\n");
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "stub_lookup_counter", g_stub_lookup_counter);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "stub_lookup_counter", g_stub_lookup_counter);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "stub_mono_counter", g_stub_mono_counter);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "stub_mono_counter", g_stub_mono_counter);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "stub_poly_counter", g_stub_poly_counter);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "stub_poly_counter", g_stub_poly_counter);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "stub_vtable_counter", g_stub_vtable_counter);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "stub_vtable_counter", g_stub_vtable_counter);
WriteFile(g_hStubLogFile, szPrintStr, (DWORD)strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "stub_space", g_stub_space);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "stub_space", g_stub_space);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
#ifdef STUB_LOGGING
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\r\nlookup stub data\r\n");
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\r\nlookup stub data\r\n");
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
UINT32 total_calls = g_mono_call_counter + g_poly_call_counter;
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "lookup_call_counter", g_call_lookup_counter);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "lookup_call_counter", g_call_lookup_counter);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\r\n%-30s %d\r\n", "total stub dispatch calls", total_calls);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\r\n%-30s %d\r\n", "total stub dispatch calls", total_calls);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\r\n%-30s %#5.2f%%\r\n", "mono stub data",
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\r\n%-30s %#5.2f%%\r\n", "mono stub data",
100.0 * double(g_mono_call_counter)/double(total_calls));
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "mono_call_counter", g_mono_call_counter);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "mono_call_counter", g_mono_call_counter);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "mono_miss_counter", g_mono_miss_counter);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "mono_miss_counter", g_mono_miss_counter);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_PCT, "miss percent",
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_PCT, "miss percent",
100.0 * double(g_mono_miss_counter)/double(g_mono_call_counter));
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\r\n%-30s %#5.2f%%\r\n", "poly stub data",
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\r\n%-30s %#5.2f%%\r\n", "poly stub data",
100.0 * double(g_poly_call_counter)/double(total_calls));
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "poly_call_counter", g_poly_call_counter);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "poly_call_counter", g_poly_call_counter);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "poly_miss_counter", g_poly_miss_counter);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "poly_miss_counter", g_poly_miss_counter);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_PCT, "miss percent",
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_PCT, "miss percent",
100.0 * double(g_poly_miss_counter)/double(g_poly_call_counter));
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
#endif // STUB_LOGGING
#ifdef CHAIN_LOOKUP
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\r\nchain lookup data\r\n");
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\r\nchain lookup data\r\n");
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
#ifdef STUB_LOGGING
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "chained_lookup_call_counter", g_chained_lookup_call_counter);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "chained_lookup_call_counter", g_chained_lookup_call_counter);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "chained_lookup_miss_counter", g_chained_lookup_miss_counter);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "chained_lookup_miss_counter", g_chained_lookup_miss_counter);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_PCT, "miss percent",
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_PCT, "miss percent",
100.0 * double(g_chained_lookup_miss_counter)/double(g_chained_lookup_call_counter));
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "chained_lookup_external_call_counter", g_chained_lookup_external_call_counter);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "chained_lookup_external_call_counter", g_chained_lookup_external_call_counter);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "chained_lookup_external_miss_counter", g_chained_lookup_external_miss_counter);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "chained_lookup_external_miss_counter", g_chained_lookup_external_miss_counter);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_PCT, "miss percent",
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_PCT, "miss percent",
100.0 * double(g_chained_lookup_external_miss_counter)/double(g_chained_lookup_external_call_counter));
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
#endif // STUB_LOGGING
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "chained_entry_promoted", g_chained_entry_promoted);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "chained_entry_promoted", g_chained_entry_promoted);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
#endif // CHAIN_LOOKUP
#ifdef STUB_LOGGING
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\r\n%-30s %#5.2f%%\r\n", "worker (slow resolver) data",
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\r\n%-30s %#5.2f%%\r\n", "worker (slow resolver) data",
100.0 * double(g_worker_call)/double(total_calls));
#else // !STUB_LOGGING
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\r\nworker (slow resolver) data\r\n");
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\r\nworker (slow resolver) data\r\n");
#endif // !STUB_LOGGING
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "worker_call", g_worker_call);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "worker_call", g_worker_call);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "worker_call_no_patch", g_worker_call_no_patch);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "worker_call_no_patch", g_worker_call_no_patch);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "external_call", g_external_call);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "external_call", g_external_call);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "external_call_no_patch", g_external_call_no_patch);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "external_call_no_patch", g_external_call_no_patch);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "worker_collide_to_mono", g_worker_collide_to_mono);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "worker_collide_to_mono", g_worker_collide_to_mono);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
UINT32 total_inserts = g_insert_cache_external
@@ -330,74 +330,74 @@ void VirtualCallStubManager::LoggingDump()
+ g_insert_cache_dispatch
+ g_insert_cache_resolve;
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\r\n%-30s %d\r\n", "insert cache data", total_inserts);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\r\n%-30s %d\r\n", "insert cache data", total_inserts);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT_PCT, "insert_cache_external", g_insert_cache_external,
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT_PCT, "insert_cache_external", g_insert_cache_external,
100.0 * double(g_insert_cache_external)/double(total_inserts));
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT_PCT, "insert_cache_shared", g_insert_cache_shared,
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT_PCT, "insert_cache_shared", g_insert_cache_shared,
100.0 * double(g_insert_cache_shared)/double(total_inserts));
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT_PCT, "insert_cache_dispatch", g_insert_cache_dispatch,
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT_PCT, "insert_cache_dispatch", g_insert_cache_dispatch,
100.0 * double(g_insert_cache_dispatch)/double(total_inserts));
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT_PCT, "insert_cache_resolve", g_insert_cache_resolve,
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT_PCT, "insert_cache_resolve", g_insert_cache_resolve,
100.0 * double(g_insert_cache_resolve)/double(total_inserts));
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT_PCT, "insert_cache_hit", g_insert_cache_hit,
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT_PCT, "insert_cache_hit", g_insert_cache_hit,
100.0 * double(g_insert_cache_hit)/double(total_inserts));
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT_PCT, "insert_cache_miss", g_insert_cache_miss,
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT_PCT, "insert_cache_miss", g_insert_cache_miss,
100.0 * double(g_insert_cache_miss)/double(total_inserts));
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT_PCT, "insert_cache_collide", g_insert_cache_collide,
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT_PCT, "insert_cache_collide", g_insert_cache_collide,
100.0 * double(g_insert_cache_collide)/double(total_inserts));
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT_PCT, "insert_cache_write", g_insert_cache_write,
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT_PCT, "insert_cache_write", g_insert_cache_write,
100.0 * double(g_insert_cache_write)/double(total_inserts));
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\r\ncache data\r\n");
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\r\ncache data\r\n");
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
size_t total, used;
g_resolveCache->GetLoadFactor(&total, &used);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_SIZE, "cache_entry_used", used);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_SIZE, "cache_entry_used", used);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "cache_entry_counter", g_cache_entry_counter);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "cache_entry_counter", g_cache_entry_counter);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "cache_entry_space", g_cache_entry_space);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "cache_entry_space", g_cache_entry_space);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\r\nstub hash table data\r\n");
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\r\nstub hash table data\r\n");
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "bucket_space", g_bucket_space);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "bucket_space", g_bucket_space);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "bucket_space_dead", g_bucket_space_dead);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "bucket_space_dead", g_bucket_space_dead);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\r\ncache_load:\t%zu used, %zu total, utilization %#5.2f%%\r\n",
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\r\ncache_load:\t%zu used, %zu total, utilization %#5.2f%%\r\n",
used, total, 100.0 * double(used) / double(total));
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
#ifdef STUB_LOGGING
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\r\ncache entry write counts\r\n");
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\r\ncache entry write counts\r\n");
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
DispatchCache::CacheEntryData *rgCacheData = g_resolveCache->cacheData;
for (UINT16 i = 0; i < CALL_STUB_CACHE_SIZE; i++)
{
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), " %4d", rgCacheData[i]);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), " %4d", rgCacheData[i]);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
if (i % 16 == 15)
{
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\r\n");
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\r\n");
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
}
}
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\r\n");
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\r\n");
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
#endif // STUB_LOGGING
@@ -406,7 +406,7 @@ void VirtualCallStubManager::LoggingDump()
{
if (ContractImplMap::deltasDescs[i] != 0)
{
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "deltasDescs[%d]\t%d\r\n", i, ContractImplMap::deltasDescs[i]);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "deltasDescs[%d]\t%d\r\n", i, ContractImplMap::deltasDescs[i]);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
}
}
@@ -414,19 +414,19 @@ void VirtualCallStubManager::LoggingDump()
{
if (ContractImplMap::deltasSlots[i] != 0)
{
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "deltasSlots[%d]\t%d\r\n", i, ContractImplMap::deltasSlots[i]);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "deltasSlots[%d]\t%d\r\n", i, ContractImplMap::deltasSlots[i]);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
}
}
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "cout of maps:\t%d\r\n", ContractImplMap::countMaps);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "cout of maps:\t%d\r\n", ContractImplMap::countMaps);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "count of interfaces:\t%d\r\n", ContractImplMap::countInterfaces);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "count of interfaces:\t%d\r\n", ContractImplMap::countInterfaces);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "count of deltas:\t%d\r\n", ContractImplMap::countDelta);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "count of deltas:\t%d\r\n", ContractImplMap::countDelta);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "total delta for descs:\t%d\r\n", ContractImplMap::totalDeltaDescs);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "total delta for descs:\t%d\r\n", ContractImplMap::totalDeltaDescs);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "total delta for slots:\t%d\r\n", ContractImplMap::totalDeltaSlots);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "total delta for slots:\t%d\r\n", ContractImplMap::totalDeltaSlots);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
#endif // 0
@@ -2972,38 +2972,38 @@ void VirtualCallStubManager::LogStats()
if (g_hStubLogFile && (stats.site_write != 0))
{
//output counters
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "site_counter", stats.site_counter);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "site_counter", stats.site_counter);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "site_write", stats.site_write);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "site_write", stats.site_write);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "site_write_mono", stats.site_write_mono);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "site_write_mono", stats.site_write_mono);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "site_write_poly", stats.site_write_poly);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "site_write_poly", stats.site_write_poly);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\r\nstub data\r\n");
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\r\nstub data\r\n");
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "stub_lookup_counter", stats.stub_lookup_counter);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "stub_lookup_counter", stats.stub_lookup_counter);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "stub_mono_counter", stats.stub_mono_counter);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "stub_mono_counter", stats.stub_mono_counter);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "stub_poly_counter", stats.stub_poly_counter);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "stub_poly_counter", stats.stub_poly_counter);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "stub_space", stats.stub_space);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "stub_space", stats.stub_space);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
size_t total, used;
g_resolveCache->GetLoadFactor(&total, &used);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_SIZE, "cache_entry_used", used);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_SIZE, "cache_entry_used", used);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "cache_entry_counter", stats.cache_entry_counter);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "cache_entry_counter", stats.cache_entry_counter);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), OUTPUT_FORMAT_INT, "cache_entry_space", stats.cache_entry_space);
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), OUTPUT_FORMAT_INT, "cache_entry_space", stats.cache_entry_space);
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
- sprintf_s(szPrintStr, COUNTOF(szPrintStr), "\r\ncache_load:\t%zu used, %zu total, utilization %#5.2f%%\r\n",
+ sprintf_s(szPrintStr, ARRAY_SIZE(szPrintStr), "\r\ncache_load:\t%zu used, %zu total, utilization %#5.2f%%\r\n",
used, total, 100.0 * double(used) / double(total));
WriteFile (g_hStubLogFile, szPrintStr, (DWORD) strlen(szPrintStr), &dwWriteByte, NULL);
}
diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.cs
index f1200eabdd2a7c..9ae88238278c11 100644
--- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.cs
+++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.cs
@@ -233,8 +233,7 @@ private static partial void SSLStreamGetPeerCertificates(
internal static IntPtr[]? SSLStreamGetPeerCertificates(SafeSslHandle ssl)
{
IntPtr[]? ptrs;
- int count;
- Interop.AndroidCrypto.SSLStreamGetPeerCertificates(ssl, out ptrs, out count);
+ Interop.AndroidCrypto.SSLStreamGetPeerCertificates(ssl, out ptrs, out _);
return ptrs;
}
diff --git a/src/libraries/Common/src/Interop/FreeBSD/Interop.Process.cs b/src/libraries/Common/src/Interop/FreeBSD/Interop.Process.cs
index 3d18ead32d116d..f7549adf6a9c32 100644
--- a/src/libraries/Common/src/Interop/FreeBSD/Interop.Process.cs
+++ b/src/libraries/Common/src/Interop/FreeBSD/Interop.Process.cs
@@ -74,7 +74,7 @@ internal static unsafe int[] ListAllPids()
/// Gets executable name for process given it's PID
///
/// The PID of the process
- public static unsafe string? GetProcPath(int pid)
+ public static unsafe string GetProcPath(int pid)
{
Span sysctlName = stackalloc int[] { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, pid };
byte* pBuffer = null;
@@ -83,7 +83,7 @@ internal static unsafe int[] ListAllPids()
try
{
Interop.Sys.Sysctl(sysctlName, ref pBuffer, ref bytesLength);
- return System.Text.Encoding.UTF8.GetString(pBuffer, (int)bytesLength - 1);
+ return System.Text.Encoding.UTF8.GetString(pBuffer, bytesLength - 1);
}
finally
{
diff --git a/src/libraries/Common/src/Interop/Linux/procfs/Interop.ProcFsStat.ParseMapModules.cs b/src/libraries/Common/src/Interop/Linux/procfs/Interop.ProcFsStat.ParseMapModules.cs
index 8be9f32cbedee3..0f2287ce4164bd 100644
--- a/src/libraries/Common/src/Interop/Linux/procfs/Interop.ProcFsStat.ParseMapModules.cs
+++ b/src/libraries/Common/src/Interop/Linux/procfs/Interop.ProcFsStat.ParseMapModules.cs
@@ -61,10 +61,8 @@ private static ProcessModuleCollection ParseMapsModulesCore(IEnumerable
// Not a continuation, commit any current modules and create a new one.
CommitCurrentModule();
- module = new ProcessModule
+ module = new ProcessModule(parsedLine.Path, Path.GetFileName(parsedLine.Path))
{
- FileName = parsedLine.Path,
- ModuleName = Path.GetFileName(parsedLine.Path),
ModuleMemorySize = parsedLine.Size,
EntryPointAddress = IntPtr.Zero // unknown
};
diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ssl.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ssl.cs
index 2e6e72c9418b44..af6596efd51da6 100644
--- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ssl.cs
+++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ssl.cs
@@ -46,6 +46,7 @@ internal enum PAL_TlsHandshakeState
WouldBlock,
ServerAuthCompleted,
ClientAuthCompleted,
+ ClientCertRequested,
}
internal enum PAL_TlsIo
@@ -99,6 +100,12 @@ private static partial int AppleCryptoNative_SslSetBreakOnClientAuth(
int setBreak,
out int pOSStatus);
+ [GeneratedDllImport(Interop.Libraries.AppleCryptoNative)]
+ private static partial int AppleCryptoNative_SslSetBreakOnCertRequested(
+ SafeSslHandle sslHandle,
+ int setBreak,
+ out int pOSStatus);
+
[GeneratedDllImport(Interop.Libraries.AppleCryptoNative)]
private static partial int AppleCryptoNative_SslSetCertificate(
SafeSslHandle sslHandle,
@@ -266,6 +273,25 @@ internal static void SslBreakOnClientAuth(SafeSslHandle sslHandle, bool setBreak
throw new SslException();
}
+ internal static void SslBreakOnCertRequested(SafeSslHandle sslHandle, bool setBreak)
+ {
+ int osStatus;
+ int result = AppleCryptoNative_SslSetBreakOnCertRequested(sslHandle, setBreak ? 1 : 0, out osStatus);
+
+ if (result == 1)
+ {
+ return;
+ }
+
+ if (result == 0)
+ {
+ throw CreateExceptionForOSStatus(osStatus);
+ }
+
+ Debug.Fail($"AppleCryptoNative_SslSetBreakOnCertRequested returned {result}");
+ throw new SslException();
+ }
+
internal static void SslSetCertificate(SafeSslHandle sslHandle, IntPtr[] certChainPtrs)
{
using (SafeCreateHandle cfCertRefs = CoreFoundation.CFArrayCreate(certChainPtrs, (UIntPtr)certChainPtrs.Length))
diff --git a/src/libraries/Common/src/Interop/Unix/Interop.Libraries.cs b/src/libraries/Common/src/Interop/Unix/Interop.Libraries.cs
index 8e2d9046af8987..1a0114cca21895 100644
--- a/src/libraries/Common/src/Interop/Unix/Interop.Libraries.cs
+++ b/src/libraries/Common/src/Interop/Unix/Interop.Libraries.cs
@@ -5,6 +5,8 @@ internal static partial class Interop
{
internal static partial class Libraries
{
+ internal const string Libc = "libc";
+
// Shims
internal const string SystemNative = "libSystem.Native";
internal const string NetSecurityNative = "libSystem.Net.Security.Native";
diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs
index 828af2acfac0ee..d403daac342ad1 100644
--- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs
+++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs
@@ -78,9 +78,11 @@ private static bool DisableTlsResume
// This is helper function to adjust requested protocols based on CipherSuitePolicy and system capability.
private static SslProtocols CalculateEffectiveProtocols(SslAuthenticationOptions sslAuthenticationOptions)
{
- SslProtocols protocols = sslAuthenticationOptions.EnabledSslProtocols;
+ // make sure low bit is not set since we use it in context dictionary to distinguish use with ALPN
+ Debug.Assert(((int)sslAuthenticationOptions.EnabledSslProtocols & 1) == 0);
+ SslProtocols protocols = sslAuthenticationOptions.EnabledSslProtocols & ~((SslProtocols)1);
- if (!Interop.Ssl.Tls13Supported)
+ if (!Interop.Ssl.Capabilities.Tls13Supported)
{
if (protocols != SslProtocols.None &&
CipherSuitesPolicyPal.WantsTls13(protocols))
@@ -122,7 +124,7 @@ private static SslProtocols CalculateEffectiveProtocols(SslAuthenticationOptions
}
// This essentially wraps SSL_CTX* aka SSL_CTX_new + setting
- internal static SafeSslContextHandle AllocateSslContext(SafeFreeSslCredentials credential, SslAuthenticationOptions sslAuthenticationOptions, SslProtocols protocols)
+ internal static SafeSslContextHandle AllocateSslContext(SafeFreeSslCredentials credential, SslAuthenticationOptions sslAuthenticationOptions, SslProtocols protocols, bool enableResume)
{
SafeX509Handle? certHandle = credential.CertHandle;
SafeEvpPKeyHandle? certKeyHandle = credential.CertKeyHandle;
@@ -181,6 +183,8 @@ internal static SafeSslContextHandle AllocateSslContext(SafeFreeSslCredentials c
// https://www.openssl.org/docs/manmaster/ssl/SSL_shutdown.html
Ssl.SslCtxSetQuietShutdown(sslCtx);
+ Ssl.SslCtxSetCaching(sslCtx, enableResume ? 1 : 0);
+
if (sslAuthenticationOptions.IsServer && sslAuthenticationOptions.ApplicationProtocols != null && sslAuthenticationOptions.ApplicationProtocols.Count != 0)
{
unsafe
@@ -215,6 +219,45 @@ internal static SafeSslContextHandle AllocateSslContext(SafeFreeSslCredentials c
return sslCtx;
}
+ internal static void UpdateClientCertiticate(SafeSslHandle ssl, SslAuthenticationOptions sslAuthenticationOptions)
+ {
+ // Disable certificate selection callback. We either got certificate or we will try to proceed without it.
+ Interop.Ssl.SslSetClientCertCallback(ssl, 0);
+
+ if (sslAuthenticationOptions.CertificateContext == null)
+ {
+ return;
+ }
+
+ var credential = new SafeFreeSslCredentials(sslAuthenticationOptions.CertificateContext, sslAuthenticationOptions.EnabledSslProtocols, sslAuthenticationOptions.EncryptionPolicy, sslAuthenticationOptions.IsServer);
+ SafeX509Handle? certHandle = credential.CertHandle;
+ SafeEvpPKeyHandle? certKeyHandle = credential.CertKeyHandle;
+
+ Debug.Assert(certHandle != null);
+ Debug.Assert(certKeyHandle != null);
+
+ int retVal = Ssl.SslUseCertificate(ssl, certHandle);
+ if (1 != retVal)
+ {
+ throw CreateSslException(SR.net_ssl_use_cert_failed);
+ }
+
+ retVal = Ssl.SslUsePrivateKey(ssl, certKeyHandle);
+ if (1 != retVal)
+ {
+ throw CreateSslException(SR.net_ssl_use_private_key_failed);
+ }
+
+ if (sslAuthenticationOptions.CertificateContext.IntermediateCertificates.Length > 0)
+ {
+ if (!Ssl.AddExtraChainCertificates(ssl, sslAuthenticationOptions.CertificateContext.IntermediateCertificates))
+ {
+ throw CreateSslException(SR.net_ssl_use_cert_failed);
+ }
+ }
+
+ }
+
// This essentially wraps SSL* SSL_new()
internal static SafeSslHandle AllocateSslHandle(SafeFreeSslCredentials credential, SslAuthenticationOptions sslAuthenticationOptions)
{
@@ -222,24 +265,24 @@ internal static SafeSslHandle AllocateSslHandle(SafeFreeSslCredentials credentia
SafeSslContextHandle? sslCtxHandle = null;
SafeSslContextHandle? newCtxHandle = null;
SslProtocols protocols = CalculateEffectiveProtocols(sslAuthenticationOptions);
+ bool hasAlpn = sslAuthenticationOptions.ApplicationProtocols != null && sslAuthenticationOptions.ApplicationProtocols.Count != 0;
bool cacheSslContext = !DisableTlsResume && sslAuthenticationOptions.EncryptionPolicy == EncryptionPolicy.RequireEncryption &&
+ sslAuthenticationOptions.IsServer &&
sslAuthenticationOptions.CertificateContext != null &&
sslAuthenticationOptions.CertificateContext.SslContexts != null &&
- sslAuthenticationOptions.CipherSuitesPolicy == null &&
- (!sslAuthenticationOptions.IsServer ||
- (sslAuthenticationOptions.ApplicationProtocols != null && sslAuthenticationOptions.ApplicationProtocols.Count != 0));
+ sslAuthenticationOptions.CipherSuitesPolicy == null;
if (cacheSslContext)
{
- sslAuthenticationOptions.CertificateContext!.SslContexts!.TryGetValue(protocols, out sslCtxHandle);
+ sslAuthenticationOptions.CertificateContext!.SslContexts!.TryGetValue(protocols | (SslProtocols)(hasAlpn ? 1 : 0), out sslCtxHandle);
}
if (sslCtxHandle == null)
{
// We did not get SslContext from cache
- sslCtxHandle = newCtxHandle = AllocateSslContext(credential, sslAuthenticationOptions, protocols);
+ sslCtxHandle = newCtxHandle = AllocateSslContext(credential, sslAuthenticationOptions, protocols, cacheSslContext);
- if (cacheSslContext && sslAuthenticationOptions.CertificateContext!.SslContexts!.TryAdd(protocols, newCtxHandle))
+ if (cacheSslContext && sslAuthenticationOptions.CertificateContext!.SslContexts!.TryAdd(protocols | (SslProtocols)(hasAlpn ? 1 : 0), newCtxHandle))
{
newCtxHandle = null;
}
@@ -283,6 +326,13 @@ internal static SafeSslHandle AllocateSslHandle(SafeFreeSslCredentials credentia
{
Crypto.ErrClearError();
}
+
+ if (sslAuthenticationOptions.CertSelectionDelegate != null && sslAuthenticationOptions.CertificateContext == null)
+ {
+ // We don't have certificate but we have callback. We should wait for remote certificate and
+ // possible trusted issuer list.
+ Interop.Ssl.SslSetClientCertCallback(sslHandle, 1);
+ }
}
if (sslAuthenticationOptions.IsServer && sslAuthenticationOptions.RemoteCertRequired)
@@ -320,7 +370,7 @@ internal static SecurityStatusPal SslRenegotiate(SafeSslHandle sslContext, out b
return new SecurityStatusPal(SecurityStatusPalErrorCode.OK);
}
- internal static bool DoSslHandshake(SafeSslHandle context, ReadOnlySpan input, out byte[]? sendBuf, out int sendCount)
+ internal static SecurityStatusPalErrorCode DoSslHandshake(SafeSslHandle context, ReadOnlySpan input, out byte[]? sendBuf, out int sendCount)
{
sendBuf = null;
sendCount = 0;
@@ -341,6 +391,11 @@ internal static bool DoSslHandshake(SafeSslHandle context, ReadOnlySpan in
Exception? innerError;
Ssl.SslErrorCode error = GetSslError(context, retVal, out innerError);
+ if (error == Ssl.SslErrorCode.SSL_ERROR_WANT_X509_LOOKUP)
+ {
+ return SecurityStatusPalErrorCode.CredentialsNeeded;
+ }
+
if ((retVal != -1) || (error != Ssl.SslErrorCode.SSL_ERROR_WANT_READ))
{
// Handshake failed, but even if the handshake does not need to read, there may be an Alert going out.
@@ -385,7 +440,8 @@ internal static bool DoSslHandshake(SafeSslHandle context, ReadOnlySpan in
{
context.MarkHandshakeCompleted();
}
- return stateOk;
+
+ return stateOk ? SecurityStatusPalErrorCode.OK : SecurityStatusPalErrorCode.ContinueNeeded;
}
internal static int Encrypt(SafeSslHandle context, ReadOnlySpan input, ref byte[] output, out Ssl.SslErrorCode errorCode)
diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs
index 1db80064b2c80c..c01b829cd189d2 100644
--- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs
+++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs
@@ -6,6 +6,7 @@
using System.Diagnostics;
using System.Net.Security;
using System.Runtime.InteropServices;
+using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using Microsoft.Win32.SafeHandles;
@@ -149,6 +150,24 @@ internal static partial class Ssl
[GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetData")]
internal static partial int SslSetData(IntPtr ssl, IntPtr data);
+ [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslUseCertificate")]
+ internal static extern int SslUseCertificate(SafeSslHandle ssl, SafeX509Handle certPtr);
+
+ [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslUsePrivateKey")]
+ internal static extern int SslUsePrivateKey(SafeSslHandle ssl, SafeEvpPKeyHandle keyPtr);
+
+ [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetClientCertCallback")]
+ internal static extern unsafe void SslSetClientCertCallback(SafeSslHandle ssl, int set);
+
+ [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Tls13Supported")]
+ private static partial int Tls13SupportedImpl();
+
+ internal static class Capabilities
+ {
+ // needs separate type (separate static cctor) to be sure OpenSSL is initialized.
+ internal static readonly bool Tls13Supported = Tls13SupportedImpl() != 0;
+ }
+
internal static unsafe int SslSetAlpnProtos(SafeSslHandle ssl, List protocols)
{
byte[] buffer = ConvertAlpnProtocolListToByteArray(protocols);
@@ -183,6 +202,28 @@ internal static byte[] ConvertAlpnProtocolListToByteArray(List callback, IntPtr arg);
+ [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetCaching")]
+ internal static unsafe partial void SslCtxSetCaching(SafeSslContextHandle ctx, int mode);
+
internal static bool AddExtraChainCertificates(SafeSslContextHandle ctx, X509Certificate2[] chain)
{
// send pre-computed list of intermediates.
diff --git a/src/libraries/Common/src/Interop/Unix/libc/Interop.GetParentPid.cs b/src/libraries/Common/src/Interop/Unix/libc/Interop.GetParentPid.cs
new file mode 100644
index 00000000000000..95b27abf158287
--- /dev/null
+++ b/src/libraries/Common/src/Interop/Unix/libc/Interop.GetParentPid.cs
@@ -0,0 +1,13 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class libc
+ {
+ [GeneratedDllImport(Libraries.Libc, EntryPoint = "getppid")]
+ internal static partial int GetParentPid();
+ }
+}
diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextPropertyString.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextPropertyString.cs
index 8f942403261ac6..ed60c1730e54e9 100644
--- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextPropertyString.cs
+++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextPropertyString.cs
@@ -9,6 +9,6 @@ internal static partial class Interop
internal static partial class Crypt32
{
[GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertGetCertificateContextProperty", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static unsafe partial bool CertGetCertificateContextPropertyString(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, byte* pvData, ref int pcbData);
+ internal static unsafe partial bool CertGetCertificateContextPropertyString(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, byte* pvData, ref uint pcbData);
}
}
diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleMode.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleMode.cs
index 6eb46b1f4b6d90..8275904b8286b6 100644
--- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleMode.cs
+++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleMode.cs
@@ -13,8 +13,7 @@ internal static partial class Kernel32
internal static bool IsGetConsoleModeCallSuccessful(IntPtr handle)
{
- int mode;
- return GetConsoleMode(handle, out mode);
+ return GetConsoleMode(handle, out _);
}
[GeneratedDllImport(Libraries.Kernel32, SetLastError = true)]
diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/SecuritySafeHandles.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/SecuritySafeHandles.cs
index 43b718524d1ca9..8c3b6d815c169f 100644
--- a/src/libraries/Common/src/Interop/Windows/SspiCli/SecuritySafeHandles.cs
+++ b/src/libraries/Common/src/Interop/Windows/SspiCli/SecuritySafeHandles.cs
@@ -49,9 +49,7 @@ internal void Set(IntPtr value)
internal static int EnumeratePackages(out int pkgnum, out SafeFreeContextBuffer pkgArray)
{
- int res = -1;
- SafeFreeContextBuffer_SECURITY? pkgArray_SECURITY = null;
- res = Interop.SspiCli.EnumerateSecurityPackagesW(out pkgnum, out pkgArray_SECURITY);
+ int res = Interop.SspiCli.EnumerateSecurityPackagesW(out pkgnum, out SafeFreeContextBuffer_SECURITY? pkgArray_SECURITY);
pkgArray = pkgArray_SECURITY;
if (res != 0)
@@ -230,11 +228,8 @@ public static unsafe int AcquireCredentialsHandle(
ref SafeSspiAuthDataHandle authdata,
out SafeFreeCredentials outCredential)
{
- int errorCode = -1;
- long timeStamp;
-
outCredential = new SafeFreeCredential_SECURITY();
- errorCode = Interop.SspiCli.AcquireCredentialsHandleW(
+ int errorCode = Interop.SspiCli.AcquireCredentialsHandleW(
null,
package,
(int)intent,
@@ -243,7 +238,7 @@ public static unsafe int AcquireCredentialsHandle(
null,
null,
ref outCredential._handle,
- out timeStamp);
+ out _);
if (errorCode != 0)
{
@@ -260,7 +255,6 @@ public static unsafe int AcquireCredentialsHandle(
out SafeFreeCredentials outCredential)
{
int errorCode = -1;
- long timeStamp;
outCredential = new SafeFreeCredential_SECURITY();
@@ -273,7 +267,7 @@ public static unsafe int AcquireCredentialsHandle(
null,
null,
ref outCredential._handle,
- out timeStamp);
+ out _);
if (NetEventSource.Log.IsEnabled()) NetEventSource.Verbose(null, $"{nameof(Interop.SspiCli.AcquireCredentialsHandleW)} returns 0x{errorCode:x}, handle = {outCredential}");
diff --git a/src/libraries/Common/src/Microsoft/Win32/SafeHandles/GssSafeHandles.cs b/src/libraries/Common/src/Microsoft/Win32/SafeHandles/GssSafeHandles.cs
index 2ab6998096704e..253e0548dea9d9 100644
--- a/src/libraries/Common/src/Microsoft/Win32/SafeHandles/GssSafeHandles.cs
+++ b/src/libraries/Common/src/Microsoft/Win32/SafeHandles/GssSafeHandles.cs
@@ -54,8 +54,7 @@ public override bool IsInvalid
protected override bool ReleaseHandle()
{
- Interop.NetSecurityNative.Status minorStatus;
- Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.ReleaseName(out minorStatus, ref handle);
+ Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.ReleaseName(out _, ref handle);
SetHandle(IntPtr.Zero);
return status == Interop.NetSecurityNative.Status.GSS_S_COMPLETE;
}
@@ -75,7 +74,7 @@ internal sealed class SafeGssCredHandle : SafeHandle
public static SafeGssCredHandle CreateAcceptor()
{
- SafeGssCredHandle? retHandle = null;
+ SafeGssCredHandle? retHandle;
Interop.NetSecurityNative.Status status;
Interop.NetSecurityNative.Status minorStatus;
@@ -143,8 +142,7 @@ public override bool IsInvalid
protected override bool ReleaseHandle()
{
- Interop.NetSecurityNative.Status minorStatus;
- Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.ReleaseCred(out minorStatus, ref handle);
+ Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.ReleaseCred(out _, ref handle);
SetHandle(IntPtr.Zero);
return status == Interop.NetSecurityNative.Status.GSS_S_COMPLETE;
}
@@ -169,8 +167,7 @@ public override bool IsInvalid
protected override unsafe bool ReleaseHandle()
{
- Interop.NetSecurityNative.Status minorStatus;
- Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.DeleteSecContext(out minorStatus, ref handle);
+ Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.DeleteSecContext(out _, ref handle);
SetHandle(IntPtr.Zero);
return status == Interop.NetSecurityNative.Status.GSS_S_COMPLETE;
}
diff --git a/src/libraries/Common/src/System/Data/ProviderBase/DbConnectionFactory.cs b/src/libraries/Common/src/System/Data/ProviderBase/DbConnectionFactory.cs
index 5418b4ff8bba76..d329db38dd0317 100644
--- a/src/libraries/Common/src/System/Data/ProviderBase/DbConnectionFactory.cs
+++ b/src/libraries/Common/src/System/Data/ProviderBase/DbConnectionFactory.cs
@@ -386,23 +386,13 @@ internal DbMetaDataFactory GetMetaDataFactory(DbConnectionPoolGroup connectionPo
// if two threads happen to hit this at the same time. One will be GC'd
if (metaDataFactory == null)
{
- bool allowCache = false;
- metaDataFactory = CreateMetaDataFactory(internalConnection, out allowCache);
- if (allowCache)
- {
- connectionPoolGroup.MetaDataFactory = metaDataFactory;
- }
+ metaDataFactory = CreateMetaDataFactory(internalConnection);
+ connectionPoolGroup.MetaDataFactory = metaDataFactory;
}
return metaDataFactory;
}
- protected virtual DbMetaDataFactory CreateMetaDataFactory(DbConnectionInternal internalConnection, out bool cacheMetaDataFactory)
- {
- // providers that support GetSchema must override this with a method that creates a meta data
- // factory appropriate for them.
- cacheMetaDataFactory = false;
- throw ADP.NotSupported();
- }
+ protected abstract DbMetaDataFactory CreateMetaDataFactory(DbConnectionInternal internalConnection);
protected abstract DbConnectionInternal CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, object poolGroupProviderInfo, DbConnectionPool? pool, DbConnection? owningConnection);
diff --git a/src/libraries/Common/src/System/Data/ProviderBase/DbConnectionInternal.cs b/src/libraries/Common/src/System/Data/ProviderBase/DbConnectionInternal.cs
index 5c1c4c0034cd95..1103b6488733bc 100644
--- a/src/libraries/Common/src/System/Data/ProviderBase/DbConnectionInternal.cs
+++ b/src/libraries/Common/src/System/Data/ProviderBase/DbConnectionInternal.cs
@@ -319,7 +319,7 @@ protected bool TryOpenConnectionInternal(DbConnection outerConnection, DbConnect
// ?->Connecting: prevent set_ConnectionString during Open
if (connectionFactory.SetInnerConnectionFrom(outerConnection, DbConnectionClosedConnecting.SingletonInstance, this))
{
- DbConnectionInternal? openConnection = null;
+ DbConnectionInternal? openConnection;
try
{
connectionFactory.PermissionDemand(outerConnection);
diff --git a/src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs b/src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs
index e2727c92b6bdfa..61f4cfcb9ce08c 100644
--- a/src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs
+++ b/src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs
@@ -109,8 +109,8 @@ private DataTable ExecuteCommand(DataRow requestedCollectionRow, string?[]? rest
DataColumn collectionNameColumn = metaDataCollectionsTable.Columns[_collectionName]!;
DataTable? resultTable = null;
- DbCommand? command = null;
- DataTable? schemaTable = null;
+ DbCommand? command;
+ DataTable? schemaTable;
Debug.Assert(requestedCollectionRow != null);
string sqlCommand = (requestedCollectionRow[populationStringColumn, DataRowVersion.Current] as string)!;
@@ -185,7 +185,6 @@ private DataTable ExecuteCommand(DataRow requestedCollectionRow, string?[]? rest
if (reader != null)
{
reader.Dispose();
- reader = null;
}
}
return resultTable;
@@ -341,8 +340,8 @@ private void FixUpVersion(DataTable dataSourceInfoTable)
private string GetParameterName(string neededCollectionName, int neededRestrictionNumber)
{
- DataTable? restrictionsTable = null;
- DataColumnCollection? restrictionColumns = null;
+ DataTable? restrictionsTable;
+ DataColumnCollection? restrictionColumns;
DataColumn? collectionName = null;
DataColumn? parameterName = null;
DataColumn? restrictionName = null;
@@ -396,10 +395,10 @@ public virtual DataTable GetSchema(DbConnection connection, string collectionNam
DataTable metaDataCollectionsTable = _metaDataCollectionsDataSet.Tables[DbMetaDataCollectionNames.MetaDataCollections]!;
DataColumn populationMechanismColumn = metaDataCollectionsTable.Columns[_populationMechanism]!;
DataColumn collectionNameColumn = metaDataCollectionsTable.Columns[DbMetaDataColumnNames.CollectionName]!;
- DataRow? requestedCollectionRow = null;
- DataTable? requestedSchema = null;
+ DataRow? requestedCollectionRow;
+ DataTable? requestedSchema;
string[]? hiddenColumns;
- string? exactCollectionName = null;
+ string? exactCollectionName;
requestedCollectionRow = FindMetaDataCollectionRow(collectionName);
exactCollectionName = (requestedCollectionRow[collectionNameColumn, DataRowVersion.Current] as string)!;
diff --git a/src/libraries/Common/src/System/Diagnostics/NetFrameworkUtils.cs b/src/libraries/Common/src/System/Diagnostics/NetFrameworkUtils.cs
index 4bab9a4590c358..d8ec150103d9b4 100644
--- a/src/libraries/Common/src/System/Diagnostics/NetFrameworkUtils.cs
+++ b/src/libraries/Common/src/System/Diagnostics/NetFrameworkUtils.cs
@@ -19,9 +19,7 @@ internal static void EnterMutex(string name, ref Mutex mutex)
internal static void EnterMutexWithoutGlobal(string mutexName, ref Mutex mutex)
{
- bool createdNew;
-
- Mutex tmpMutex = new Mutex(false, mutexName, out createdNew);
+ Mutex tmpMutex = new Mutex(false, mutexName, out _);
SafeWaitForMutex(tmpMutex, ref mutex);
}
diff --git a/src/libraries/Common/src/System/IO/FileSystem.Attributes.Windows.cs b/src/libraries/Common/src/System/IO/FileSystem.Attributes.Windows.cs
index 7e7afcec97a726..dab4cf7a8f6c5c 100644
--- a/src/libraries/Common/src/System/IO/FileSystem.Attributes.Windows.cs
+++ b/src/libraries/Common/src/System/IO/FileSystem.Attributes.Windows.cs
@@ -15,7 +15,7 @@ internal static partial class FileSystem
{
public static bool DirectoryExists(string? fullPath)
{
- return DirectoryExists(fullPath, out int lastError);
+ return DirectoryExists(fullPath, out _);
}
private static bool DirectoryExists(string? path, out int lastError)
diff --git a/src/libraries/Common/src/System/IO/TempFileCollection.cs b/src/libraries/Common/src/System/IO/TempFileCollection.cs
index 4c29dc0e70c389..95ca600bf2fab7 100644
--- a/src/libraries/Common/src/System/IO/TempFileCollection.cs
+++ b/src/libraries/Common/src/System/IO/TempFileCollection.cs
@@ -116,8 +116,8 @@ private void EnsureTempNameCreated()
{
if (_basePath == null)
{
- string tempFileName = null;
- bool uniqueFile = false;
+ string tempFileName;
+ bool uniqueFile;
int retryCount = 5000;
do
{
diff --git a/src/libraries/Common/src/System/Net/NTAuthentication.Common.cs b/src/libraries/Common/src/System/Net/NTAuthentication.Common.cs
index 148d1dc9a0700c..a46e7314c9f507 100644
--- a/src/libraries/Common/src/System/Net/NTAuthentication.Common.cs
+++ b/src/libraries/Common/src/System/Net/NTAuthentication.Common.cs
@@ -179,8 +179,7 @@ internal int MakeSignature(byte[] buffer, int offset, int count, [AllowNull] ref
}
else
{
- SecurityStatusPal statusCode;
- decodedOutgoingBlob = GetOutgoingBlob(decodedIncomingBlob, true, out statusCode);
+ decodedOutgoingBlob = GetOutgoingBlob(decodedIncomingBlob, true);
}
string? outgoingBlob = null;
@@ -199,8 +198,7 @@ internal int MakeSignature(byte[] buffer, int offset, int count, [AllowNull] ref
internal byte[]? GetOutgoingBlob(byte[]? incomingBlob, bool thrownOnError)
{
- SecurityStatusPal statusCode;
- return GetOutgoingBlob(incomingBlob, thrownOnError, out statusCode);
+ return GetOutgoingBlob(incomingBlob, thrownOnError, out _);
}
// Accepts an incoming binary security blob and returns an outgoing binary security blob.
diff --git a/src/libraries/Common/src/System/Resources/ResourceWriter.cs b/src/libraries/Common/src/System/Resources/ResourceWriter.cs
index 71697a29e04bbe..b9184070fbc8be 100644
--- a/src/libraries/Common/src/System/Resources/ResourceWriter.cs
+++ b/src/libraries/Common/src/System/Resources/ResourceWriter.cs
@@ -595,7 +595,7 @@ private void WriteValue(ResourceTypeCode typeCode, object? value, BinaryWriter w
s.Position = 0;
writer.Write((int)s.Length);
byte[] buffer = new byte[4096];
- int read = 0;
+ int read;
while ((read = s.Read(buffer, 0, buffer.Length)) != 0)
{
writer.Write(buffer, 0, read);
diff --git a/src/libraries/Common/src/System/Runtime/InteropServices/ArrayMarshaller.cs b/src/libraries/Common/src/System/Runtime/InteropServices/ArrayMarshaller.cs
index dc11f7efd42157..a1b99ab9223774 100644
--- a/src/libraries/Common/src/System/Runtime/InteropServices/ArrayMarshaller.cs
+++ b/src/libraries/Common/src/System/Runtime/InteropServices/ArrayMarshaller.cs
@@ -67,7 +67,8 @@ public ArrayMarshaller(T[]? managed, Span stackSpace, int sizeOfNativeElem
/// Number kept small to ensure that P/Invokes with a lot of array parameters doesn't
/// blow the stack since this is a new optimization in the code-generated interop.
///
- public const int StackBufferSize = 0x200;
+ public const int BufferSize = 0x200;
+ public const bool RequiresStackBuffer = true;
public Span ManagedValues => _managedArray;
@@ -160,7 +161,8 @@ public PtrArrayMarshaller(T*[]? managed, Span stackSpace, int sizeOfNative
/// Number kept small to ensure that P/Invokes with a lot of array parameters doesn't
/// blow the stack since this is a new optimization in the code-generated interop.
///
- public const int StackBufferSize = 0x200;
+ public const int BufferSize = 0x200;
+ public const bool RequiresStackBuffer = true;
public Span ManagedValues => Unsafe.As(_managedArray);
diff --git a/src/libraries/Common/src/System/Security/Cryptography/EccSecurityTransforms.macOS.cs b/src/libraries/Common/src/System/Security/Cryptography/EccSecurityTransforms.macOS.cs
index af0bdd21d7dc95..8e9c3f8790acd4 100644
--- a/src/libraries/Common/src/System/Security/Cryptography/EccSecurityTransforms.macOS.cs
+++ b/src/libraries/Common/src/System/Security/Cryptography/EccSecurityTransforms.macOS.cs
@@ -29,7 +29,7 @@ private static ECParameters ExportParametersFromLegacyKey(SecKeyPair keys, bool
{
EccKeyFormatHelper.ReadSubjectPublicKeyInfo(
keyBlob,
- out int localRead,
+ out _,
out ECParameters key);
return key;
}
@@ -38,7 +38,7 @@ private static ECParameters ExportParametersFromLegacyKey(SecKeyPair keys, bool
EccKeyFormatHelper.ReadEncryptedPkcs8(
keyBlob,
ExportPassword,
- out int localRead,
+ out _,
out ECParameters key);
return key;
}
diff --git a/src/libraries/Common/src/System/Security/Cryptography/RSAAndroid.cs b/src/libraries/Common/src/System/Security/Cryptography/RSAAndroid.cs
index fcd2d846a265cb..c78de735480356 100644
--- a/src/libraries/Common/src/System/Security/Cryptography/RSAAndroid.cs
+++ b/src/libraries/Common/src/System/Security/Cryptography/RSAAndroid.cs
@@ -690,7 +690,7 @@ public override byte[] SignHash(byte[] hash, HashAlgorithmName hashAlgorithm, RS
Span.Empty,
hashAlgorithm, padding,
true,
- out int bytesWritten,
+ out _,
out byte[]? signature))
{
Debug.Fail("TrySignHash should not return false in allocation mode");
diff --git a/src/libraries/Common/src/System/Security/Cryptography/RSAOpenSsl.cs b/src/libraries/Common/src/System/Security/Cryptography/RSAOpenSsl.cs
index f80a641a98f019..149e240893039b 100644
--- a/src/libraries/Common/src/System/Security/Cryptography/RSAOpenSsl.cs
+++ b/src/libraries/Common/src/System/Security/Cryptography/RSAOpenSsl.cs
@@ -762,7 +762,7 @@ public override byte[] SignHash(byte[] hash, HashAlgorithmName hashAlgorithm, RS
Span.Empty,
hashAlgorithm, padding,
true,
- out int bytesWritten,
+ out _,
out byte[]? signature))
{
Debug.Fail("TrySignHash should not return false in allocation mode");
diff --git a/src/libraries/Common/src/System/Security/Cryptography/RSASecurityTransforms.cs b/src/libraries/Common/src/System/Security/Cryptography/RSASecurityTransforms.cs
index 29ce858255e768..7bce2648d443a9 100644
--- a/src/libraries/Common/src/System/Security/Cryptography/RSASecurityTransforms.cs
+++ b/src/libraries/Common/src/System/Security/Cryptography/RSASecurityTransforms.cs
@@ -564,7 +564,7 @@ public override bool VerifyHash(ReadOnlySpan hash, ReadOnlySpan sign
if (padding == RSASignaturePadding.Pkcs1)
{
Interop.AppleCrypto.PAL_HashAlgorithm palAlgId =
- PalAlgorithmFromAlgorithmName(hashAlgorithm, out int expectedSize);
+ PalAlgorithmFromAlgorithmName(hashAlgorithm, out _);
return Interop.AppleCrypto.VerifySignature(
GetKeys().PublicKey,
hash,
diff --git a/src/libraries/Common/src/System/Security/Cryptography/RSASecurityTransforms.macOS.cs b/src/libraries/Common/src/System/Security/Cryptography/RSASecurityTransforms.macOS.cs
index 8496d3ab2fc0e0..2a99e40a129df2 100644
--- a/src/libraries/Common/src/System/Security/Cryptography/RSASecurityTransforms.macOS.cs
+++ b/src/libraries/Common/src/System/Security/Cryptography/RSASecurityTransforms.macOS.cs
@@ -62,7 +62,7 @@ private static RSAParameters ExportParametersFromLegacyKey(SecKeyPair keys, bool
RSAKeyFormatHelper.ReadEncryptedPkcs8(
keyBlob,
ExportPassword,
- out int localRead,
+ out _,
out RSAParameters key);
return key;
}
diff --git a/src/libraries/Common/tests/SourceGenerators/LiveReferencePack.cs b/src/libraries/Common/tests/SourceGenerators/LiveReferencePack.cs
new file mode 100644
index 00000000000000..7d04c4b278145c
--- /dev/null
+++ b/src/libraries/Common/tests/SourceGenerators/LiveReferencePack.cs
@@ -0,0 +1,31 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System.Collections.Immutable;
+using System.IO;
+using System.Linq;
+
+using Microsoft.CodeAnalysis;
+
+namespace SourceGenerators.Tests
+{
+ internal static class LiveReferencePack
+ {
+ ///
+ /// Get the metadata references for the reference assemblies from the live build.
+ ///
+ /// The metadata references
+ ///
+ /// This function assumes the references are in a live-ref-pack subfolder next to the
+ /// containing assembly. Test projects can set TestRunRequiresLiveRefPack to copy the
+ /// live references to a live-ref-pack subfolder in their output directory.
+ ///
+ public static ImmutableArray GetMetadataReferences()
+ {
+ string testDirectory = Path.GetDirectoryName(typeof(LiveReferencePack).Assembly.Location)!;
+ return Directory.EnumerateFiles(Path.Combine(testDirectory, "live-ref-pack"))
+ .Select(f => MetadataReference.CreateFromFile(f))
+ .ToImmutableArray();
+ }
+ }
+}
diff --git a/src/libraries/Common/tests/System/Collections/DebugView.Tests.cs b/src/libraries/Common/tests/System/Collections/DebugView.Tests.cs
index 35e6b16b654158..d363af3479c3bb 100644
--- a/src/libraries/Common/tests/System/Collections/DebugView.Tests.cs
+++ b/src/libraries/Common/tests/System/Collections/DebugView.Tests.cs
@@ -60,7 +60,7 @@ public static IEnumerable