【winapi】GetModuleHandle

文章目录
  1. 1. 定义函数原型
  2. 2. 获取函数

GetModuleHandle 函数用法

定义函数原型

1
typedef BOOL(WINAPI *LPFN_GLPI)(PSYSTEM_LOGICAL_PROCESSOR_INFORMATION, PDWORD);

获取函数

1
2
3
4
5
6
7
8
9
10
11
12
LPFN_GLPI glpi;
glpi = (LPFN_GLPI)GetProcAddress(
GetModuleHandle(TEXT("kernel32")),
"GetLogicalProcessorInformation");
if (NULL == glpi)
{
DbgTrace(L"[%s]GetLogicalProcessorInformation is not supported.\n", __FUNCTIONW__);
}
else
{
DbgTrace(L"[%s]GetLogicalProcessorInformation is supported.\n", __FUNCTIONW__);
}