Skip to content

Commit

Permalink
Bug fix in WinNT.java
Browse files Browse the repository at this point in the history
Please refer to Issue java-native-access#1128 (KEY_ALL_ACCESS value is incorrect in WinNT.java) for details. There is an explanation why it needs to be fixed. 

In short, The KEY_ALL_ACCESS variable has missing parentheses, which gives an incorrect ORed value. It should match with the original winnt.h C header file in Win32.
  • Loading branch information
trevormaggs authored Aug 22, 2019
1 parent cdad205 commit 5bd7be4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions contrib/platform/src/com/sun/jna/platform/win32/WinNT.java
Original file line number Diff line number Diff line change
Expand Up @@ -919,9 +919,9 @@ public FILE_NOTIFY_INFORMATION next() {

int KEY_EXECUTE = KEY_READ & (~SYNCHRONIZE);

int KEY_ALL_ACCESS = STANDARD_RIGHTS_ALL | KEY_QUERY_VALUE | KEY_SET_VALUE
| KEY_CREATE_SUB_KEY | KEY_ENUMERATE_SUB_KEYS | KEY_NOTIFY
| KEY_CREATE_LINK & (~SYNCHRONIZE);
int KEY_ALL_ACCESS = ((STANDARD_RIGHTS_ALL | KEY_QUERY_VALUE | KEY_SET_VALUE
| KEY_CREATE_SUB_KEY | KEY_ENUMERATE_SUB_KEYS | KEY_NOTIFY
| KEY_CREATE_LINK) & (~SYNCHRONIZE));

//
// Open/Create Options
Expand Down

0 comments on commit 5bd7be4

Please sign in to comment.