我一直在尝试使用GetProcAddress
kernel32.dll 中的几个函数。它工作得很好,除了“OutputDebugString”函数。
我的代码:
typedef void(WINAPI *LPGETNUMBER)(LPCTSTR);
int main() {
const LPGETNUMBER pAddr = (LPGETNUMBER)GetProcAddress(GetModuleHandle((LPCSTR)("kernel32.dll")), "OutputDebugString");
if (NULL == pAddr) {
int32_t nLastErrorCode = GetLastError();
}
}