PARSECMDLINESENDW crash

English main discussion
Post Reply
  • Author
  • Message
Offline
Posts: 167
Joined: Fri Aug 15, 2008 8:58 am

PARSECMDLINESENDW crash

Post by Diamen »

Why this code crash?

Code: Select all

typedef struct {
	const wchar_t* pCmdLine;
	const wchar_t* pWorkDir;
} PARSECMDLINESENDW;
PARSECMDLINESENDW pcls;
pcls.pCmdLine = L"/Exec(\"calc.exe\")";
pcls.pWorkDir = L"";
SendMessage(FindWindow("AkelPad4", NULL), WM_USER + 125, 0, (LPARAM)& pcls);

Offline
Site Admin
Posts: 6417
Joined: Thu Jul 06, 2006 7:20 am

Post by Instructor »

Diamen
You will get crash if you call PARSECMDLINESENDW not inside AkelPad.exe process. Because any process can't access other process memory directly (&pcls pointer). You can send WM_COPYDATA with CD_PARSECMDLINEW, see AkelDLL.h.
Post Reply