Files
mirror-processhacker/2.x/trunk/ProcessHacker/ntimport.c
T
wj32 1fda267dc5 process enumeration and list view items work
git-svn-id: svn://svn.code.sf.net/p/processhacker/code@2315 21ef857c-d57f-4fe0-8362-d861dc6d29cd
2009-10-25 11:30:46 +00:00

45 lines
1.6 KiB
C

#define NTIMPORT_PRIVATE
#include <ntimport.h>
#include <ph.h>
#define GetProc(DllName, ProcName) GetProcAddress(GetModuleHandle(L##DllName), (ProcName))
#define InitProc(DllName, ProcName) ((ProcName) = (_##ProcName)GetProc(DllName, #ProcName))
#define InitProcReq(DllName, ProcName) \
if (!InitProc(DllName, ProcName)) \
{ \
PhShowError( \
NULL, \
L"Process Hacker cannot run on your operating system. Unable to find %S in %S.", \
#ProcName, \
DllName \
); \
return FALSE; \
}
BOOLEAN PhInitializeImports()
{
InitProcReq("ntdll.dll", NtAlertResumeThread);
InitProcReq("ntdll.dll", NtAlertThread);
InitProcReq("ntdll.dll", NtClose);
InitProcReq("ntdll.dll", NtDuplicateObject);
InitProc("ntdll.dll", NtGetNextProcess);
InitProc("ntdll.dll", NtGetNextThread);
InitProcReq("ntdll.dll", NtOpenProcess);
InitProcReq("ntdll.dll", NtOpenThread);
InitProcReq("ntdll.dll", NtQueryInformationProcess);
InitProcReq("ntdll.dll", NtQueryInformationThread);
InitProcReq("ntdll.dll", NtQueryObject);
InitProcReq("ntdll.dll", NtQuerySystemInformation);
InitProcReq("ntdll.dll", NtQueueApcThread);
InitProcReq("ntdll.dll", NtResumeProcess);
InitProcReq("ntdll.dll", NtResumeThread);
InitProcReq("ntdll.dll", NtSetInformationProcess);
InitProcReq("ntdll.dll", NtSetInformationThread);
InitProcReq("ntdll.dll", NtSuspendProcess);
InitProcReq("ntdll.dll", NtSuspendThread);
InitProcReq("ntdll.dll", NtTerminateProcess);
InitProcReq("ntdll.dll", NtTerminateThread);
return TRUE;
}