A variable declared as HANDLE can be compared with NULL in C? Thank you.
Edition:
For example:
HANDLE hProcess = NULL;
status = ZwOpenProcess(&hProcess, PROCESS_DUP_HANDLE, &ob, &Cid);
if (hProcess != NULL)
{
ZwClose(hProcess);
hProcess = NULL;
}
The goal is check if hProcess is != 0. Then if i'm checking != NULL, means the same thing?
(Too long for a comment.)
You can check that with
if(hProcess != NULL) { /*...*/ }as explained in the other answers.However, in the given example what must be checked is the return value of the API call, instead.