On Mon, 10 May 2004 10:29:34 +0100, Mike Hearn wrote:
Implementing this API would be extremely difficult.
Me, Mike and Dmitry discussed this on IRC and came up with the following two approaches to implementing it.
The first, which is probably the simplest, is just to send a signal to the program which then gets the pending thread creation info from the wineserver and sets up the thread.
The second is to have some code at a magic location in memory placed there by Wine beforehand. The caller of CreateRemoteThread then uses ptrace to attach to the remote process and jump the main thread to that code. In other words you literally take control of a pre-existing thread and make it to your bidding.
The signal approach is probably easiest. I originally thought signal stacks were too small to do anything like wineserver RPCs on but Mike says that isn't the case anymore, so it's probably the nicest way to implement.
In theory it shouldn't even be too hard. A nice project for somebody interested in the lower levels :)
thanks -mike