Skip to content

Commit 245eb88

Browse files
committed
fix #128, use 16-bit mask for upper/lower parts of DWORD
1 parent d51479c commit 245eb88

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Bug Fixes
2020
* Cleanup maven poms and publishing to central repo - [@bhamail](https://github.com/bhamail).
2121
* [#129](https://github.com/twall/jna/issues/129): Allow `Memory` field in structure - [@twall](https://github.com/twall).
2222
* Preserve `PointerType` fields on `Structure.read()` if unchanged - [@twall](https://github.com/twall).
23+
* [#128](https://github.com/twall/jna/issues/128): Fix masking extracting DWORD upper and lower WORD values - [@twall](https://github.com/twall).
2324

2425
Release 3.4.2
2526
=============

contrib/platform/src/com/sun/jna/platform/win32/WinDef.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public DWORD(long value) {
6565
* Low WORD.
6666
*/
6767
public WORD getLow() {
68-
return new WORD(longValue() & 0xFF);
68+
return new WORD(longValue() & 0xFFFF);
6969
}
7070

7171
/**
@@ -74,7 +74,7 @@ public WORD getLow() {
7474
* High WORD.
7575
*/
7676
public WORD getHigh() {
77-
return new WORD((longValue() >> 16) & 0xFF);
77+
return new WORD((longValue() >> 16) & 0xFFFF);
7878
}
7979
}
8080

0 commit comments

Comments
 (0)