Add a rule to flag P/Invoke declarations passing string parameters by value with the [Out] attribute, which can destabilize the runtime if the string is an interned string.
// Flag [Out] string
[DllImport("MyLibrary")]
private static extern void Foo([Out] string s);
// OK
[DllImport("MyLibrary")]
private static extern void Bar(out string s1, [Out] ref string s2);
Category: Interoperability
Default: Enabled
cc @terrajobst @stephentoub @AaronRobinsonMSFT @jkoritzinsky
Add a rule to flag P/Invoke declarations passing
stringparameters by value with the[Out]attribute, which can destabilize the runtime if the string is an interned string.Category: Interoperability
Default: Enabled
cc @terrajobst @stephentoub @AaronRobinsonMSFT @jkoritzinsky