Skip to content

Commit

Permalink
fix #128, use 16-bit mask for upper/lower parts of DWORD
Browse files Browse the repository at this point in the history
  • Loading branch information
twall committed Oct 6, 2012
1 parent d51479c commit 245eb88
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Bug Fixes
* Cleanup maven poms and publishing to central repo - [@bhamail](https://github.com/bhamail).
* [#129](https://github.com/twall/jna/issues/129): Allow `Memory` field in structure - [@twall](https://github.com/twall).
* Preserve `PointerType` fields on `Structure.read()` if unchanged - [@twall](https://github.com/twall).
* [#128](https://github.com/twall/jna/issues/128): Fix masking extracting DWORD upper and lower WORD values - [@twall](https://github.com/twall).

Release 3.4.2
=============
Expand Down
4 changes: 2 additions & 2 deletions contrib/platform/src/com/sun/jna/platform/win32/WinDef.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public DWORD(long value) {
* Low WORD.
*/
public WORD getLow() {
return new WORD(longValue() & 0xFF);
return new WORD(longValue() & 0xFFFF);
}

/**
Expand All @@ -74,7 +74,7 @@ public WORD getLow() {
* High WORD.
*/
public WORD getHigh() {
return new WORD((longValue() >> 16) & 0xFF);
return new WORD((longValue() >> 16) & 0xFFFF);
}
}

Expand Down

0 comments on commit 245eb88

Please sign in to comment.