C#: Add alert suppression comments. Rename e to ex in catch clauses for consistency.

This commit is contained in:
calum
2019-01-11 12:32:24 +00:00
parent fb0cae87a8
commit a44a86bf6f
14 changed files with 31 additions and 31 deletions

View File

@@ -70,7 +70,7 @@ namespace Semmle.Util
/// <returns>The canonical path.</returns>
public override string GetCanonicalPath(string path, IPathCache cache)
{
using (var hFile = Win32.CreateFile(
using (var hFile = Win32.CreateFile( // lgtm[cs/call-to-unmanaged-code]
path,
0,
Win32.FILE_SHARE_READ | Win32.FILE_SHARE_WRITE,
@@ -88,13 +88,13 @@ namespace Semmle.Util
else
{
StringBuilder outPath = new StringBuilder(Win32.MAX_PATH);
int length = Win32.GetFinalPathNameByHandle(hFile, outPath, outPath.Capacity, 0);
int length = Win32.GetFinalPathNameByHandle(hFile, outPath, outPath.Capacity, 0); // lgtm[cs/call-to-unmanaged-code]
if (length >= outPath.Capacity)
{
// Path length exceeded MAX_PATH.
// Possible if target has a long path.
outPath = new StringBuilder(length + 1);
length = Win32.GetFinalPathNameByHandle(hFile, outPath, outPath.Capacity, 0);
length = Win32.GetFinalPathNameByHandle(hFile, outPath, outPath.Capacity, 0); // lgtm[cs/call-to-unmanaged-code]
}
const int PREAMBLE = 4; // outPath always starts \\?\