我正在尝试将一个字符串(或 char*)从 Rundll32 传递给使用此源构建的 DLL(使用 MinGW):
#include <windows.h>
__declspec( dllexport ) int hello(LPSTR content) {
MessageBox( NULL, content, "Message", MB_OK );
return 0;
}
运行此程序时,我会随机崩溃。这就是我运行它的方式。
C:\workspace>c:\MinGW\bin\gdb.exe rundll32 -ex "run program1.dll,hello test"
我尝试在 hello() 处设置断点,似乎“内容”非常随机。我是否以错误的方式从 rundll32 传递参数?
如果我没有论据,它工作得很好。