Dimitrie O. Paun wrote:

On November 28, 2002 09:51 am, David Fraser wrote:

So part of the question is, in order to get Wine to function properly on
Cygwin, what is the right
threading approach to take? Am I right in thinking that the current code
wouldn't work on Cygwin?

I say, let's get the compiling and linking working, and then worry about
actually running it... :)


As far as I can see the only places get_thread_context and set_thread_context are used is in
scheduler/thread.c, to implement WINAPI GetThreadContext and SetThreadContext

So actually a first approximation for [sg]et_thread_context for
Cygwin would be one that does nothing. Then we can try submitting
patches to Cygwin (Approach 2), so that other apps can make use
of ptrace, if necessary.


OK, done that. So now wineserver.exe actually links :-) And it runs too!
However can't yet see whether its going to do anything as in order to actually run programs
it looks like we need tolink miscemu/main.c
Problem here being that it wants to link with ntdll, which doesn't build yet.
That still needs a lot more work... In the mean time a very simple patch that
does nothing for context_i386.c is below in case anyone else wants to try...
David

Index: server/context_i386.c
===================================================================
RCS file: /home/wine/wine/server/context_i386.c,v
retrieving revision 1.24
diff -u -r1.24 context_i386.c
--- server/context_i386.c 8 Nov 2002 18:55:31 -0000 1.24
+++ server/context_i386.c 28 Nov 2002 15:48:01 -0000
@@ -76,7 +76,24 @@
#define PTRACE_SETDBREGS PT_SETDBREGS
#endif

-#ifdef linux
+#if defined(__CYGWIN__)
+
+/* retrieve a thread context */
+static void get_thread_context( struct thread *thread, unsigned int flags, CONTEXT *context )
+{
+ /* FIXME: implement this */
+ file_set_error();
+}
+
+
+/* set a thread context */
+static void set_thread_context( struct thread *thread, unsigned int flags, const CONTEXT *context )
+{
+ /* FIXME: implement this */
+ file_set_error();
+}
+
+#elif defined(linux)
#ifdef HAVE_SYS_USER_H
# include <sys/user.h>
#endif





Reply via email to