It seems NtQueryInformationThread needs DWORD for x86 and DWORD64 for x64 for both size and pointer variable?
How could i make it generic to compile both in x86 and x64? It seems LPVOID is not going to help because it just gave me incorrect results.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Ok, Just found making it LPVOID makes it compilable across architecture.
DWORD ntStatus = NtQueryInformationThread(hTemporaryHandle, ThreadQuerySetWin32StartAddress, dwStartAddress, sizeof(LPVOID), NULL);
where
dwStartAddressis alsoLPVOIDbut pointing to DWORD or DWORD64 variable according to the target environment.