Курсовая работа: Характеристика Win32
IO_COUNTERS IoCounters;
#endif
SYSTEM_THREADS Threads[1];
} SYSTEM_PROCESSES, * PSYSTEM_PROCESSES;
// –
// EnumProcesses_NtApi
BOOL
WINAPI
EnumProcesses_NtApi (
IN LPCTSTR pszMachineName,
IN PFNENUMPROC pfnEnumProc,
IN LPARAM lParam
)
{
_UNUSED(pszMachineName);
_ASSERTE (pfnEnumProc!= NULL);
_ASSERTE (pszMachineName == NULL);
HINSTANCE hNtDll;
NTSTATUS (WINAPI * _ZwQuerySystemInformation) (UINT, PVOID, ULONG, PULONG);
// get handle to NTDLL.DLL
hNtDll = GetModuleHandle (_T(«ntdll.dll»));
_ASSERTE (hNtDll!= NULL);
// find the address of ZwQuerySystemInformation
*(FARPROC *)&_ZwQuerySystemInformation =
GetProcAddress (hNtDll, «ZwQuerySystemInformation»);
if (_ZwQuerySystemInformation == NULL)
return SetLastError (ERROR_PROC_NOT_FOUND), FALSE;
// obtain a handle to the default process heap
HANDLE hHeap = GetProcessHeap();