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

Conversation

zhuxb711
Copy link

@zhuxb711 zhuxb711 commented Apr 5, 2023

DbgUiSetThreadDebugObject do not return any value, we should mark it as "void". See this screenshot from ReactOS.
Return NTStatus is not correct and might cause some issues.

image

@zhuxb711
Copy link
Author

zhuxb711 commented Apr 8, 2023

@dahall Hi could take a look and merge this PR?

@dahall
Copy link
Owner

dahall commented Apr 8, 2023

How did you determine the 'void' return value? That seems very inconsistent and it does not have stack or memory errors in the test

@zhuxb711
Copy link
Author

zhuxb711 commented Apr 9, 2023

https://doxygen.reactos.org/dd/ddc/dbgui_8c_source.html#l00344
https://github.com/NeoTheCapt/SweetPotatoNew/blob/0a3b2e6d02efd8ab8e75ccf277f94de7bce959fa/NtApiDotNet/NtDebugNative.cs#L210
https://github.com/zippy1981/ProcessHacker-v1x/blob/6bec95b91f09e1f60b785f2e7f97fa2fc5f0460e/ProcessHacker.Native/Api/NativeFunctions.cs#L2501

This API might report error after calling it multiple times if return NTStatus and all the other repo have the same definition

[DllImport("ntdll.dll")]
public static extern void DbgUiSetThreadDebugObject(IntPtr DebugObjectHandle);

@dahall dahall merged commit 0493dbd into dahall:master Apr 10, 2023
@zhuxb711 zhuxb711 deleted the fix-ntdll-definition branch April 10, 2023 13:52
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.

None yet

2 participants