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

Fix wrong error code returned when querying the Windows registry #5621

Conversation

Smjert
Copy link
Member

@Smjert Smjert commented Jul 1, 2019

Calling GetLastError() will not return the error code for the Windows registry APIs,
since they return a LSTATUS value which already the error code.

This also fixes the RegistryTablesTest.test_registry_non_existing_key
test case which was incorrectly expecting success when querying
for a non-existent registry key.

Ported from https://github.com/osql/osql/pull/50

Calling GetLastError() will not return the error code for the Windows registry APIs,
since they return a LSTATUS value which already the error code.

This also fixes the RegistryTablesTest.test_registry_non_existing_key
test case which was incorrectly expecting success when querying
for a non-existent registry key.

Ported from https://github.com/osql/osql/pull/50
@alessandrogario alessandrogario merged commit e7fde8a into osquery:master Jul 1, 2019
@Smjert Smjert deleted the stefano/fix/windows-registry-errorcode branch October 23, 2019 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants