Hello,
I have a question, the second call of NtQuerySystemInformation can return STATUS_INFO_LENGTH_MISMATCH ?
If yes, i need to use "do { } while", no ?
Thx !
I have a question, the second call of NtQuerySystemInformation can return STATUS_INFO_LENGTH_MISMATCH ?
If yes, i need to use "do { } while", no ?
Thx !
Code: Select all
ULONG BytesRet;
PSYSTEM_PROCESS_INFORMATION pSPI;
if (NtQuerySystemInformation(SystemProcessesAndThreadsInformation, pSPI, 0, &BytesRet) == STATUS_INFO_LENGTH_MISMATCH)
{
if (pSPI = (PSYSTEM_PROCESS_INFORMATION)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, BytesRet))
{
if(NtQuerySystemInformation(SystemProcessesAndThreadsInformation, pSPI, BytesRet, &BytesRet) == STATUS_SUCCESS)
{
// SUCCESS HERE
}
}
}