C++11:简化动态调用外部函数

#define INIT_DLL_FUNCTION(dll, name) name = reinterpret_cast<decltype(name)>(::GetProcAddress(::LoadLibrary(_T(dll)), #name));
NTSTATUS(WINAPI *NtOpenDirectoryObject)(
	_Out_  PHANDLE DirectoryHandle,
	_In_   ACCESS_MASK DesiredAccess,
	_In_   POBJECT_ATTRIBUTES ObjectAttributes
	);
INIT_DLL_FUNCTION("NTDLL.DLL", NtOpenDirectoryObject);
NtOpenDirectoryObject(...);

C++11:简化动态调用外部函数》上有1条评论

发表评论

电子邮件地址不会被公开。 必填项已用*标注