Курсовая работа: Характеристика Win32

SYSTEMTIME System_CreateTime;

char CreateTime_str[55];

NTSTATUS Status;

ULONG cbBuffer = 0x8000;

PVOID pBuffer = NULL;

do

{

pBuffer = HeapAlloc (hHeap, 0, cbBuffer);

if (pBuffer == NULL)

return SetLastError (ERROR_NOT_ENOUGH_MEMORY), FALSE;

Status = _ZwQuerySystemInformation (

SystemProcessesAndThreadsInformation,

pBuffer, cbBuffer, NULL);

if (Status == STATUS_INFO_LENGTH_MISMATCH)

{

HeapFree (hHeap, 0, pBuffer);

cbBuffer *= 2;

}

else if (! NT_SUCCESS(Status))

{

HeapFree (hHeap, 0, pBuffer);

return SetLastError(Status), FALSE;

}

}

while (Status == STATUS_INFO_LENGTH_MISMATCH);

PSYSTEM_PROCESSES pProcesses = (PSYSTEM_PROCESSES) pBuffer;

for (;)

{

PCWSTR pszProcessName = pProcesses->ProcessName. Buffer;

К-во Просмотров: 744
Бесплатно скачать Курсовая работа: Характеристика Win32