Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore calls to SymInitialize and SymCleanup #105

Merged
merged 1 commit into from
Nov 9, 2022

Conversation

arvindshmicrosoft
Copy link
Member

No description provided.

@@ -10,7 +10,7 @@
int rawsize = Marshal.SizeOf(guid);
IntPtr buffer = Marshal.AllocHGlobal(rawsize);
Marshal.StructureToPtr(guid, buffer, false);
bool success = SafeNativeMethods.SymFindFileInPath(IntPtr.Zero, symPath, pdbFilename, buffer, pdbAge, 0, 8, outPath, IntPtr.Zero, IntPtr.Zero);
bool success = SafeNativeMethods.SymFindFileInPath((IntPtr)(-1), null, pdbFilename, buffer, pdbAge, 0, 8, outPath, IntPtr.Zero, IntPtr.Zero);

Check notice

Code scanning / CodeQL

Calls to unmanaged code

Replace this call with a call to managed code if possible.
@@ -22,6 +22,7 @@
var retval = new List<string>();
Contract.Requires(null != syms);
Contract.Requires(null != parent);
if (!SafeNativeMethods.SymInitialize((IntPtr)(-1), symPath, false)) return retval;

Check notice

Code scanning / CodeQL

Calls to unmanaged code

Replace this call with a call to managed code if possible.
@@ -35,6 +36,7 @@
progress++;
parent.PercentComplete = (int)((double)progress / syms.Count * 100.0);
}
SafeNativeMethods.SymCleanup((IntPtr)(-1));

Check notice

Code scanning / CodeQL

Calls to unmanaged code

Replace this call with a call to managed code if possible.
private extern static bool ReleaseActCtx(IntPtr hActCtx);
[DllImport("Kernel32.dll")] private extern static IntPtr CreateActCtx(ref ACTCTX actctx);
[DllImport("Kernel32.dll")] private extern static bool ActivateActCtx(IntPtr hActCtx, out IntPtr lpCookie);
[DllImport("Kernel32.dll")] private extern static bool DeactivateActCtx(uint dwFlags, IntPtr lpCookie);

Check notice

Code scanning / CodeQL

Unmanaged code

Minimise the use of unmanaged code.
[DllImport("Kernel32.dll")] private extern static IntPtr CreateActCtx(ref ACTCTX actctx);
[DllImport("Kernel32.dll")] private extern static bool ActivateActCtx(IntPtr hActCtx, out IntPtr lpCookie);
[DllImport("Kernel32.dll")] private extern static bool DeactivateActCtx(uint dwFlags, IntPtr lpCookie);
[DllImport("Kernel32.dll")] private extern static bool ReleaseActCtx(IntPtr hActCtx);

Check notice

Code scanning / CodeQL

Unmanaged code

Minimise the use of unmanaged code.
[MarshalAs(UnmanagedType.LPWStr)] string SearchPath, [MarshalAs(UnmanagedType.LPWStr)] string FileName, IntPtr id,
Int32 two, Int32 three, Int32 flags, [Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder filePath, IntPtr callback, IntPtr context);

[DllImport("dbghelp.dll")] public static extern bool SymCleanup(IntPtr hProcess);

Check notice

Code scanning / CodeQL

Unmanaged code

Minimise the use of unmanaged code.

[DllImport("dbghelp.dll")] public static extern bool SymCleanup(IntPtr hProcess);

[DllImport("dbghelp.dll", CharSet = CharSet.Unicode)] public static extern bool SymInitialize(IntPtr hProcess, [MarshalAs(UnmanagedType.LPWStr)] string UserSearchPath, bool fInvadeProcess);

Check notice

Code scanning / CodeQL

Unmanaged code

Minimise the use of unmanaged code.
private extern static bool DeactivateActCtx(uint dwFlags, IntPtr lpCookie);
[DllImport("Kernel32.dll")]
private extern static bool ReleaseActCtx(IntPtr hActCtx);
[DllImport("Kernel32.dll")] private extern static IntPtr CreateActCtx(ref ACTCTX actctx);

Check notice

Code scanning / CodeQL

Unmanaged code

Minimise the use of unmanaged code.
[DllImport("Kernel32.dll")]
private extern static bool ReleaseActCtx(IntPtr hActCtx);
[DllImport("Kernel32.dll")] private extern static IntPtr CreateActCtx(ref ACTCTX actctx);
[DllImport("Kernel32.dll")] private extern static bool ActivateActCtx(IntPtr hActCtx, out IntPtr lpCookie);

Check notice

Code scanning / CodeQL

Unmanaged code

Minimise the use of unmanaged code.
[Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder filePath,
IntPtr callback,
IntPtr context);
[DllImport("dbghelp.dll", CharSet = CharSet.Unicode)] public static extern bool SymFindFileInPath(IntPtr hProcess,

Check notice

Code scanning / CodeQL

Unmanaged code

Minimise the use of unmanaged code.
@arvindshmicrosoft arvindshmicrosoft merged commit 42c3247 into main Nov 9, 2022
@arvindshmicrosoft arvindshmicrosoft deleted the revert-dbghelp-handling-of-url branch November 9, 2022 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant