Skip to content

Commit 15e9505

Browse files
authored
Merge pull request #1 from gewarren/reliability
Fix acrolinx score
2 parents e7bc74a + 7d23a2a commit 15e9505

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/code-quality/ca2001.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@ Avoid making unnecessary and potentially dangerous method calls. A violation of
3535
|Method|Description|
3636
|------------|-----------------|
3737
|<xref:System.GC.Collect%2A?displayProperty=fullName>|Calling GC.Collect can significantly affect application performance and is rarely necessary. For more information, see [Rico Mariani's Performance Tidbits](http://go.microsoft.com/fwlink/?LinkId=169256) blog entry on MSDN.|
38-
|<xref:System.Threading.Thread.Resume%2A?displayProperty=fullName><br /><br /> <xref:System.Threading.Thread.Suspend%2A?displayProperty=fullName>|Thread.Suspend and Thread.Resume have been deprecated because of their unpredictable behavior. Use other classes in the <xref:System.Threading> namespace, such as <xref:System.Threading.Monitor>, <xref:System.Threading.Mutex>, and <xref:System.Threading.Semaphore>, to synchronize threads or protect resources.|
39-
|<xref:System.Runtime.InteropServices.SafeHandle.DangerousGetHandle%2A?displayProperty=fullName>|The DangerousGetHandle method poses a security risk because it can return a handle that is not valid. See the <xref:System.Runtime.InteropServices.SafeHandle.DangerousAddRef%2A> and the <xref:System.Runtime.InteropServices.SafeHandle.DangerousRelease%2A> methods for more information about how to use the DangerousGetHandle method safely.|
40-
|<xref:System.Reflection.Assembly.LoadFrom%2A?displayProperty=fullName><br /><br /> <xref:System.Reflection.Assembly.LoadFile%2A?displayProperty=fullName><br /><br /> <xref:System.Reflection.Assembly.LoadWithPartialName%2A?displayProperty=fullName>|These methods can load assemblies from unexpected locations. For example, see Suzanne Cook's .NET CLR Notes blog posts [LoadFile vs. LoadFrom](http://go.microsoft.com/fwlink/?LinkId=164450) and [Choosing a Binding Context](http://go.microsoft.com/fwlink/?LinkId=164451) for information about methods that load assemblies.|
41-
|[CoSetProxyBlanket](http://go.microsoft.com/fwlink/?LinkID=169250) (Ole32)<br /><br /> [CoInitializeSecurity](http://go.microsoft.com/fwlink/?LinkId=169255) (Ole32)|By the time the user code starts executing in a managed process, it is too late to reliably call CoSetProxyBlanket. The common language runtime (CLR) takes initialization actions that may prevent the users P/Invoke from succeeding.<br /><br /> If you do have to call CoSetProxyBlanket for a managed application, we recommend that you start the process by using a native code (C++) executable, call CoSetProxyBlanket in the native code, and then start your managed code application in process. (Be sure to specify a runtime version number.)|
38+
|<xref:System.Threading.Thread.Resume%2A?displayProperty=fullName><br /><br /><xref:System.Threading.Thread.Suspend%2A?displayProperty=fullName>|Thread.Suspend and Thread.Resume have been deprecated because of their unpredictable behavior. Use other classes in the <xref:System.Threading> namespace, such as <xref:System.Threading.Monitor>, <xref:System.Threading.Mutex>, and <xref:System.Threading.Semaphore>, to synchronize threads or protect resources.|
39+
|<xref:System.Runtime.InteropServices.SafeHandle.DangerousGetHandle%2A?displayProperty=fullName>|The `DangerousGetHandle` method poses a security risk because it can return a handle that's not valid. For more information about how to use the `DangerousGetHandle` method safely, see the <xref:System.Runtime.InteropServices.SafeHandle.DangerousAddRef%2A> and <xref:System.Runtime.InteropServices.SafeHandle.DangerousRelease%2A> methods.|
40+
|<xref:System.Reflection.Assembly.LoadFrom%2A?displayProperty=fullName><br /><br /><xref:System.Reflection.Assembly.LoadFile%2A?displayProperty=fullName><br /><br /><xref:System.Reflection.Assembly.LoadWithPartialName%2A?displayProperty=fullName>|These methods can load assemblies from unexpected locations. For example, see Suzanne Cook's .NET CLR Notes blog posts [LoadFile vs. LoadFrom](http://go.microsoft.com/fwlink/?LinkId=164450) and [Choosing a Binding Context](http://go.microsoft.com/fwlink/?LinkId=164451) for information about methods that load assemblies.|
41+
|[CoSetProxyBlanket](/windows/win32/api/combaseapi/nf-combaseapi-cosetproxyblanket)<br /><br />[CoInitializeSecurity](/windows/win32/api/combaseapi/nf-combaseapi-coinitializesecurity)|By the time the user code starts executing in a managed process, it's too late to reliably call `CoSetProxyBlanket`. The common language runtime (CLR) takes initialization actions that may prevent the users P/Invoke from succeeding.<br /><br />If you do have to call `CoSetProxyBlanket` for a managed application, we recommend that you start the process by using a native code (C++) executable, call `CoSetProxyBlanket` in the native code, and then start your managed code application in process. (Be sure to specify a runtime version number.)|
4242

4343
## How to fix violations
4444

4545
To fix a violation of this rule, remove or replace the call to the dangerous or problematic method.
4646

4747
## When to suppress warnings
4848

49-
You should suppress messages from this rule only when no alternatives to the problematic method are available.
49+
Suppress messages from this rule only when no alternatives to the problematic method are available.
5050

5151
## See also
5252

0 commit comments

Comments
 (0)