windows系统通过rundll32提供直接运行dll的功能
此dll功能实现原型为:
void CALLBACK
EntryPoint(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow);
例如在一个dll中定义一个输出函数如下:
extern "C" _declspec(dllexport) void __cdecl msgbox(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow)
{
MessageBox(hwnd, "msgbox", lpszCmdLine, MB_OK);
return;
}
生成dll文件(rundlltest.dll)后,可通过rundll32.exe直接运行显示此消息对话框。命令如下:
rundll32.exe rundlltest.dll,msgbox hello
参考:
https://support.microsoft.com/zh-cn/help/164787/info-windows-rundll-and-rundll32-interface
网友评论