我正在尝试编写一个 exe,它还导出可以用 rundll32 调用的函数。这可能吗?如果可以,为什么它不能像这样工作?
我密切关注微软对此的建议。
#define RUNDLL32(func) extern "C" __declspec(dllexport) void CALLBACK func(HWND hWnd, HINSTANCE hInst, LPSTR lpszCmdLine, int nCmdShow)
RUNDLL32(MyFunc)
{
MessageBox(0, 0, 0, 0);
}
但是当被调用时
rundll32 myprog.exe,_MyFunc@16
rundll32 崩溃/DEP 启动。