I am trying to pass a string (or char*) from Rundll32 to a DLL built (with MinGW) using this source:
#include <windows.h>
__declspec( dllexport ) int hello(LPSTR content) {
MessageBox( NULL, content, "Message", MB_OK );
return 0;
}
When running this I get random crashes. This is how I run it.
C:\workspace>c:\MinGW\bin\gdb.exe rundll32 -ex "run program1.dll,hello test"
I tried setting a breakpoint at hello() and it seems that "content" is pretty random. Am I passing the argument from rundll32 in the wrong way?
It works fine if I don't have arguments.