This is the mail archive of the win32-x11@sources.redhat.com mailing list for the win32-x11 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

The right approach to loading a program with a dll


Hi

Basically start a child application with the flag CREATE_SUSPENDED (which creates the process, loads it into memory, but doesn't start running it, putting the main thread in suspend mode) and then go through a routine that manually inserts a dll into the memory of the child process.
On Win 95/98 the child process has to be run with DEBUG_PROCESS API but under NT/2000/XP it doesn't.

Attached simple code to demo the loading in suspended mode although it doesn't yet inject the dll (which is obviously the hard bit)
Can be demonstrated by running ./wrapX11 notepad.exe with notepad.exe
in the current directory.
Can be compiled with g++ -o wrapX11.exe wrapX11.cpp under mingw/cygwin

David

X bitmap


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]