k***@public.gmane.org
2011-03-31 08:55:21 UTC
Windows headers define
#define INVALID_HANDLE_VALUE -1
I have in my code
INVALID_HANDLE_VALUE = new Pointer(0xFFFFFFFF) and this works in that
if a Windows API functions returns invalid handle value then comparison
using equals against my INVALID_HANDLE_VALUE returns true.
So far so good.
I suppose there is no way to define a INVALID_HANDLE_VALUE Pointer that
could be used with == instead of equals ?
Also when I print the Pointers I see that internally the Pointer is 64
bit because if I define Pointer(0xFFFFFFFF) or Pointer(-1) I they are
different. In my 32 WinXP the Pointer value return by the JNA/WIN API
call is internally 0xFFFFFFFF but I suspect that on 64 bit Windows it
would be different...?
So what would be the correct way to define INVALID_HANDLE_VALUE Pointer
in Java/JNA so that it works both on 32 and 64 bit Windows?
#define INVALID_HANDLE_VALUE -1
I have in my code
INVALID_HANDLE_VALUE = new Pointer(0xFFFFFFFF) and this works in that
if a Windows API functions returns invalid handle value then comparison
using equals against my INVALID_HANDLE_VALUE returns true.
So far so good.
I suppose there is no way to define a INVALID_HANDLE_VALUE Pointer that
could be used with == instead of equals ?
Also when I print the Pointers I see that internally the Pointer is 64
bit because if I define Pointer(0xFFFFFFFF) or Pointer(-1) I they are
different. In my 32 WinXP the Pointer value return by the JNA/WIN API
call is internally 0xFFFFFFFF but I suspect that on 64 bit Windows it
would be different...?
So what would be the correct way to define INVALID_HANDLE_VALUE Pointer
in Java/JNA so that it works both on 32 and 64 bit Windows?