diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 6d3f2efaf848ce..978b716216ae93 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.22053.2", "commands": [ "xharness" ] 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. ![New codespace button](https://docs.github.com/assets/images/help/codespaces/new-codespace-button.png) -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. ![Codespace machine size](./codespace-machine-size.png) 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..0a216b7320100a 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 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..6267584b91fd12 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,8 +1,8 @@ - + https://github.com/dotnet/icu - d9371f17932fbf828f1d1e2f21a99b64ba40eba5 + 35aca8766e42ad0f9ef458c4106917f1075cf230 https://github.com/dotnet/msquic @@ -16,111 +16,111 @@ https://github.com/dotnet/wcf 7f504aabb1988e9a093c1e74d8040bd52feb2f01 - + https://github.com/dotnet/llvm-project - ef5d90bc37b53288e32d78dbf34eae32cd0893d3 + 58a3ab6364cc934622ae0b09c3ef09768723a4e1 - + https://github.com/dotnet/llvm-project - ef5d90bc37b53288e32d78dbf34eae32cd0893d3 + 58a3ab6364cc934622ae0b09c3ef09768723a4e1 - + https://github.com/dotnet/llvm-project - ef5d90bc37b53288e32d78dbf34eae32cd0893d3 + 58a3ab6364cc934622ae0b09c3ef09768723a4e1 - + https://github.com/dotnet/llvm-project - ef5d90bc37b53288e32d78dbf34eae32cd0893d3 + 58a3ab6364cc934622ae0b09c3ef09768723a4e1 - + https://github.com/dotnet/llvm-project - ef5d90bc37b53288e32d78dbf34eae32cd0893d3 + 58a3ab6364cc934622ae0b09c3ef09768723a4e1 - + https://github.com/dotnet/llvm-project - ef5d90bc37b53288e32d78dbf34eae32cd0893d3 + 58a3ab6364cc934622ae0b09c3ef09768723a4e1 - + https://github.com/dotnet/llvm-project - ef5d90bc37b53288e32d78dbf34eae32cd0893d3 + 58a3ab6364cc934622ae0b09c3ef09768723a4e1 - + https://github.com/dotnet/llvm-project - ef5d90bc37b53288e32d78dbf34eae32cd0893d3 + 58a3ab6364cc934622ae0b09c3ef09768723a4e1 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + a0f6d2432ce3d1bb30ee747bb534f477c75fd667 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + a0f6d2432ce3d1bb30ee747bb534f477c75fd667 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + a0f6d2432ce3d1bb30ee747bb534f477c75fd667 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + a0f6d2432ce3d1bb30ee747bb534f477c75fd667 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + a0f6d2432ce3d1bb30ee747bb534f477c75fd667 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + a0f6d2432ce3d1bb30ee747bb534f477c75fd667 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + a0f6d2432ce3d1bb30ee747bb534f477c75fd667 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + a0f6d2432ce3d1bb30ee747bb534f477c75fd667 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + a0f6d2432ce3d1bb30ee747bb534f477c75fd667 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + a0f6d2432ce3d1bb30ee747bb534f477c75fd667 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + a0f6d2432ce3d1bb30ee747bb534f477c75fd667 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + a0f6d2432ce3d1bb30ee747bb534f477c75fd667 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + a0f6d2432ce3d1bb30ee747bb534f477c75fd667 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + a0f6d2432ce3d1bb30ee747bb534f477c75fd667 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + a0f6d2432ce3d1bb30ee747bb534f477c75fd667 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + a0f6d2432ce3d1bb30ee747bb534f477c75fd667 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + a0f6d2432ce3d1bb30ee747bb534f477c75fd667 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + a0f6d2432ce3d1bb30ee747bb534f477c75fd667 https://github.com/microsoft/vstest @@ -202,53 +202,57 @@ https://github.com/dotnet/llvm-project 662aff66999c435aec09c58643e9fd703eadc3e0 - + https://github.com/dotnet/runtime - 834b278911962102919b3a7dec22ca6cb26bfa8a + c8f3b36d6d5da74333c6755ccd5687127bcd9905 - + https://github.com/dotnet/runtime - 834b278911962102919b3a7dec22ca6cb26bfa8a + c8f3b36d6d5da74333c6755ccd5687127bcd9905 - + https://github.com/dotnet/runtime - 834b278911962102919b3a7dec22ca6cb26bfa8a + c8f3b36d6d5da74333c6755ccd5687127bcd9905 - + https://github.com/dotnet/runtime - 834b278911962102919b3a7dec22ca6cb26bfa8a + c8f3b36d6d5da74333c6755ccd5687127bcd9905 - + https://github.com/dotnet/runtime - 834b278911962102919b3a7dec22ca6cb26bfa8a + c8f3b36d6d5da74333c6755ccd5687127bcd9905 - + https://github.com/dotnet/runtime - 834b278911962102919b3a7dec22ca6cb26bfa8a + c8f3b36d6d5da74333c6755ccd5687127bcd9905 - + https://github.com/dotnet/runtime - 834b278911962102919b3a7dec22ca6cb26bfa8a + c8f3b36d6d5da74333c6755ccd5687127bcd9905 - + https://github.com/dotnet/runtime - 834b278911962102919b3a7dec22ca6cb26bfa8a + c8f3b36d6d5da74333c6755ccd5687127bcd9905 - + https://github.com/dotnet/linker - 41467d340a3345f08cb8ba67c20c1ea40c57682f + 1a6468ff722c8d362f37638989ec01ab9975ac28 - + https://github.com/dotnet/xharness - 7ad8d01a879af9437a7c33d01409bd761700cdad + 7c293e5b676eb5b57418f775587badad65ec07f5 - + https://github.com/dotnet/xharness - 7ad8d01a879af9437a7c33d01409bd761700cdad + 7c293e5b676eb5b57418f775587badad65ec07f5 - + + https://github.com/dotnet/xharness + 7c293e5b676eb5b57418f775587badad65ec07f5 + + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + a0f6d2432ce3d1bb30ee747bb534f477c75fd667 https://dev.azure.com/dnceng/internal/_git/dotnet-optimization @@ -266,9 +270,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-optimization 91d6b3c1f51888d166701510189505f35714665c - + https://github.com/dotnet/hotreload-utils - f0d838421286fed81005fd4ddf6562555b641b3b + 49dd195f467aa45d467a38ca02ae95d1b59062ce https://github.com/dotnet/runtime-assets diff --git a/eng/Versions.props b/eng/Versions.props index 47d31b37c8e334..92cfc5d2f3a554 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.1 3.3.2 - 4.0.0-4.final - 4.0.0-4.final + 4.0.1 + 4.0.1 7.0.0-preview1.21613.1 2.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.22053.2 + 7.0.0-beta.22053.2 + 7.0.0-beta.22053.2 + 7.0.0-beta.22053.2 + 7.0.0-beta.22053.2 + 7.0.0-beta.22053.2 + 2.5.1-beta.22053.2 + 7.0.0-beta.22053.2 + 7.0.0-beta.22053.2 + 7.0.0-beta.22053.2 + 7.0.0-beta.22053.2 + 7.0.0-beta.22053.2 + 7.0.0-beta.22053.2 + 7.0.0-beta.22053.2 + 7.0.0-beta.22053.2 6.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.22052.8 + 7.0.0-alpha.1.22052.8 + 7.0.0-alpha.1.22052.8 3.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.22052.8 + 1.0.0-alpha.1.22052.1 + 1.0.0-alpha.1.22052.1 + 1.0.0-alpha.1.22052.1 + 1.0.0-alpha.1.22052.1 + 1.0.0-alpha.1.22052.1 + 1.0.0-alpha.1.22052.1 + 1.0.0-alpha.1.22052.1 + 1.0.0-alpha.1.22052.1 5.0.0 4.3.0 @@ -120,11 +120,11 @@ 5.0.0 5.0.0 4.9.0-rc2.21473.1 - 7.0.0-alpha.1.21620.1 - 7.0.0-alpha.1.21620.1 + 7.0.0-alpha.1.22052.8 + 7.0.0-alpha.1.22052.8 4.5.4 4.5.0 - 7.0.0-alpha.1.21620.1 + 7.0.0-alpha.1.22052.8 7.0.0-beta.21620.3 7.0.0-beta.21620.3 @@ -160,12 +160,13 @@ 1.0.1-prerelease-00006 16.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.22053.2 + 1.0.0-prerelease.22053.2 + 1.0.0-prerelease.22053.2 + 1.0.2-alpha.0.22053.3 2.4.2-pre.9 2.4.2 - 1.3.0 + 3.1.0 12.0.3 2.0.4 4.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.22053.1 7.0.0-alpha.1.21529.3 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/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/testing/WasmRunnerTemplate.cmd b/eng/testing/WasmRunnerTemplate.cmd index 9382fa8368fc53..a668ce2c6a464c 100644 --- a/eng/testing/WasmRunnerTemplate.cmd +++ b/eng/testing/WasmRunnerTemplate.cmd @@ -48,7 +48,7 @@ if /I [%XHARNESS_COMMAND%] == [test] ( set "JS_ENGINE_ARGS=--engine-arg^=--stack-trace-limit^=1000" ) ) else ( - if [%BROWSER_PATH%] == [] ( + if [%BROWSER_PATH%] == [] if not [%HELIX_CORRELATION_PAYLOAD%] == [] ( set "BROWSER_PATH=--browser-path^=%HELIX_CORRELATION_PAYLOAD%\chrome-win\chrome.exe" ) ) diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets index 8c7a6a44a5d22f..c41a0d28e03375 100644 --- a/eng/testing/tests.ioslike.targets +++ b/eng/testing/tests.ioslike.targets @@ -130,7 +130,6 @@ - @@ -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..16691a4405b23b 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.22053.2", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22053.2", + "Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.22053.2", + "Microsoft.DotNet.SharedFramework.Sdk": "7.0.0-beta.22053.2", "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.22052.8" } } 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..a79cbb3c0ff0c9 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 */ ) { diff --git a/src/coreclr/ToolBox/superpmi/superpmi/icorjitinfo.cpp b/src/coreclr/ToolBox/superpmi/superpmi/icorjitinfo.cpp index 3ff21d07fb59f0..17faf7a1442620 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 */ ) { 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/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/debug/daccess/daccess.cpp b/src/coreclr/debug/daccess/daccess.cpp index f9ec95c1f41838..5c2c55cfe439bf 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; @@ -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 @@ -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/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/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