In this small program, why does GetCurrentProcess() return -1?
int _tmain(int argc, _TCHAR* argv[]) {
HANDLE h = GetCurrentProcess(); // ret -1
printf("0x%x\n",(DWORD)h);
return 0;
}
What’s wrong?
In Kernel32.GetCurrentProcess I see this:
OR EAX,FFFFFFFF ; EAX - ?
RETN
That is correct, see this API reference for GetCurrentProcess.