Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix wrong definition of WinNT#KEY_ALL_ACCESS
A bug exists in Line 922 of the WinNT.java source code. ``` 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); ``` The bitmask value given by the above combination is incorrect due to the missing parentheses. It should match with the original winnt.h C header file in Win32. ``` #define 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)) ``` The bug in Java gives an incorrect hex value of 0x1f003f, which should be **0xf003f** as confirmed by the C header. 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