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

REG_NOTIFY_THREAD_AGNOSTIC should be supported #1333 #1337

Conversation

Dani-Hub
Copy link
Contributor

Starting with Windows 8, the additional notification filter constant REG_NOTIFY_THREAD_AGNOSTIC has been added, which is used as possible control argument for RegNotifyChangeKeyValue's dwNotifyFilter function argument (see nf-winreg-regnotifychangekeyvalue) and whose underlying integral value has the value 0x10000000 (specified on the page linked above). This constant is currently missing in the existing set of REG_NOTIFY_CHANGE_* constants in com.sun.jna.platform.win32.WinNT. In addition to the lack of the constant, the second problem is, that for Windows systems of at least Windows 8, the existing combined constant, which is currently defined as

int REG_LEGAL_CHANGE_FILTER = REG_NOTIFY_CHANGE_NAME
| REG_NOTIFY_CHANGE_ATTRIBUTES | REG_NOTIFY_CHANGE_LAST_SET
| REG_NOTIFY_CHANGE_SECURITY;

is incorrect, because it needs to take the additional value of REG_NOTIFY_THREAD_AGNOSTIC into account.

This change requests solves both problems by (a) providing the missing REG_NOTIFY_THREAD_AGNOSTIC constant in com.sun.jna.platform.win32.WinNT and (b) by updating the existing REG_LEGAL_CHANGE_FILTER constant in regard to the added REG_NOTIFY_THREAD_AGNOSTIC

@dbwiddis
Copy link
Contributor

Looks good. Please add an entry to CHANGES.md.

@dbwiddis dbwiddis linked an issue Apr 15, 2021 that may be closed by this pull request
possible control argument for RegNotifyChangeKeyValue's dwNotifyFilter
function argument (see nf-winreg-regnotifychangekeyvalue) and whose
underlying integral value has the value 0x10000000 (specified on the
page linked above). This constant is currently missing in the existing
set of REG_NOTIFY_CHANGE_* constants in
com.sun.jna.platform.win32.WinNT. In addition to the lack of the
constant, the second problem is, that for Windows systems of at least
Windows 8, the existing combined constant, which is currently defined as

int REG_LEGAL_CHANGE_FILTER = REG_NOTIFY_CHANGE_NAME
            | REG_NOTIFY_CHANGE_ATTRIBUTES | REG_NOTIFY_CHANGE_LAST_SET
            | REG_NOTIFY_CHANGE_SECURITY;

is incorrect, because it needs to take the additional value of
REG_NOTIFY_THREAD_AGNOSTIC into account.

This change requests solves both problems by (a) providing the missing
REG_NOTIFY_THREAD_AGNOSTIC constant in com.sun.jna.platform.win32.WinNT
and (b) by updating the existing REG_LEGAL_CHANGE_FILTER constant in
regard to the added REG_NOTIFY_THREAD_AGNOSTIC
@dbwiddis dbwiddis force-pushed the #1333-REG_NOTIFY_THREAD_AGNOSTIC-should-be-supported branch from 6992d55 to c19001d Compare April 18, 2021 16:40
@dbwiddis dbwiddis merged commit 1988f69 into java-native-access:master Apr 18, 2021
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.

REG_NOTIFY_THREAD_AGNOSTIC should be supported
2 participants