summaryrefslogtreecommitdiff
path: root/src/dlls
diff options
context:
space:
mode:
authorJeremy Koritzinsky <jkoritzinsky@gmail.com>2019-02-06 13:05:28 -0800
committerGitHub <noreply@github.com>2019-02-06 13:05:28 -0800
commit2f88f32ffb6752c89e6751b4747f1b9cd971304d (patch)
tree16a5e8e49cbb2d50df37a3d3b6f219de75f28c28 /src/dlls
parentd5e903e7f8e881ef9fa8840df863422df4a7c62e (diff)
downloadcoreclr-2f88f32ffb6752c89e6751b4747f1b9cd971304d.tar.gz
coreclr-2f88f32ffb6752c89e6751b4747f1b9cd971304d.tar.bz2
coreclr-2f88f32ffb6752c89e6751b4747f1b9cd971304d.zip
Throw an exception when passing strings by-value as out parameters. (#21513)
* Throw an exception when passing strings by-value as out parameters. * Fix encoding * Don't use override in this PR. * Clean up Marshal_In Marshal_In was copied back into existence from Marshal_InOut. Clean it up a bit. * Remove extraneous whitespace. * Fix failing test. * Remove out attribute in COM string tests. * Add back attribute and check for exception thow in COM tests. * Add block comment to explain the implementation of Reverse_LPWStr_OutAttr in the NETServer. * Only throw in a CLR->Native marshalling situation. * Fix asserts from changed code-paths used in ILWSTRMarshaler. * Add comment and explicitly load in a null value (instead of leaving it uninitialized). * Apply suggestions from code review Co-Authored-By: jkoritzinsky <jkoritzinsky@gmail.com> Co-authored-by: Jan Vorlicek <janvorli@microsoft.com>
Diffstat (limited to 'src/dlls')
-rw-r--r--src/dlls/mscorrc/mscorrc.rc1
-rw-r--r--src/dlls/mscorrc/resource.h3
2 files changed, 2 insertions, 2 deletions
diff --git a/src/dlls/mscorrc/mscorrc.rc b/src/dlls/mscorrc/mscorrc.rc
index 355c902233..a0616a2e67 100644
--- a/src/dlls/mscorrc/mscorrc.rc
+++ b/src/dlls/mscorrc/mscorrc.rc
@@ -657,6 +657,7 @@ BEGIN
IDS_EE_BADMARSHAL_BADMETADATA "Invalid marshaling metadata."
IDS_EE_BADMARSHAL_CUSTOMMARSHALER "Custom marshalers are only allowed on classes, strings, arrays, and boxed value types."
IDS_EE_BADMARSHAL_GENERICS_RESTRICTION "Generic types cannot be marshaled."
+ IDS_EE_BADMARSHAL_STRING_OUT "Cannot marshal a string by-value with the [Out] attribute."
IDS_EE_BADMARSHALPARAM_STRINGBUILDER "Invalid managed/unmanaged type combination (StringBuilders must be paired with LPStr, LPWStr, or LPTStr)."
IDS_EE_BADMARSHALPARAM_NO_LPTSTR "Invalid managed/unmanaged type combination (Strings cannot be paired with LPTStr for parameters and return types of methods in interfaces exposed to COM)."
diff --git a/src/dlls/mscorrc/resource.h b/src/dlls/mscorrc/resource.h
index 500ee74642..6d137f75bd 100644
--- a/src/dlls/mscorrc/resource.h
+++ b/src/dlls/mscorrc/resource.h
@@ -722,5 +722,4 @@
#define IDS_EE_NDIRECT_GETPROCADDR_WIN_DLL 0x2644
#define IDS_EE_NDIRECT_GETPROCADDR_UNIX_SO 0x2645
-
-
+#define IDS_EE_BADMARSHAL_STRING_OUT 0x2646