Skip to content

Commit

Permalink
use proper type sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
twall committed Nov 22, 2015
1 parent 7771d8a commit 8003775
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ public String getDocString() {
*
* @return the help context
*/
public long getHelpContext() {
public int getHelpContext() {
return helpContext;
}

Expand Down
22 changes: 15 additions & 7 deletions contrib/platform/test/com/sun/jna/platform/win32/User32Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
import com.sun.jna.platform.win32.WinDef.HICON;
import com.sun.jna.platform.win32.WinDef.HWND;
import com.sun.jna.platform.win32.WinDef.LPARAM;
import com.sun.jna.platform.win32.WinDef.LRESULT;
import com.sun.jna.platform.win32.WinDef.WPARAM;
import com.sun.jna.platform.win32.WinDef.POINT;
import com.sun.jna.platform.win32.WinDef.RECT;
import com.sun.jna.platform.win32.WinDef.UINT;
Expand All @@ -45,6 +47,7 @@
import com.sun.jna.platform.win32.WinUser.MONITORENUMPROC;
import com.sun.jna.platform.win32.WinUser.MONITORINFO;
import com.sun.jna.platform.win32.WinUser.MONITORINFOEX;
import com.sun.jna.platform.win32.BaseTSD.ULONG_PTR;

/**
* @author dblock[at]dblock[dot]org
Expand Down Expand Up @@ -281,9 +284,12 @@ public void testSendMessageTimeout() {
assertNotNull(explorerProc);

final DWORDByReference hIconNumber = new DWORDByReference();
long result = User32.INSTANCE.SendMessageTimeout(
explorerProc.getHWND(), WinUser.WM_GETICON, WinUser.ICON_BIG,
0, WinUser.SMTO_ABORTIFHUNG, 500, hIconNumber);
LRESULT result = User32.INSTANCE
.SendMessageTimeout(explorerProc.getHWND(),
WinUser.WM_GETICON,
new WPARAM(WinUser.ICON_BIG),
new LPARAM(0),
WinUser.SMTO_ABORTIFHUNG, 500, hIconNumber);

assertNotEquals(0, result);
}
Expand All @@ -292,12 +298,14 @@ public void testSendMessageTimeout() {
public void testGetClassLongPtr() {
DesktopWindow explorerProc = getWindowByProcessPath("explorer.exe");

assertNotNull(explorerProc);
assertNotNull("Could not find explorer.exe process",
explorerProc);

long result = User32.INSTANCE.GetClassLongPtr(explorerProc.getHWND(),
WinUser.GCLP_HMODULE);
ULONG_PTR result = User32.INSTANCE
.GetClassLongPtr(explorerProc.getHWND(),
WinUser.GCLP_HMODULE);

assertNotEquals(0, result);
assertNotEquals(0, result.intValue());
}

@Test
Expand Down

0 comments on commit 8003775

Please sign in to comment.