Testing for an invalid windows handle: should I compare with 'NULL', '0' or even 'nullptr'?
To answer your question: the HANDLE
type is declared in winnt.h as
typedef PVOID HANDLE;
Hence, technically it is a pointer.
However, I would just use whatever is documented; if the documentation states that NULL
is returned, I use exactly that unless evidence shows that the documentation is incorrect.
I don't even think about pointers vs. integers. NULL
is just an opaque value (in this situation) and HANDLE
is an opaque type to me and I don't bother looking up what it is #define
'd to.