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

Fixed incorrect definition on API DbgUiSetThreadDebugObject #387

Merged
merged 2 commits into from
Apr 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 1 addition & 9 deletions PInvoke/NtDll/Winternl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -302,16 +302,8 @@ public enum SUBSYSTEM_INFORMATION_TYPE

/// <summary>Set the debug object handle in the TEB. This function is UNDOCUMENTED.</summary>
/// <param name="DebugObjectHandle">Debug object handle. Retrieve from NtQueryInformationProcess</param>
/// <returns>
/// <para>The function returns an NTSTATUS success or error code.</para>
/// <para>
/// The forms and significance of NTSTATUS error codes are listed in the Ntstatus.h header file available in the DDK, and are
/// described in the DDK documentation under Kernel-Mode Driver Architecture / Design Guide / Driver Programming Techniques /
/// Logging Errors.
/// </para>
/// </returns>
[DllImport(Lib.NtDll, SetLastError = false, ExactSpelling = true)]
public static extern NTStatus DbgUiSetThreadDebugObject(IntPtr DebugObjectHandle);
public static extern void DbgUiSetThreadDebugObject(IntPtr DebugObjectHandle);

/// <summary>Call the kernel to remove the debug object. This function is UNDOCUMENTED.</summary>
/// <param name="ProcessHandle">The process handle.</param>
Expand Down
4 changes: 2 additions & 2 deletions UnitTests/PInvoke/NtDll/WinternlTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void DbgUiSetThreadDebugObjectAndNtRemoveProcessDebugTest()

try
{
Assert.That(DbgUiSetThreadDebugObject(DebugObjectHandleQueryResult.Value), ResultIs.Successful);
DbgUiSetThreadDebugObject(DebugObjectHandleQueryResult.Value);

try
{
Expand Down Expand Up @@ -114,7 +114,7 @@ public void DbgUiSetThreadDebugObjectAndNtRemoveProcessDebugTest()
}
finally
{
Assert.That(DbgUiSetThreadDebugObject(IntPtr.Zero), ResultIs.Successful);
DbgUiSetThreadDebugObject(IntPtr.Zero);
}
}
finally
Expand Down